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.
1 import WebIDL
3 def WebIDLTest(parser, harness):
4 parser.parse("""
5 [TreatNonCallableAsNull] callback Function = any(any... arguments);
7 interface TestTreatNonCallableAsNull1 {
8 attribute Function? onfoo;
9 attribute Function onbar;
10 };
11 """)
13 results = parser.finish()
15 iface = results[1]
16 attr = iface.members[0]
17 harness.check(attr.type.treatNonCallableAsNull(), True, "Got the expected value")
18 attr = iface.members[1]
19 harness.check(attr.type.treatNonCallableAsNull(), False, "Got the expected value")
21 parser = parser.reset()
23 threw = False
24 try:
25 parser.parse("""
26 callback Function = any(any... arguments);
28 interface TestTreatNonCallableAsNull2 {
29 [TreatNonCallableAsNull] attribute Function onfoo;
30 };
31 """)
33 results = parser.finish()
34 except:
35 threw = True
37 harness.ok(threw, "Should have thrown.")
39 parser = parser.reset()
41 threw = False
42 try:
43 parser.parse("""
44 callback Function = any(any... arguments);
46 [TreatNonCallableAsNull]
47 interface TestTreatNonCallableAsNull3 {
48 attribute Function onfoo;
49 };
50 """)
52 results = parser.finish()
53 except:
54 threw = True
56 harness.ok(threw, "Should have thrown.")
58 parser = parser.reset()
60 threw = False
61 try:
62 parser.parse("""
63 [TreatNonCallableAsNull, TreatNonObjectAsNull]
64 callback Function = any(any... arguments);
65 """)
67 results = parser.finish()
68 except:
69 threw = True
71 harness.ok(threw, "Should have thrown.")