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 | import WebIDL |
michael@0 | 2 | |
michael@0 | 3 | def WebIDLTest(parser, harness): |
michael@0 | 4 | parser.parse(""" |
michael@0 | 5 | interface SpecialMethods { |
michael@0 | 6 | getter long long (unsigned long index); |
michael@0 | 7 | setter long long (unsigned long index, long long value); |
michael@0 | 8 | creator long long (unsigned long index, long long value); |
michael@0 | 9 | deleter long long (unsigned long index); |
michael@0 | 10 | getter boolean (DOMString name); |
michael@0 | 11 | setter boolean (DOMString name, boolean value); |
michael@0 | 12 | creator boolean (DOMString name, boolean value); |
michael@0 | 13 | deleter boolean (DOMString name); |
michael@0 | 14 | }; |
michael@0 | 15 | |
michael@0 | 16 | interface SpecialMethodsCombination { |
michael@0 | 17 | getter deleter long long (unsigned long index); |
michael@0 | 18 | setter creator long long (unsigned long index, long long value); |
michael@0 | 19 | getter deleter boolean (DOMString name); |
michael@0 | 20 | setter creator boolean (DOMString name, boolean value); |
michael@0 | 21 | }; |
michael@0 | 22 | """) |
michael@0 | 23 | |
michael@0 | 24 | results = parser.finish() |
michael@0 | 25 | |
michael@0 | 26 | def checkMethod(method, QName, name, |
michael@0 | 27 | static=False, getter=False, setter=False, creator=False, |
michael@0 | 28 | deleter=False, legacycaller=False, stringifier=False): |
michael@0 | 29 | harness.ok(isinstance(method, WebIDL.IDLMethod), |
michael@0 | 30 | "Should be an IDLMethod") |
michael@0 | 31 | harness.check(method.identifier.QName(), QName, "Method has the right QName") |
michael@0 | 32 | harness.check(method.identifier.name, name, "Method has the right name") |
michael@0 | 33 | harness.check(method.isStatic(), static, "Method has the correct static value") |
michael@0 | 34 | harness.check(method.isGetter(), getter, "Method has the correct getter value") |
michael@0 | 35 | harness.check(method.isSetter(), setter, "Method has the correct setter value") |
michael@0 | 36 | harness.check(method.isCreator(), creator, "Method has the correct creator value") |
michael@0 | 37 | harness.check(method.isDeleter(), deleter, "Method has the correct deleter value") |
michael@0 | 38 | harness.check(method.isLegacycaller(), legacycaller, "Method has the correct legacycaller value") |
michael@0 | 39 | harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value") |
michael@0 | 40 | |
michael@0 | 41 | harness.check(len(results), 2, "Expect 2 interfaces") |
michael@0 | 42 | |
michael@0 | 43 | iface = results[0] |
michael@0 | 44 | harness.check(len(iface.members), 8, "Expect 8 members") |
michael@0 | 45 | |
michael@0 | 46 | checkMethod(iface.members[0], "::SpecialMethods::__indexedgetter", "__indexedgetter", |
michael@0 | 47 | getter=True) |
michael@0 | 48 | checkMethod(iface.members[1], "::SpecialMethods::__indexedsetter", "__indexedsetter", |
michael@0 | 49 | setter=True) |
michael@0 | 50 | checkMethod(iface.members[2], "::SpecialMethods::__indexedcreator", "__indexedcreator", |
michael@0 | 51 | creator=True) |
michael@0 | 52 | checkMethod(iface.members[3], "::SpecialMethods::__indexeddeleter", "__indexeddeleter", |
michael@0 | 53 | deleter=True) |
michael@0 | 54 | checkMethod(iface.members[4], "::SpecialMethods::__namedgetter", "__namedgetter", |
michael@0 | 55 | getter=True) |
michael@0 | 56 | checkMethod(iface.members[5], "::SpecialMethods::__namedsetter", "__namedsetter", |
michael@0 | 57 | setter=True) |
michael@0 | 58 | checkMethod(iface.members[6], "::SpecialMethods::__namedcreator", "__namedcreator", |
michael@0 | 59 | creator=True) |
michael@0 | 60 | checkMethod(iface.members[7], "::SpecialMethods::__nameddeleter", "__nameddeleter", |
michael@0 | 61 | deleter=True) |
michael@0 | 62 | |
michael@0 | 63 | iface = results[1] |
michael@0 | 64 | harness.check(len(iface.members), 4, "Expect 4 members") |
michael@0 | 65 | |
michael@0 | 66 | checkMethod(iface.members[0], "::SpecialMethodsCombination::__indexedgetterdeleter", |
michael@0 | 67 | "__indexedgetterdeleter", getter=True, deleter=True) |
michael@0 | 68 | checkMethod(iface.members[1], "::SpecialMethodsCombination::__indexedsettercreator", |
michael@0 | 69 | "__indexedsettercreator", setter=True, creator=True) |
michael@0 | 70 | checkMethod(iface.members[2], "::SpecialMethodsCombination::__namedgetterdeleter", |
michael@0 | 71 | "__namedgetterdeleter", getter=True, deleter=True) |
michael@0 | 72 | checkMethod(iface.members[3], "::SpecialMethodsCombination::__namedsettercreator", |
michael@0 | 73 | "__namedsettercreator", setter=True, creator=True) |