4 def WebIDLTest(parser
, harness
):
7 interface Child : Parent {
10 [LegacyUnforgeable] readonly attribute long foo;
15 results
= parser
.finish()
19 "Should be able to inherit from an interface with "
20 "[LegacyUnforgeable] properties.",
23 parser
= parser
.reset()
26 interface Child : Parent {
30 [LegacyUnforgeable] readonly attribute long foo;
35 results
= parser
.finish()
39 "Should be able to inherit from an interface with "
40 "[LegacyUnforgeable] properties even if we have a constant with "
44 parser
= parser
.reset()
47 interface Child : Parent {
48 static attribute short foo;
51 [LegacyUnforgeable] readonly attribute long foo;
56 results
= parser
.finish()
60 "Should be able to inherit from an interface with "
61 "[LegacyUnforgeable] properties even if we have a static attribute "
62 "with the same name.",
65 parser
= parser
.reset()
68 interface Child : Parent {
69 static undefined foo();
72 [LegacyUnforgeable] readonly attribute long foo;
77 results
= parser
.finish()
81 "Should be able to inherit from an interface with "
82 "[LegacyUnforgeable] properties even if we have a static operation "
83 "with the same name.",
86 parser
= parser
.reset()
91 interface Child : Parent {
95 [LegacyUnforgeable] readonly attribute long foo;
100 results
= parser
.finish()
101 except WebIDL
.WebIDLError
:
105 "Should have thrown when shadowing unforgeable attribute on "
106 "parent with operation.",
109 parser
= parser
.reset()
114 interface Child : Parent {
118 [LegacyUnforgeable] undefined foo();
123 results
= parser
.finish()
124 except WebIDL
.WebIDLError
:
128 "Should have thrown when shadowing unforgeable operation on "
129 "parent with operation.",
132 parser
= parser
.reset()
137 interface Child : Parent {
141 [LegacyUnforgeable] readonly attribute long foo;
146 results
= parser
.finish()
147 except WebIDL
.WebIDLError
:
151 "Should have thrown when shadowing unforgeable attribute on "
152 "parent with attribute.",
155 parser
= parser
.reset()
160 interface Child : Parent {
164 [LegacyUnforgeable] undefined foo();
169 results
= parser
.finish()
170 except WebIDL
.WebIDLError
:
174 "Should have thrown when shadowing unforgeable operation on "
175 "parent with attribute.",
178 parser
= parser
.reset()
181 interface Child : Parent {
184 interface mixin Mixin {
185 [LegacyUnforgeable] readonly attribute long foo;
187 Parent includes Mixin;
191 results
= parser
.finish()
195 "Should be able to inherit from an interface with a "
196 "mixin with [LegacyUnforgeable] properties.",
199 parser
= parser
.reset()
204 interface Child : Parent {
208 interface mixin Mixin {
209 [LegacyUnforgeable] readonly attribute long foo;
211 Parent includes Mixin;
215 results
= parser
.finish()
216 except WebIDL
.WebIDLError
:
221 "Should have thrown when shadowing unforgeable attribute "
222 "of parent's consequential interface.",
225 parser
= parser
.reset()
230 interface Child : Parent {
232 interface Parent : GrandParent {};
233 interface GrandParent {};
234 interface mixin Mixin {
235 [LegacyUnforgeable] readonly attribute long foo;
237 GrandParent includes Mixin;
238 interface mixin ChildMixin {
241 Child includes ChildMixin;
245 results
= parser
.finish()
246 except WebIDL
.WebIDLError
:
251 "Should have thrown when our consequential interface shadows unforgeable attribute "
252 "of ancestor's consequential interface.",
255 parser
= parser
.reset()
260 interface Child : Parent {
262 interface Parent : GrandParent {};
263 interface GrandParent {};
264 interface mixin Mixin {
265 [LegacyUnforgeable] undefined foo();
267 GrandParent includes Mixin;
268 interface mixin ChildMixin {
271 Child includes ChildMixin;
275 results
= parser
.finish()
276 except WebIDL
.WebIDLError
:
281 "Should have thrown when our consequential interface shadows unforgeable operation "
282 "of ancestor's consequential interface.",
285 parser
= parser
.reset()
289 [LegacyUnforgeable] attribute long foo;
294 results
= parser
.finish()
296 len(results
), 1, "Should allow writable [LegacyUnforgeable] attribute."
299 parser
= parser
.reset()
305 [LegacyUnforgeable] static readonly attribute long foo;
310 results
= parser
.finish()
311 except WebIDL
.WebIDLError
:
314 harness
.ok(threw
, "Should have thrown for static [LegacyUnforgeable] attribute.")