1 def WebIDLTest(parser
, harness
):
10 results
= parser
.finish()
11 harness
.check(len(results
), 1, "Should have a dictionary")
12 members
= results
[0].members
13 harness
.check(len(members
), 2, "Should have two members")
14 # Note that members are ordered lexicographically, so "bar" comes
17 members
[0].getExtendedAttribute("ChromeOnly"), "First member is not ChromeOnly"
20 not members
[1].getExtendedAttribute("ChromeOnly"), "Second member is ChromeOnly"
23 parser
= parser
.reset()
32 [Constant, Cached] readonly attribute Dict dict;
36 results
= parser
.finish()
37 harness
.check(len(results
), 2, "Should have a dictionary and an interface")
39 parser
= parser
.reset()
50 [Constant, Cached] readonly attribute Dict dict;
54 results
= parser
.finish()
55 except Exception as e
:
58 harness
.ok(exception
, "Should have thrown.")
61 "[Cached] and [StoreInSlot] must not be used on an attribute "
62 "whose type contains a [ChromeOnly] dictionary member",
63 "Should have thrown the right exception",
66 parser
= parser
.reset()
71 dictionary ParentDict {
75 dictionary Dict : ParentDict {
80 [Constant, Cached] readonly attribute Dict dict;
84 results
= parser
.finish()
85 except Exception as e
:
88 harness
.ok(exception
, "Should have thrown (2).")
91 "[Cached] and [StoreInSlot] must not be used on an attribute "
92 "whose type contains a [ChromeOnly] dictionary member",
93 "Should have thrown the right exception (2)",
96 parser
= parser
.reset()
101 dictionary GrandParentDict {
102 [ChromeOnly] any baz;
105 dictionary ParentDict : GrandParentDict {
109 dictionary Dict : ParentDict {
114 [Constant, Cached] readonly attribute Dict dict;
118 results
= parser
.finish()
119 except Exception as e
:
122 harness
.ok(exception
, "Should have thrown (3).")
125 "[Cached] and [StoreInSlot] must not be used on an attribute "
126 "whose type contains a [ChromeOnly] dictionary member",
127 "Should have thrown the right exception (3)",