4 def WebIDLTest(parser
, harness
):
7 [TreatNonCallableAsNull] callback Function = any(any... arguments);
9 interface TestTreatNonCallableAsNull1 {
10 attribute Function? onfoo;
11 attribute Function onbar;
16 results
= parser
.finish()
19 attr
= iface
.members
[0]
20 harness
.check(attr
.type.treatNonCallableAsNull(), True, "Got the expected value")
21 attr
= iface
.members
[1]
22 harness
.check(attr
.type.treatNonCallableAsNull(), False, "Got the expected value")
24 parser
= parser
.reset()
30 callback Function = any(any... arguments);
32 interface TestTreatNonCallableAsNull2 {
33 [TreatNonCallableAsNull] attribute Function onfoo;
38 results
= parser
.finish()
39 except WebIDL
.WebIDLError
:
42 harness
.ok(threw
, "Should have thrown.")
44 parser
= parser
.reset()
50 callback Function = any(any... arguments);
52 [TreatNonCallableAsNull]
53 interface TestTreatNonCallableAsNull3 {
54 attribute Function onfoo;
59 results
= parser
.finish()
60 except WebIDL
.WebIDLError
:
63 harness
.ok(threw
, "Should have thrown.")
65 parser
= parser
.reset()
71 [TreatNonCallableAsNull, LegacyTreatNonObjectAsNull]
72 callback Function = any(any... arguments);
76 results
= parser
.finish()
77 except WebIDL
.WebIDLError
:
80 harness
.ok(threw
, "Should have thrown.")