4 def WebIDLTest(parser
, harness
):
7 interface SpecialMethods {
8 getter long long (unsigned long index);
9 setter long long (unsigned long index, long long value);
10 getter boolean (DOMString name);
11 setter boolean (DOMString name, boolean value);
12 deleter boolean (DOMString name);
13 readonly attribute unsigned long length;
16 interface SpecialMethodsCombination {
17 getter deleter boolean (DOMString name);
22 results
= parser
.finish()
35 harness
.ok(isinstance(method
, WebIDL
.IDLMethod
), "Should be an IDLMethod")
36 harness
.check(method
.identifier
.QName(), QName
, "Method has the right QName")
37 harness
.check(method
.identifier
.name
, name
, "Method has the right name")
38 harness
.check(method
.isStatic(), static
, "Method has the correct static value")
39 harness
.check(method
.isGetter(), getter
, "Method has the correct getter value")
40 harness
.check(method
.isSetter(), setter
, "Method has the correct setter value")
42 method
.isDeleter(), deleter
, "Method has the correct deleter value"
45 method
.isLegacycaller(),
47 "Method has the correct legacycaller value",
50 method
.isStringifier(),
52 "Method has the correct stringifier value",
55 harness
.check(len(results
), 2, "Expect 2 interfaces")
58 harness
.check(len(iface
.members
), 6, "Expect 6 members")
62 "::SpecialMethods::__indexedgetter",
68 "::SpecialMethods::__indexedsetter",
74 "::SpecialMethods::__namedgetter",
80 "::SpecialMethods::__namedsetter",
86 "::SpecialMethods::__nameddeleter",
92 harness
.check(len(iface
.members
), 1, "Expect 1 member")
96 "::SpecialMethodsCombination::__namedgetterdeleter",
97 "__namedgetterdeleter",
102 parser
= parser
.reset()
108 interface IndexedDeleter {
109 deleter undefined(unsigned long index);
114 except WebIDL
.WebIDLError
:
117 harness
.ok(threw
, "There are no indexed deleters")