Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / bindings / parser / tests / test_interface_identifier_conflicts_across_members.py
blob32c0b24704f02e1aae8f1d764fec20a9af7cb05c
1 import WebIDL
4 def WebIDLTest(parser, harness):
5 threw = False
6 try:
7 parser.parse(
8 """
9 interface IdentifierConflictAcrossMembers1 {
10 const byte thing1 = 1;
11 readonly attribute long thing1;
13 """
16 parser.finish()
17 except WebIDL.WebIDLError:
18 threw = True
20 harness.ok(threw, "Should have thrown for IdentifierConflictAcrossMembers1.")
22 parser = parser.reset()
23 threw = False
24 try:
25 parser.parse(
26 """
27 interface IdentifierConflictAcrossMembers2 {
28 readonly attribute long thing1;
29 const byte thing1 = 1;
31 """
34 parser.finish()
35 except WebIDL.WebIDLError:
36 threw = True
38 harness.ok(threw, "Should have thrown for IdentifierConflictAcrossMembers2.")
40 parser = parser.reset()
41 threw = False
42 try:
43 parser.parse(
44 """
45 interface IdentifierConflictAcrossMembers3 {
46 getter boolean thing1(DOMString name);
47 readonly attribute long thing1;
49 """
52 parser.finish()
53 except WebIDL.WebIDLError:
54 threw = True
56 harness.ok(threw, "Should have thrown for IdentifierConflictAcrossMembers3.")
58 parser = parser.reset()
59 threw = False
60 try:
61 parser.parse(
62 """
63 interface IdentifierConflictAcrossMembers4 {
64 const byte thing1 = 1;
65 long thing1();
67 """
70 parser.finish()
71 except WebIDL.WebIDLError:
72 threw = True
74 harness.ok(threw, "Should have thrown for IdentifierConflictAcrossMembers4.")
76 parser = parser.reset()
77 threw = False
78 try:
79 parser.parse(
80 """
81 interface IdentifierConflictAcrossMembers5 {
82 static long thing1();
83 undefined thing1();
85 """
88 parser.finish()
89 except WebIDL.WebIDLError:
90 threw = True
92 harness.ok(
93 not threw, "Should not have thrown for IdentifierConflictAcrossMembers5."
96 parser = parser.reset()
97 threw = False
98 try:
99 parser.parse(
101 interface mixin IdentifierConflictAcrossMembers6Mixin {
102 undefined thing1();
104 interface IdentifierConflictAcrossMembers6 {
105 static long thing1();
107 IdentifierConflictAcrossMembers6 includes IdentifierConflictAcrossMembers6Mixin;
111 parser.finish()
112 except WebIDL.WebIDLError:
113 threw = True
115 harness.ok(
116 not threw, "Should not have thrown for IdentifierConflictAcrossMembers6."
119 parser = parser.reset()
120 threw = False
121 try:
122 parser.parse(
124 interface IdentifierConflictAcrossMembers7 {
125 const byte thing1 = 1;
126 static readonly attribute long thing1;
131 parser.finish()
132 except WebIDL.WebIDLError:
133 threw = True
135 harness.ok(threw, "Should have thrown for IdentifierConflictAcrossMembers7.")
137 parser = parser.reset()
138 threw = False
139 try:
140 parser.parse(
142 interface IdentifierConflictAcrossMembers8 {
143 readonly attribute long thing1 = 1;
144 static readonly attribute long thing1;
149 parser.finish()
150 except WebIDL.WebIDLError:
151 threw = True
153 harness.ok(threw, "Should have thrown for IdentifierConflictAcrossMembers8.")
155 parser = parser.reset()
156 threw = False
157 try:
158 parser.parse(
160 interface IdentifierConflictAcrossMembers9 {
161 void thing1();
162 static readonly attribute long thing1;
167 parser.finish()
168 except WebIDL.WebIDLError:
169 threw = True
171 harness.ok(threw, "Should have thrown for IdentifierConflictAcrossMembers9.")