4 # Import the WebIDL module, so we can do isinstance checks and whatnot
5 def WebIDLTest(parser
, harness
):
10 [NewObject] readonly attribute Iface attr;
11 [NewObject] Iface method();
15 results
= parser
.finish()
16 harness
.ok(results
, "Should not have thrown on basic [NewObject] usage")
18 parser
= parser
.reset()
24 [Pure, NewObject] readonly attribute Iface attr;
29 except WebIDL
.WebIDLError
:
31 harness
.ok(threw
, "[NewObject] attributes must depend on something")
33 parser
= parser
.reset()
39 [Pure, NewObject] Iface method();
44 except WebIDL
.WebIDLError
:
46 harness
.ok(threw
, "[NewObject] methods must depend on something")
48 parser
= parser
.reset()
54 [Cached, NewObject, Affects=Nothing] readonly attribute Iface attr;
59 except WebIDL
.WebIDLError
:
61 harness
.ok(threw
, "[NewObject] attributes must not be [Cached]")
63 parser
= parser
.reset()
69 [StoreInSlot, NewObject, Affects=Nothing] readonly attribute Iface attr;
74 except WebIDL
.WebIDLError
:
76 harness
.ok(threw
, "[NewObject] attributes must not be [StoreInSlot]")