Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | def WebIDLTest(parser, harness): |
michael@0 | 2 | threw = False |
michael@0 | 3 | try: |
michael@0 | 4 | parser.parse(""" |
michael@0 | 5 | interface SpecialMethodSignatureMismatch1 { |
michael@0 | 6 | getter long long foo(long index); |
michael@0 | 7 | }; |
michael@0 | 8 | """) |
michael@0 | 9 | |
michael@0 | 10 | results = parser.finish() |
michael@0 | 11 | except: |
michael@0 | 12 | threw = True |
michael@0 | 13 | |
michael@0 | 14 | harness.ok(threw, "Should have thrown.") |
michael@0 | 15 | |
michael@0 | 16 | threw = False |
michael@0 | 17 | try: |
michael@0 | 18 | parser.parse(""" |
michael@0 | 19 | interface SpecialMethodSignatureMismatch2 { |
michael@0 | 20 | getter void foo(unsigned long index); |
michael@0 | 21 | }; |
michael@0 | 22 | """) |
michael@0 | 23 | |
michael@0 | 24 | results = parser.finish() |
michael@0 | 25 | except: |
michael@0 | 26 | threw = True |
michael@0 | 27 | |
michael@0 | 28 | harness.ok(threw, "Should have thrown.") |
michael@0 | 29 | |
michael@0 | 30 | threw = False |
michael@0 | 31 | try: |
michael@0 | 32 | parser.parse(""" |
michael@0 | 33 | interface SpecialMethodSignatureMismatch3 { |
michael@0 | 34 | getter boolean foo(unsigned long index, boolean extraArg); |
michael@0 | 35 | }; |
michael@0 | 36 | """) |
michael@0 | 37 | |
michael@0 | 38 | results = parser.finish() |
michael@0 | 39 | except: |
michael@0 | 40 | threw = True |
michael@0 | 41 | |
michael@0 | 42 | harness.ok(threw, "Should have thrown.") |
michael@0 | 43 | |
michael@0 | 44 | threw = False |
michael@0 | 45 | try: |
michael@0 | 46 | parser.parse(""" |
michael@0 | 47 | interface SpecialMethodSignatureMismatch4 { |
michael@0 | 48 | getter boolean foo(unsigned long... index); |
michael@0 | 49 | }; |
michael@0 | 50 | """) |
michael@0 | 51 | |
michael@0 | 52 | results = parser.finish() |
michael@0 | 53 | except: |
michael@0 | 54 | threw = True |
michael@0 | 55 | |
michael@0 | 56 | harness.ok(threw, "Should have thrown.") |
michael@0 | 57 | |
michael@0 | 58 | threw = False |
michael@0 | 59 | try: |
michael@0 | 60 | parser.parse(""" |
michael@0 | 61 | interface SpecialMethodSignatureMismatch5 { |
michael@0 | 62 | getter boolean foo(optional unsigned long index); |
michael@0 | 63 | }; |
michael@0 | 64 | """) |
michael@0 | 65 | |
michael@0 | 66 | results = parser.finish() |
michael@0 | 67 | except: |
michael@0 | 68 | threw = True |
michael@0 | 69 | |
michael@0 | 70 | harness.ok(threw, "Should have thrown.") |
michael@0 | 71 | |
michael@0 | 72 | threw = False |
michael@0 | 73 | try: |
michael@0 | 74 | parser.parse(""" |
michael@0 | 75 | interface SpecialMethodSignatureMismatch6 { |
michael@0 | 76 | getter boolean foo(); |
michael@0 | 77 | }; |
michael@0 | 78 | """) |
michael@0 | 79 | |
michael@0 | 80 | results = parser.finish() |
michael@0 | 81 | except: |
michael@0 | 82 | threw = True |
michael@0 | 83 | |
michael@0 | 84 | harness.ok(threw, "Should have thrown.") |
michael@0 | 85 | |
michael@0 | 86 | threw = False |
michael@0 | 87 | try: |
michael@0 | 88 | parser.parse(""" |
michael@0 | 89 | interface SpecialMethodSignatureMismatch7 { |
michael@0 | 90 | deleter long long foo(long index); |
michael@0 | 91 | }; |
michael@0 | 92 | """) |
michael@0 | 93 | |
michael@0 | 94 | results = parser.finish() |
michael@0 | 95 | except: |
michael@0 | 96 | threw = True |
michael@0 | 97 | |
michael@0 | 98 | harness.ok(threw, "Should have thrown.") |
michael@0 | 99 | |
michael@0 | 100 | threw = False |
michael@0 | 101 | try: |
michael@0 | 102 | parser.parse(""" |
michael@0 | 103 | interface SpecialMethodSignatureMismatch9 { |
michael@0 | 104 | deleter boolean foo(unsigned long index, boolean extraArg); |
michael@0 | 105 | }; |
michael@0 | 106 | """) |
michael@0 | 107 | |
michael@0 | 108 | results = parser.finish() |
michael@0 | 109 | except: |
michael@0 | 110 | threw = True |
michael@0 | 111 | |
michael@0 | 112 | harness.ok(threw, "Should have thrown.") |
michael@0 | 113 | |
michael@0 | 114 | threw = False |
michael@0 | 115 | try: |
michael@0 | 116 | parser.parse(""" |
michael@0 | 117 | interface SpecialMethodSignatureMismatch10 { |
michael@0 | 118 | deleter boolean foo(unsigned long... index); |
michael@0 | 119 | }; |
michael@0 | 120 | """) |
michael@0 | 121 | |
michael@0 | 122 | results = parser.finish() |
michael@0 | 123 | except: |
michael@0 | 124 | threw = True |
michael@0 | 125 | |
michael@0 | 126 | harness.ok(threw, "Should have thrown.") |
michael@0 | 127 | |
michael@0 | 128 | threw = False |
michael@0 | 129 | try: |
michael@0 | 130 | parser.parse(""" |
michael@0 | 131 | interface SpecialMethodSignatureMismatch11 { |
michael@0 | 132 | deleter boolean foo(optional unsigned long index); |
michael@0 | 133 | }; |
michael@0 | 134 | """) |
michael@0 | 135 | |
michael@0 | 136 | results = parser.finish() |
michael@0 | 137 | except: |
michael@0 | 138 | threw = True |
michael@0 | 139 | |
michael@0 | 140 | harness.ok(threw, "Should have thrown.") |
michael@0 | 141 | |
michael@0 | 142 | threw = False |
michael@0 | 143 | try: |
michael@0 | 144 | parser.parse(""" |
michael@0 | 145 | interface SpecialMethodSignatureMismatch12 { |
michael@0 | 146 | deleter boolean foo(); |
michael@0 | 147 | }; |
michael@0 | 148 | """) |
michael@0 | 149 | |
michael@0 | 150 | results = parser.finish() |
michael@0 | 151 | except: |
michael@0 | 152 | threw = True |
michael@0 | 153 | |
michael@0 | 154 | harness.ok(threw, "Should have thrown.") |
michael@0 | 155 | |
michael@0 | 156 | threw = False |
michael@0 | 157 | try: |
michael@0 | 158 | parser.parse(""" |
michael@0 | 159 | interface SpecialMethodSignatureMismatch13 { |
michael@0 | 160 | setter long long foo(long index, long long value); |
michael@0 | 161 | }; |
michael@0 | 162 | """) |
michael@0 | 163 | |
michael@0 | 164 | results = parser.finish() |
michael@0 | 165 | except: |
michael@0 | 166 | threw = True |
michael@0 | 167 | |
michael@0 | 168 | harness.ok(threw, "Should have thrown.") |
michael@0 | 169 | |
michael@0 | 170 | threw = False |
michael@0 | 171 | try: |
michael@0 | 172 | parser.parse(""" |
michael@0 | 173 | interface SpecialMethodSignatureMismatch15 { |
michael@0 | 174 | setter boolean foo(unsigned long index, boolean value, long long extraArg); |
michael@0 | 175 | }; |
michael@0 | 176 | """) |
michael@0 | 177 | |
michael@0 | 178 | results = parser.finish() |
michael@0 | 179 | except: |
michael@0 | 180 | threw = True |
michael@0 | 181 | |
michael@0 | 182 | harness.ok(threw, "Should have thrown.") |
michael@0 | 183 | |
michael@0 | 184 | threw = False |
michael@0 | 185 | try: |
michael@0 | 186 | parser.parse(""" |
michael@0 | 187 | interface SpecialMethodSignatureMismatch16 { |
michael@0 | 188 | setter boolean foo(unsigned long index, boolean... value); |
michael@0 | 189 | }; |
michael@0 | 190 | """) |
michael@0 | 191 | |
michael@0 | 192 | results = parser.finish() |
michael@0 | 193 | except: |
michael@0 | 194 | threw = True |
michael@0 | 195 | |
michael@0 | 196 | harness.ok(threw, "Should have thrown.") |
michael@0 | 197 | |
michael@0 | 198 | threw = False |
michael@0 | 199 | try: |
michael@0 | 200 | parser.parse(""" |
michael@0 | 201 | interface SpecialMethodSignatureMismatch17 { |
michael@0 | 202 | setter boolean foo(unsigned long index, optional boolean value); |
michael@0 | 203 | }; |
michael@0 | 204 | """) |
michael@0 | 205 | |
michael@0 | 206 | results = parser.finish() |
michael@0 | 207 | except: |
michael@0 | 208 | threw = True |
michael@0 | 209 | |
michael@0 | 210 | harness.ok(threw, "Should have thrown.") |
michael@0 | 211 | |
michael@0 | 212 | threw = False |
michael@0 | 213 | try: |
michael@0 | 214 | parser.parse(""" |
michael@0 | 215 | interface SpecialMethodSignatureMismatch18 { |
michael@0 | 216 | setter boolean foo(); |
michael@0 | 217 | }; |
michael@0 | 218 | """) |
michael@0 | 219 | |
michael@0 | 220 | results = parser.finish() |
michael@0 | 221 | except: |
michael@0 | 222 | threw = True |
michael@0 | 223 | |
michael@0 | 224 | harness.ok(threw, "Should have thrown.") |
michael@0 | 225 | |
michael@0 | 226 | threw = False |
michael@0 | 227 | try: |
michael@0 | 228 | parser.parse(""" |
michael@0 | 229 | interface SpecialMethodSignatureMismatch20 { |
michael@0 | 230 | creator long long foo(long index, long long value); |
michael@0 | 231 | }; |
michael@0 | 232 | """) |
michael@0 | 233 | |
michael@0 | 234 | results = parser.finish() |
michael@0 | 235 | except: |
michael@0 | 236 | threw = True |
michael@0 | 237 | |
michael@0 | 238 | harness.ok(threw, "Should have thrown.") |
michael@0 | 239 | |
michael@0 | 240 | threw = False |
michael@0 | 241 | try: |
michael@0 | 242 | parser.parse(""" |
michael@0 | 243 | interface SpecialMethodSignatureMismatch22 { |
michael@0 | 244 | creator boolean foo(unsigned long index, boolean value, long long extraArg); |
michael@0 | 245 | }; |
michael@0 | 246 | """) |
michael@0 | 247 | |
michael@0 | 248 | results = parser.finish() |
michael@0 | 249 | except: |
michael@0 | 250 | threw = True |
michael@0 | 251 | |
michael@0 | 252 | harness.ok(threw, "Should have thrown.") |
michael@0 | 253 | |
michael@0 | 254 | threw = False |
michael@0 | 255 | try: |
michael@0 | 256 | parser.parse(""" |
michael@0 | 257 | interface SpecialMethodSignatureMismatch23 { |
michael@0 | 258 | creator boolean foo(unsigned long index, boolean... value); |
michael@0 | 259 | }; |
michael@0 | 260 | """) |
michael@0 | 261 | |
michael@0 | 262 | results = parser.finish() |
michael@0 | 263 | except: |
michael@0 | 264 | threw = True |
michael@0 | 265 | |
michael@0 | 266 | harness.ok(threw, "Should have thrown.") |
michael@0 | 267 | |
michael@0 | 268 | threw = False |
michael@0 | 269 | try: |
michael@0 | 270 | parser.parse(""" |
michael@0 | 271 | interface SpecialMethodSignatureMismatch24 { |
michael@0 | 272 | creator boolean foo(unsigned long index, optional boolean value); |
michael@0 | 273 | }; |
michael@0 | 274 | """) |
michael@0 | 275 | |
michael@0 | 276 | results = parser.finish() |
michael@0 | 277 | except: |
michael@0 | 278 | threw = True |
michael@0 | 279 | |
michael@0 | 280 | harness.ok(threw, "Should have thrown.") |
michael@0 | 281 | |
michael@0 | 282 | threw = False |
michael@0 | 283 | try: |
michael@0 | 284 | parser.parse(""" |
michael@0 | 285 | interface SpecialMethodSignatureMismatch25 { |
michael@0 | 286 | creator boolean foo(); |
michael@0 | 287 | }; |
michael@0 | 288 | """) |
michael@0 | 289 | |
michael@0 | 290 | results = parser.finish() |
michael@0 | 291 | except: |
michael@0 | 292 | threw = True |
michael@0 | 293 | |
michael@0 | 294 | harness.ok(threw, "Should have thrown.") |