Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / bindings / parser / tests / test_special_method_signature_mismatch.py
blob5dd581985bdea07c11abd1677ebca4f1cd36e5bb
1 import WebIDL
4 def WebIDLTest(parser, harness):
5 threw = False
6 try:
7 parser.parse(
8 """
9 interface SpecialMethodSignatureMismatch1 {
10 getter long long foo(long index);
12 """
15 parser.finish()
16 except WebIDL.WebIDLError:
17 threw = True
19 harness.ok(threw, "Should have thrown.")
21 threw = False
22 try:
23 parser.parse(
24 """
25 interface SpecialMethodSignatureMismatch2 {
26 getter undefined foo(unsigned long index);
28 """
31 parser.finish()
32 except WebIDL.WebIDLError:
33 threw = True
35 harness.ok(threw, "Should have thrown.")
37 threw = False
38 try:
39 parser.parse(
40 """
41 interface SpecialMethodSignatureMismatch3 {
42 getter boolean foo(unsigned long index, boolean extraArg);
44 """
47 parser.finish()
48 except WebIDL.WebIDLError:
49 threw = True
51 harness.ok(threw, "Should have thrown.")
53 threw = False
54 try:
55 parser.parse(
56 """
57 interface SpecialMethodSignatureMismatch4 {
58 getter boolean foo(unsigned long... index);
60 """
63 parser.finish()
64 except WebIDL.WebIDLError:
65 threw = True
67 harness.ok(threw, "Should have thrown.")
69 threw = False
70 try:
71 parser.parse(
72 """
73 interface SpecialMethodSignatureMismatch5 {
74 getter boolean foo(optional unsigned long index);
76 """
79 parser.finish()
80 except WebIDL.WebIDLError:
81 threw = True
83 harness.ok(threw, "Should have thrown.")
85 threw = False
86 try:
87 parser.parse(
88 """
89 interface SpecialMethodSignatureMismatch6 {
90 getter boolean foo();
92 """
95 parser.finish()
96 except WebIDL.WebIDLError:
97 threw = True
99 harness.ok(threw, "Should have thrown.")
101 threw = False
102 try:
103 parser.parse(
105 interface SpecialMethodSignatureMismatch7 {
106 deleter long long foo(long index);
111 parser.finish()
112 except WebIDL.WebIDLError:
113 threw = True
115 harness.ok(threw, "Should have thrown.")
117 threw = False
118 try:
119 parser.parse(
121 interface SpecialMethodSignatureMismatch9 {
122 deleter boolean foo(unsigned long index, boolean extraArg);
127 parser.finish()
128 except WebIDL.WebIDLError:
129 threw = True
131 harness.ok(threw, "Should have thrown.")
133 threw = False
134 try:
135 parser.parse(
137 interface SpecialMethodSignatureMismatch10 {
138 deleter boolean foo(unsigned long... index);
143 parser.finish()
144 except WebIDL.WebIDLError:
145 threw = True
147 harness.ok(threw, "Should have thrown.")
149 threw = False
150 try:
151 parser.parse(
153 interface SpecialMethodSignatureMismatch11 {
154 deleter boolean foo(optional unsigned long index);
159 parser.finish()
160 except WebIDL.WebIDLError:
161 threw = True
163 harness.ok(threw, "Should have thrown.")
165 threw = False
166 try:
167 parser.parse(
169 interface SpecialMethodSignatureMismatch12 {
170 deleter boolean foo();
175 parser.finish()
176 except WebIDL.WebIDLError:
177 threw = True
179 harness.ok(threw, "Should have thrown.")
181 threw = False
182 try:
183 parser.parse(
185 interface SpecialMethodSignatureMismatch13 {
186 setter long long foo(long index, long long value);
191 parser.finish()
192 except WebIDL.WebIDLError:
193 threw = True
195 harness.ok(threw, "Should have thrown.")
197 threw = False
198 try:
199 parser.parse(
201 interface SpecialMethodSignatureMismatch15 {
202 setter boolean foo(unsigned long index, boolean value, long long extraArg);
207 parser.finish()
208 except WebIDL.WebIDLError:
209 threw = True
211 harness.ok(threw, "Should have thrown.")
213 threw = False
214 try:
215 parser.parse(
217 interface SpecialMethodSignatureMismatch16 {
218 setter boolean foo(unsigned long index, boolean... value);
223 parser.finish()
224 except WebIDL.WebIDLError:
225 threw = True
227 harness.ok(threw, "Should have thrown.")
229 threw = False
230 try:
231 parser.parse(
233 interface SpecialMethodSignatureMismatch17 {
234 setter boolean foo(unsigned long index, optional boolean value);
239 parser.finish()
240 except WebIDL.WebIDLError:
241 threw = True
243 harness.ok(threw, "Should have thrown.")
245 threw = False
246 try:
247 parser.parse(
249 interface SpecialMethodSignatureMismatch18 {
250 setter boolean foo();
255 parser.finish()
256 except WebIDL.WebIDLError:
257 threw = True
259 harness.ok(threw, "Should have thrown.")