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 | parser.parse(""" |
michael@0 | 3 | interface Child : Parent { |
michael@0 | 4 | }; |
michael@0 | 5 | interface Parent { |
michael@0 | 6 | [Unforgeable] readonly attribute long foo; |
michael@0 | 7 | }; |
michael@0 | 8 | """) |
michael@0 | 9 | |
michael@0 | 10 | results = parser.finish() |
michael@0 | 11 | harness.check(len(results), 2, |
michael@0 | 12 | "Should be able to inherit from an interface with " |
michael@0 | 13 | "[Unforgeable] properties.") |
michael@0 | 14 | |
michael@0 | 15 | parser = parser.reset(); |
michael@0 | 16 | parser.parse(""" |
michael@0 | 17 | interface Child : Parent { |
michael@0 | 18 | const short foo = 10; |
michael@0 | 19 | }; |
michael@0 | 20 | interface Parent { |
michael@0 | 21 | [Unforgeable] readonly attribute long foo; |
michael@0 | 22 | }; |
michael@0 | 23 | """) |
michael@0 | 24 | |
michael@0 | 25 | results = parser.finish() |
michael@0 | 26 | harness.check(len(results), 2, |
michael@0 | 27 | "Should be able to inherit from an interface with " |
michael@0 | 28 | "[Unforgeable] properties even if we have a constant with " |
michael@0 | 29 | "the same name.") |
michael@0 | 30 | |
michael@0 | 31 | parser = parser.reset(); |
michael@0 | 32 | parser.parse(""" |
michael@0 | 33 | interface Child : Parent { |
michael@0 | 34 | static attribute short foo; |
michael@0 | 35 | }; |
michael@0 | 36 | interface Parent { |
michael@0 | 37 | [Unforgeable] readonly attribute long foo; |
michael@0 | 38 | }; |
michael@0 | 39 | """) |
michael@0 | 40 | |
michael@0 | 41 | results = parser.finish() |
michael@0 | 42 | harness.check(len(results), 2, |
michael@0 | 43 | "Should be able to inherit from an interface with " |
michael@0 | 44 | "[Unforgeable] properties even if we have a static attribute " |
michael@0 | 45 | "with the same name.") |
michael@0 | 46 | |
michael@0 | 47 | parser = parser.reset(); |
michael@0 | 48 | parser.parse(""" |
michael@0 | 49 | interface Child : Parent { |
michael@0 | 50 | static void foo(); |
michael@0 | 51 | }; |
michael@0 | 52 | interface Parent { |
michael@0 | 53 | [Unforgeable] readonly attribute long foo; |
michael@0 | 54 | }; |
michael@0 | 55 | """) |
michael@0 | 56 | |
michael@0 | 57 | results = parser.finish() |
michael@0 | 58 | harness.check(len(results), 2, |
michael@0 | 59 | "Should be able to inherit from an interface with " |
michael@0 | 60 | "[Unforgeable] properties even if we have a static operation " |
michael@0 | 61 | "with the same name.") |
michael@0 | 62 | |
michael@0 | 63 | parser = parser.reset(); |
michael@0 | 64 | threw = False |
michael@0 | 65 | try: |
michael@0 | 66 | parser.parse(""" |
michael@0 | 67 | interface Child : Parent { |
michael@0 | 68 | void foo(); |
michael@0 | 69 | }; |
michael@0 | 70 | interface Parent { |
michael@0 | 71 | [Unforgeable] readonly attribute long foo; |
michael@0 | 72 | }; |
michael@0 | 73 | """) |
michael@0 | 74 | |
michael@0 | 75 | results = parser.finish() |
michael@0 | 76 | except: |
michael@0 | 77 | threw = True |
michael@0 | 78 | harness.ok(threw, |
michael@0 | 79 | "Should have thrown when shadowing unforgeable attribute on " |
michael@0 | 80 | "parent with operation.") |
michael@0 | 81 | |
michael@0 | 82 | parser = parser.reset(); |
michael@0 | 83 | threw = False |
michael@0 | 84 | try: |
michael@0 | 85 | parser.parse(""" |
michael@0 | 86 | interface Child : Parent { |
michael@0 | 87 | attribute short foo; |
michael@0 | 88 | }; |
michael@0 | 89 | interface Parent { |
michael@0 | 90 | [Unforgeable] readonly attribute long foo; |
michael@0 | 91 | }; |
michael@0 | 92 | """) |
michael@0 | 93 | |
michael@0 | 94 | results = parser.finish() |
michael@0 | 95 | except Exception,x: |
michael@0 | 96 | threw = True |
michael@0 | 97 | harness.ok(threw, |
michael@0 | 98 | "Should have thrown when shadowing unforgeable attribute on " |
michael@0 | 99 | "parent with attribute.") |
michael@0 | 100 | |
michael@0 | 101 | parser = parser.reset(); |
michael@0 | 102 | parser.parse(""" |
michael@0 | 103 | interface Child : Parent { |
michael@0 | 104 | }; |
michael@0 | 105 | interface Parent {}; |
michael@0 | 106 | interface Consequential { |
michael@0 | 107 | [Unforgeable] readonly attribute long foo; |
michael@0 | 108 | }; |
michael@0 | 109 | Parent implements Consequential; |
michael@0 | 110 | """) |
michael@0 | 111 | |
michael@0 | 112 | results = parser.finish() |
michael@0 | 113 | harness.check(len(results), 4, |
michael@0 | 114 | "Should be able to inherit from an interface with a " |
michael@0 | 115 | "consequential interface with [Unforgeable] properties.") |
michael@0 | 116 | |
michael@0 | 117 | parser = parser.reset(); |
michael@0 | 118 | threw = False |
michael@0 | 119 | try: |
michael@0 | 120 | parser.parse(""" |
michael@0 | 121 | interface Child : Parent { |
michael@0 | 122 | void foo(); |
michael@0 | 123 | }; |
michael@0 | 124 | interface Parent {}; |
michael@0 | 125 | interface Consequential { |
michael@0 | 126 | [Unforgeable] readonly attribute long foo; |
michael@0 | 127 | }; |
michael@0 | 128 | Parent implements Consequential; |
michael@0 | 129 | """) |
michael@0 | 130 | |
michael@0 | 131 | results = parser.finish() |
michael@0 | 132 | except: |
michael@0 | 133 | threw = True |
michael@0 | 134 | |
michael@0 | 135 | harness.ok(threw, |
michael@0 | 136 | "Should have thrown when shadowing unforgeable attribute " |
michael@0 | 137 | "of parent's consequential interface.") |
michael@0 | 138 | |
michael@0 | 139 | parser = parser.reset(); |
michael@0 | 140 | threw = False |
michael@0 | 141 | try: |
michael@0 | 142 | parser.parse(""" |
michael@0 | 143 | interface Child : Parent { |
michael@0 | 144 | }; |
michael@0 | 145 | interface Parent : GrandParent {}; |
michael@0 | 146 | interface GrandParent {}; |
michael@0 | 147 | interface Consequential { |
michael@0 | 148 | [Unforgeable] readonly attribute long foo; |
michael@0 | 149 | }; |
michael@0 | 150 | GrandParent implements Consequential; |
michael@0 | 151 | interface ChildConsequential { |
michael@0 | 152 | void foo(); |
michael@0 | 153 | }; |
michael@0 | 154 | Child implements ChildConsequential; |
michael@0 | 155 | """) |
michael@0 | 156 | |
michael@0 | 157 | results = parser.finish() |
michael@0 | 158 | except: |
michael@0 | 159 | threw = True |
michael@0 | 160 | |
michael@0 | 161 | harness.ok(threw, |
michael@0 | 162 | "Should have thrown when our consequential interface shadows unforgeable attribute " |
michael@0 | 163 | "of ancestor's consequential interface.") |
michael@0 | 164 | |
michael@0 | 165 | parser = parser.reset(); |
michael@0 | 166 | threw = False |
michael@0 | 167 | try: |
michael@0 | 168 | parser.parse(""" |
michael@0 | 169 | interface iface { |
michael@0 | 170 | [Unforgeable] attribute long foo; |
michael@0 | 171 | }; |
michael@0 | 172 | """) |
michael@0 | 173 | |
michael@0 | 174 | results = parser.finish() |
michael@0 | 175 | except: |
michael@0 | 176 | threw = True |
michael@0 | 177 | |
michael@0 | 178 | harness.ok(threw, "Should have thrown for writable [Unforgeable] attribute.") |
michael@0 | 179 | |
michael@0 | 180 | parser = parser.reset(); |
michael@0 | 181 | threw = False |
michael@0 | 182 | try: |
michael@0 | 183 | parser.parse(""" |
michael@0 | 184 | interface iface { |
michael@0 | 185 | [Unforgeable] static readonly attribute long foo; |
michael@0 | 186 | }; |
michael@0 | 187 | """) |
michael@0 | 188 | |
michael@0 | 189 | results = parser.finish() |
michael@0 | 190 | except: |
michael@0 | 191 | threw = True |
michael@0 | 192 | |
michael@0 | 193 | harness.ok(threw, "Should have thrown for static [Unforgeable] attribute.") |