4 def WebIDLTest(parser
, harness
):
7 [LegacyNoInterfaceObject]
8 interface TestExtendedAttr {
9 [LegacyUnforgeable] readonly attribute byte b;
16 parser
= parser
.reset()
19 [Pref="foo.bar",Pref=flop]
20 interface TestExtendedAttr {
21 [Pref="foo.bar"] attribute byte b;
28 parser
= parser
.reset()
31 interface TestLegacyLenientThis {
32 [LegacyLenientThis] attribute byte b;
37 results
= parser
.finish()
39 results
[0].members
[0].hasLegacyLenientThis(), "Should have a lenient this"
42 parser
= parser
.reset()
47 interface TestLegacyLenientThis2 {
48 [LegacyLenientThis=something] attribute byte b;
53 except WebIDL
.WebIDLError
:
56 harness
.ok(threw
, "[LegacyLenientThis] must take no arguments")
58 parser
= parser
.reset()
62 undefined testClamp([Clamp] long foo);
63 undefined testNotClamp(long foo);
68 results
= parser
.finish()
69 # Pull out the first argument out of the arglist of the first (and
72 results
[0].members
[0].signatures()[0][1][0].type.hasClamp(), "Should be clamped"
75 not results
[0].members
[1].signatures()[0][1][0].type.hasClamp(),
76 "Should not be clamped",
79 parser
= parser
.reset()
84 interface TestClamp2 {
85 undefined testClamp([Clamp=something] long foo);
90 except WebIDL
.WebIDLError
:
93 harness
.ok(threw
, "[Clamp] must take no arguments")
95 parser
= parser
.reset()
98 interface TestEnforceRange {
99 undefined testEnforceRange([EnforceRange] long foo);
100 undefined testNotEnforceRange(long foo);
105 results
= parser
.finish()
106 # Pull out the first argument out of the arglist of the first (and
109 results
[0].members
[0].signatures()[0][1][0].type.hasEnforceRange(),
110 "Should be enforceRange",
113 not results
[0].members
[1].signatures()[0][1][0].type.hasEnforceRange(),
114 "Should not be enforceRange",
117 parser
= parser
.reset()
122 interface TestEnforceRange2 {
123 undefined testEnforceRange([EnforceRange=something] long foo);
128 except WebIDL
.WebIDLError
:
131 harness
.ok(threw
, "[EnforceRange] must take no arguments")