Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / bindings / parser / tests / test_union_nullable.py
blobd5ae2e1e74cb74eb077e9889ac8e21df91164d6f
1 import WebIDL
4 def WebIDLTest(parser, harness):
5 threw = False
6 try:
7 parser.parse(
8 """
9 interface OneNullableInUnion {
10 undefined foo((object? or DOMString?) arg);
12 """
15 parser.finish()
16 except WebIDL.WebIDLError:
17 threw = True
19 harness.ok(threw, "Two nullable member types of a union should have thrown.")
21 parser.reset()
22 threw = False
24 try:
25 parser.parse(
26 """
27 interface NullableInNullableUnion {
28 undefined foo((object? or DOMString)? arg);
30 """
33 parser.finish()
34 except WebIDL.WebIDLError:
35 threw = True
37 harness.ok(
38 threw,
39 "A nullable union type with a nullable member type should have " "thrown.",
42 parser.reset()
43 threw = False
45 try:
46 parser.parse(
47 """
48 interface NullableInUnionNullableUnionHelper {
50 interface NullableInUnionNullableUnion {
51 undefined foo(((object? or DOMString) or NullableInUnionNullableUnionHelper)? arg);
53 """
56 parser.finish()
57 except WebIDL.WebIDLError:
58 threw = True
60 harness.ok(
61 threw,
62 "A nullable union type with a nullable member type should have " "thrown.",