|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
4 * You can obtain one at http://mozilla.org/MPL/2.0/. |
|
5 */ |
|
6 |
|
7 typedef TestJSImplInterface AnotherNameForTestJSImplInterface; |
|
8 typedef TestJSImplInterface YetAnotherNameForTestJSImplInterface; |
|
9 typedef TestJSImplInterface? NullableTestJSImplInterface; |
|
10 |
|
11 callback MyTestCallback = void(); |
|
12 |
|
13 TestInterface implements ImplementedInterface; |
|
14 |
|
15 enum MyTestEnum { |
|
16 "a", |
|
17 "b" |
|
18 }; |
|
19 |
|
20 // We don't support multiple constructors (bug 869268) or named constructors |
|
21 // for JS-implemented WebIDL. |
|
22 [Constructor(DOMString str, unsigned long num, boolean? boolArg, |
|
23 TestInterface? iface, long arg1, |
|
24 DictForConstructor dict, any any1, |
|
25 object obj1, |
|
26 object? obj2, sequence<Dict> seq, optional any any2, |
|
27 optional object obj3, |
|
28 optional object? obj4), |
|
29 JSImplementation="@mozilla.org/test-js-impl-interface;1"] |
|
30 interface TestJSImplInterface { |
|
31 // Integer types |
|
32 // XXXbz add tests for throwing versions of all the integer stuff |
|
33 readonly attribute byte readonlyByte; |
|
34 attribute byte writableByte; |
|
35 void passByte(byte arg); |
|
36 byte receiveByte(); |
|
37 void passOptionalByte(optional byte arg); |
|
38 void passOptionalByteBeforeRequired(optional byte arg1, byte arg2); |
|
39 void passOptionalByteWithDefault(optional byte arg = 0); |
|
40 void passOptionalByteWithDefaultBeforeRequired(optional byte arg1 = 0, byte arg2); |
|
41 void passNullableByte(byte? arg); |
|
42 void passOptionalNullableByte(optional byte? arg); |
|
43 void passVariadicByte(byte... arg); |
|
44 [Cached, Pure] |
|
45 readonly attribute byte cachedByte; |
|
46 [Cached, Constant] |
|
47 readonly attribute byte cachedConstantByte; |
|
48 [Cached, Pure] |
|
49 attribute byte cachedWritableByte; |
|
50 |
|
51 readonly attribute short readonlyShort; |
|
52 attribute short writableShort; |
|
53 void passShort(short arg); |
|
54 short receiveShort(); |
|
55 void passOptionalShort(optional short arg); |
|
56 void passOptionalShortWithDefault(optional short arg = 5); |
|
57 |
|
58 readonly attribute long readonlyLong; |
|
59 attribute long writableLong; |
|
60 void passLong(long arg); |
|
61 long receiveLong(); |
|
62 void passOptionalLong(optional long arg); |
|
63 void passOptionalLongWithDefault(optional long arg = 7); |
|
64 |
|
65 readonly attribute long long readonlyLongLong; |
|
66 attribute long long writableLongLong; |
|
67 void passLongLong(long long arg); |
|
68 long long receiveLongLong(); |
|
69 void passOptionalLongLong(optional long long arg); |
|
70 void passOptionalLongLongWithDefault(optional long long arg = -12); |
|
71 |
|
72 readonly attribute octet readonlyOctet; |
|
73 attribute octet writableOctet; |
|
74 void passOctet(octet arg); |
|
75 octet receiveOctet(); |
|
76 void passOptionalOctet(optional octet arg); |
|
77 void passOptionalOctetWithDefault(optional octet arg = 19); |
|
78 |
|
79 readonly attribute unsigned short readonlyUnsignedShort; |
|
80 attribute unsigned short writableUnsignedShort; |
|
81 void passUnsignedShort(unsigned short arg); |
|
82 unsigned short receiveUnsignedShort(); |
|
83 void passOptionalUnsignedShort(optional unsigned short arg); |
|
84 void passOptionalUnsignedShortWithDefault(optional unsigned short arg = 2); |
|
85 |
|
86 readonly attribute unsigned long readonlyUnsignedLong; |
|
87 attribute unsigned long writableUnsignedLong; |
|
88 void passUnsignedLong(unsigned long arg); |
|
89 unsigned long receiveUnsignedLong(); |
|
90 void passOptionalUnsignedLong(optional unsigned long arg); |
|
91 void passOptionalUnsignedLongWithDefault(optional unsigned long arg = 6); |
|
92 |
|
93 readonly attribute unsigned long long readonlyUnsignedLongLong; |
|
94 attribute unsigned long long writableUnsignedLongLong; |
|
95 void passUnsignedLongLong(unsigned long long arg); |
|
96 unsigned long long receiveUnsignedLongLong(); |
|
97 void passOptionalUnsignedLongLong(optional unsigned long long arg); |
|
98 void passOptionalUnsignedLongLongWithDefault(optional unsigned long long arg = 17); |
|
99 |
|
100 attribute float writableFloat; |
|
101 attribute unrestricted float writableUnrestrictedFloat; |
|
102 attribute float? writableNullableFloat; |
|
103 attribute unrestricted float? writableNullableUnrestrictedFloat; |
|
104 attribute double writableDouble; |
|
105 attribute unrestricted double writableUnrestrictedDouble; |
|
106 attribute double? writableNullableDouble; |
|
107 attribute unrestricted double? writableNullableUnrestrictedDouble; |
|
108 void passFloat(float arg1, unrestricted float arg2, |
|
109 float? arg3, unrestricted float? arg4, |
|
110 double arg5, unrestricted double arg6, |
|
111 double? arg7, unrestricted double? arg8, |
|
112 sequence<float> arg9, sequence<unrestricted float> arg10, |
|
113 sequence<float?> arg11, sequence<unrestricted float?> arg12, |
|
114 sequence<double> arg13, sequence<unrestricted double> arg14, |
|
115 sequence<double?> arg15, sequence<unrestricted double?> arg16); |
|
116 [LenientFloat] |
|
117 void passLenientFloat(float arg1, unrestricted float arg2, |
|
118 float? arg3, unrestricted float? arg4, |
|
119 double arg5, unrestricted double arg6, |
|
120 double? arg7, unrestricted double? arg8, |
|
121 sequence<float> arg9, |
|
122 sequence<unrestricted float> arg10, |
|
123 sequence<float?> arg11, |
|
124 sequence<unrestricted float?> arg12, |
|
125 sequence<double> arg13, |
|
126 sequence<unrestricted double> arg14, |
|
127 sequence<double?> arg15, |
|
128 sequence<unrestricted double?> arg16); |
|
129 [LenientFloat] |
|
130 attribute float lenientFloatAttr; |
|
131 [LenientFloat] |
|
132 attribute double lenientDoubleAttr; |
|
133 |
|
134 // Castable interface types |
|
135 // XXXbz add tests for throwing versions of all the castable interface stuff |
|
136 TestJSImplInterface receiveSelf(); |
|
137 TestJSImplInterface? receiveNullableSelf(); |
|
138 |
|
139 // Callback interface ignores 'resultNotAddRefed'. See bug 843272. |
|
140 //TestJSImplInterface receiveWeakSelf(); |
|
141 //TestJSImplInterface? receiveWeakNullableSelf(); |
|
142 |
|
143 // A version to test for casting to TestJSImplInterface& |
|
144 void passSelf(TestJSImplInterface arg); |
|
145 void passNullableSelf(TestJSImplInterface? arg); |
|
146 attribute TestJSImplInterface nonNullSelf; |
|
147 attribute TestJSImplInterface? nullableSelf; |
|
148 [Cached, Pure] |
|
149 readonly attribute TestJSImplInterface cachedSelf; |
|
150 // Optional arguments |
|
151 void passOptionalSelf(optional TestJSImplInterface? arg); |
|
152 void passOptionalNonNullSelf(optional TestJSImplInterface arg); |
|
153 void passOptionalSelfWithDefault(optional TestJSImplInterface? arg = null); |
|
154 |
|
155 // Non-wrapper-cache interface types |
|
156 [NewObject] |
|
157 TestNonWrapperCacheInterface receiveNonWrapperCacheInterface(); |
|
158 [NewObject] |
|
159 TestNonWrapperCacheInterface? receiveNullableNonWrapperCacheInterface(); |
|
160 |
|
161 [NewObject] |
|
162 sequence<TestNonWrapperCacheInterface> receiveNonWrapperCacheInterfaceSequence(); |
|
163 [NewObject] |
|
164 sequence<TestNonWrapperCacheInterface?> receiveNullableNonWrapperCacheInterfaceSequence(); |
|
165 [NewObject] |
|
166 sequence<TestNonWrapperCacheInterface>? receiveNonWrapperCacheInterfaceNullableSequence(); |
|
167 [NewObject] |
|
168 sequence<TestNonWrapperCacheInterface?>? receiveNullableNonWrapperCacheInterfaceNullableSequence(); |
|
169 |
|
170 // Non-castable interface types |
|
171 IndirectlyImplementedInterface receiveOther(); |
|
172 IndirectlyImplementedInterface? receiveNullableOther(); |
|
173 // Callback interface ignores 'resultNotAddRefed'. See bug 843272. |
|
174 //IndirectlyImplementedInterface receiveWeakOther(); |
|
175 //IndirectlyImplementedInterface? receiveWeakNullableOther(); |
|
176 |
|
177 void passOther(IndirectlyImplementedInterface arg); |
|
178 void passNullableOther(IndirectlyImplementedInterface? arg); |
|
179 attribute IndirectlyImplementedInterface nonNullOther; |
|
180 attribute IndirectlyImplementedInterface? nullableOther; |
|
181 // Optional arguments |
|
182 void passOptionalOther(optional IndirectlyImplementedInterface? arg); |
|
183 void passOptionalNonNullOther(optional IndirectlyImplementedInterface arg); |
|
184 void passOptionalOtherWithDefault(optional IndirectlyImplementedInterface? arg = null); |
|
185 |
|
186 // External interface types |
|
187 TestExternalInterface receiveExternal(); |
|
188 TestExternalInterface? receiveNullableExternal(); |
|
189 // Callback interface ignores 'resultNotAddRefed'. See bug 843272. |
|
190 //TestExternalInterface receiveWeakExternal(); |
|
191 //TestExternalInterface? receiveWeakNullableExternal(); |
|
192 void passExternal(TestExternalInterface arg); |
|
193 void passNullableExternal(TestExternalInterface? arg); |
|
194 attribute TestExternalInterface nonNullExternal; |
|
195 attribute TestExternalInterface? nullableExternal; |
|
196 // Optional arguments |
|
197 void passOptionalExternal(optional TestExternalInterface? arg); |
|
198 void passOptionalNonNullExternal(optional TestExternalInterface arg); |
|
199 void passOptionalExternalWithDefault(optional TestExternalInterface? arg = null); |
|
200 |
|
201 // Callback interface types |
|
202 TestCallbackInterface receiveCallbackInterface(); |
|
203 TestCallbackInterface? receiveNullableCallbackInterface(); |
|
204 // Callback interface ignores 'resultNotAddRefed'. See bug 843272. |
|
205 //TestCallbackInterface receiveWeakCallbackInterface(); |
|
206 //TestCallbackInterface? receiveWeakNullableCallbackInterface(); |
|
207 void passCallbackInterface(TestCallbackInterface arg); |
|
208 void passNullableCallbackInterface(TestCallbackInterface? arg); |
|
209 attribute TestCallbackInterface nonNullCallbackInterface; |
|
210 attribute TestCallbackInterface? nullableCallbackInterface; |
|
211 // Optional arguments |
|
212 void passOptionalCallbackInterface(optional TestCallbackInterface? arg); |
|
213 void passOptionalNonNullCallbackInterface(optional TestCallbackInterface arg); |
|
214 void passOptionalCallbackInterfaceWithDefault(optional TestCallbackInterface? arg = null); |
|
215 |
|
216 // Miscellaneous interface tests |
|
217 IndirectlyImplementedInterface receiveConsequentialInterface(); |
|
218 void passConsequentialInterface(IndirectlyImplementedInterface arg); |
|
219 |
|
220 // Sequence types |
|
221 [Cached, Pure] |
|
222 readonly attribute sequence<long> readonlySequence; |
|
223 [Cached, Pure] |
|
224 readonly attribute sequence<Dict> readonlySequenceOfDictionaries; |
|
225 [Cached, Pure] |
|
226 readonly attribute sequence<Dict>? readonlyNullableSequenceOfDictionaries; |
|
227 [Cached, Pure, Frozen] |
|
228 readonly attribute sequence<long> readonlyFrozenSequence; |
|
229 [Cached, Pure, Frozen] |
|
230 readonly attribute sequence<long>? readonlyFrozenNullableSequence; |
|
231 sequence<long> receiveSequence(); |
|
232 sequence<long>? receiveNullableSequence(); |
|
233 sequence<long?> receiveSequenceOfNullableInts(); |
|
234 sequence<long?>? receiveNullableSequenceOfNullableInts(); |
|
235 void passSequence(sequence<long> arg); |
|
236 void passNullableSequence(sequence<long>? arg); |
|
237 void passSequenceOfNullableInts(sequence<long?> arg); |
|
238 void passOptionalSequenceOfNullableInts(optional sequence<long?> arg); |
|
239 void passOptionalNullableSequenceOfNullableInts(optional sequence<long?>? arg); |
|
240 sequence<TestJSImplInterface> receiveCastableObjectSequence(); |
|
241 sequence<TestCallbackInterface> receiveCallbackObjectSequence(); |
|
242 sequence<TestJSImplInterface?> receiveNullableCastableObjectSequence(); |
|
243 sequence<TestCallbackInterface?> receiveNullableCallbackObjectSequence(); |
|
244 sequence<TestJSImplInterface>? receiveCastableObjectNullableSequence(); |
|
245 sequence<TestJSImplInterface?>? receiveNullableCastableObjectNullableSequence(); |
|
246 sequence<TestJSImplInterface> receiveWeakCastableObjectSequence(); |
|
247 sequence<TestJSImplInterface?> receiveWeakNullableCastableObjectSequence(); |
|
248 sequence<TestJSImplInterface>? receiveWeakCastableObjectNullableSequence(); |
|
249 sequence<TestJSImplInterface?>? receiveWeakNullableCastableObjectNullableSequence(); |
|
250 void passCastableObjectSequence(sequence<TestJSImplInterface> arg); |
|
251 void passNullableCastableObjectSequence(sequence<TestJSImplInterface?> arg); |
|
252 void passCastableObjectNullableSequence(sequence<TestJSImplInterface>? arg); |
|
253 void passNullableCastableObjectNullableSequence(sequence<TestJSImplInterface?>? arg); |
|
254 void passOptionalSequence(optional sequence<long> arg); |
|
255 void passOptionalNullableSequence(optional sequence<long>? arg); |
|
256 void passOptionalNullableSequenceWithDefaultValue(optional sequence<long>? arg = null); |
|
257 void passOptionalObjectSequence(optional sequence<TestJSImplInterface> arg); |
|
258 void passExternalInterfaceSequence(sequence<TestExternalInterface> arg); |
|
259 void passNullableExternalInterfaceSequence(sequence<TestExternalInterface?> arg); |
|
260 |
|
261 sequence<DOMString> receiveStringSequence(); |
|
262 sequence<ByteString> receiveByteStringSequence(); |
|
263 // Callback interface problem. See bug 843261. |
|
264 //void passStringSequence(sequence<DOMString> arg); |
|
265 sequence<any> receiveAnySequence(); |
|
266 sequence<any>? receiveNullableAnySequence(); |
|
267 //XXXbz No support for sequence of sequence return values yet. |
|
268 //sequence<sequence<any>> receiveAnySequenceSequence(); |
|
269 |
|
270 sequence<object> receiveObjectSequence(); |
|
271 sequence<object?> receiveNullableObjectSequence(); |
|
272 |
|
273 void passSequenceOfSequences(sequence<sequence<long>> arg); |
|
274 //XXXbz No support for sequence of sequence return values yet. |
|
275 //sequence<sequence<long>> receiveSequenceOfSequences(); |
|
276 |
|
277 // MozMap types |
|
278 void passMozMap(MozMap<long> arg); |
|
279 void passNullableMozMap(MozMap<long>? arg); |
|
280 void passMozMapOfNullableInts(MozMap<long?> arg); |
|
281 void passOptionalMozMapOfNullableInts(optional MozMap<long?> arg); |
|
282 void passOptionalNullableMozMapOfNullableInts(optional MozMap<long?>? arg); |
|
283 void passCastableObjectMozMap(MozMap<TestJSImplInterface> arg); |
|
284 void passNullableCastableObjectMozMap(MozMap<TestJSImplInterface?> arg); |
|
285 void passCastableObjectNullableMozMap(MozMap<TestJSImplInterface>? arg); |
|
286 void passNullableCastableObjectNullableMozMap(MozMap<TestJSImplInterface?>? arg); |
|
287 void passOptionalMozMap(optional MozMap<long> arg); |
|
288 void passOptionalNullableMozMap(optional MozMap<long>? arg); |
|
289 void passOptionalNullableMozMapWithDefaultValue(optional MozMap<long>? arg = null); |
|
290 void passOptionalObjectMozMap(optional MozMap<TestJSImplInterface> arg); |
|
291 void passExternalInterfaceMozMap(MozMap<TestExternalInterface> arg); |
|
292 void passNullableExternalInterfaceMozMap(MozMap<TestExternalInterface?> arg); |
|
293 void passStringMozMap(MozMap<DOMString> arg); |
|
294 void passByteStringMozMap(MozMap<ByteString> arg); |
|
295 void passMozMapOfMozMaps(MozMap<MozMap<long>> arg); |
|
296 MozMap<long> receiveMozMap(); |
|
297 MozMap<long>? receiveNullableMozMap(); |
|
298 MozMap<long?> receiveMozMapOfNullableInts(); |
|
299 MozMap<long?>? receiveNullableMozMapOfNullableInts(); |
|
300 //XXXbz No support for MozMap of MozMaps return values yet. |
|
301 //MozMap<MozMap<long>> receiveMozMapOfMozMaps(); |
|
302 MozMap<any> receiveAnyMozMap(); |
|
303 |
|
304 // ArrayBuffer is handled differently in callback interfaces and the example generator. |
|
305 // Need to figure out what should be done there. Seems like other typed array stuff is |
|
306 // similarly not working in the JS implemented generator. Probably some other issues |
|
307 // here as well. |
|
308 // Typed array types |
|
309 //void passArrayBuffer(ArrayBuffer arg); |
|
310 //void passNullableArrayBuffer(ArrayBuffer? arg); |
|
311 //void passOptionalArrayBuffer(optional ArrayBuffer arg); |
|
312 //void passOptionalNullableArrayBuffer(optional ArrayBuffer? arg); |
|
313 //void passOptionalNullableArrayBufferWithDefaultValue(optional ArrayBuffer? arg= null); |
|
314 //void passArrayBufferView(ArrayBufferView arg); |
|
315 //void passInt8Array(Int8Array arg); |
|
316 //void passInt16Array(Int16Array arg); |
|
317 //void passInt32Array(Int32Array arg); |
|
318 //void passUint8Array(Uint8Array arg); |
|
319 //void passUint16Array(Uint16Array arg); |
|
320 //void passUint32Array(Uint32Array arg); |
|
321 //void passUint8ClampedArray(Uint8ClampedArray arg); |
|
322 //void passFloat32Array(Float32Array arg); |
|
323 //void passFloat64Array(Float64Array arg); |
|
324 //void passSequenceOfArrayBuffers(sequence<ArrayBuffer> arg); |
|
325 //void passSequenceOfNullableArrayBuffers(sequence<ArrayBuffer?> arg); |
|
326 //void passMozMapOfArrayBuffers(MozMap<ArrayBuffer> arg); |
|
327 //void passMozMapOfNullableArrayBuffers(MozMap<ArrayBuffer?> arg); |
|
328 //void passVariadicTypedArray(Float32Array... arg); |
|
329 //void passVariadicNullableTypedArray(Float32Array?... arg); |
|
330 //Uint8Array receiveUint8Array(); |
|
331 |
|
332 // DOMString types |
|
333 void passString(DOMString arg); |
|
334 void passNullableString(DOMString? arg); |
|
335 void passOptionalString(optional DOMString arg); |
|
336 void passOptionalStringWithDefaultValue(optional DOMString arg = "abc"); |
|
337 void passOptionalNullableString(optional DOMString? arg); |
|
338 void passOptionalNullableStringWithDefaultValue(optional DOMString? arg = null); |
|
339 void passVariadicString(DOMString... arg); |
|
340 |
|
341 // ByteString types |
|
342 void passByteString(ByteString arg); |
|
343 void passNullableByteString(ByteString? arg); |
|
344 void passOptionalByteString(optional ByteString arg); |
|
345 void passOptionalNullableByteString(optional ByteString? arg); |
|
346 void passVariadicByteString(ByteString... arg); |
|
347 |
|
348 // Enumerated types |
|
349 void passEnum(MyTestEnum arg); |
|
350 void passNullableEnum(MyTestEnum? arg); |
|
351 void passOptionalEnum(optional MyTestEnum arg); |
|
352 void passEnumWithDefault(optional MyTestEnum arg = "a"); |
|
353 void passOptionalNullableEnum(optional MyTestEnum? arg); |
|
354 void passOptionalNullableEnumWithDefaultValue(optional MyTestEnum? arg = null); |
|
355 void passOptionalNullableEnumWithDefaultValue2(optional MyTestEnum? arg = "a"); |
|
356 MyTestEnum receiveEnum(); |
|
357 MyTestEnum? receiveNullableEnum(); |
|
358 attribute MyTestEnum enumAttribute; |
|
359 readonly attribute MyTestEnum readonlyEnumAttribute; |
|
360 |
|
361 // Callback types |
|
362 void passCallback(MyTestCallback arg); |
|
363 void passNullableCallback(MyTestCallback? arg); |
|
364 void passOptionalCallback(optional MyTestCallback arg); |
|
365 void passOptionalNullableCallback(optional MyTestCallback? arg); |
|
366 void passOptionalNullableCallbackWithDefaultValue(optional MyTestCallback? arg = null); |
|
367 MyTestCallback receiveCallback(); |
|
368 MyTestCallback? receiveNullableCallback(); |
|
369 // Hmm. These two don't work, I think because I need a locally modified version of TestTreatAsNullCallback. |
|
370 //void passNullableTreatAsNullCallback(TestTreatAsNullCallback? arg); |
|
371 //void passOptionalNullableTreatAsNullCallback(optional TestTreatAsNullCallback? arg); |
|
372 void passOptionalNullableTreatAsNullCallbackWithDefaultValue(optional TestTreatAsNullCallback? arg = null); |
|
373 |
|
374 // Any types |
|
375 void passAny(any arg); |
|
376 void passVariadicAny(any... arg); |
|
377 void passOptionalAny(optional any arg); |
|
378 void passAnyDefaultNull(optional any arg = null); |
|
379 void passSequenceOfAny(sequence<any> arg); |
|
380 void passNullableSequenceOfAny(sequence<any>? arg); |
|
381 void passOptionalSequenceOfAny(optional sequence<any> arg); |
|
382 void passOptionalNullableSequenceOfAny(optional sequence<any>? arg); |
|
383 void passOptionalSequenceOfAnyWithDefaultValue(optional sequence<any>? arg = null); |
|
384 void passSequenceOfSequenceOfAny(sequence<sequence<any>> arg); |
|
385 void passSequenceOfNullableSequenceOfAny(sequence<sequence<any>?> arg); |
|
386 void passNullableSequenceOfNullableSequenceOfAny(sequence<sequence<any>?>? arg); |
|
387 void passOptionalNullableSequenceOfNullableSequenceOfAny(optional sequence<sequence<any>?>? arg); |
|
388 void passMozMapOfAny(MozMap<any> arg); |
|
389 void passNullableMozMapOfAny(MozMap<any>? arg); |
|
390 void passOptionalMozMapOfAny(optional MozMap<any> arg); |
|
391 void passOptionalNullableMozMapOfAny(optional MozMap<any>? arg); |
|
392 void passOptionalMozMapOfAnyWithDefaultValue(optional MozMap<any>? arg = null); |
|
393 void passMozMapOfMozMapOfAny(MozMap<MozMap<any>> arg); |
|
394 void passMozMapOfNullableMozMapOfAny(MozMap<MozMap<any>?> arg); |
|
395 void passNullableMozMapOfNullableMozMapOfAny(MozMap<MozMap<any>?>? arg); |
|
396 void passOptionalNullableMozMapOfNullableMozMapOfAny(optional MozMap<MozMap<any>?>? arg); |
|
397 void passOptionalNullableMozMapOfNullableSequenceOfAny(optional MozMap<sequence<any>?>? arg); |
|
398 void passOptionalNullableSequenceOfNullableMozMapOfAny(optional sequence<MozMap<any>?>? arg); |
|
399 any receiveAny(); |
|
400 |
|
401 // object types |
|
402 void passObject(object arg); |
|
403 void passVariadicObject(object... arg); |
|
404 void passNullableObject(object? arg); |
|
405 void passVariadicNullableObject(object... arg); |
|
406 void passOptionalObject(optional object arg); |
|
407 void passOptionalNullableObject(optional object? arg); |
|
408 void passOptionalNullableObjectWithDefaultValue(optional object? arg = null); |
|
409 void passSequenceOfObject(sequence<object> arg); |
|
410 void passSequenceOfNullableObject(sequence<object?> arg); |
|
411 void passNullableSequenceOfObject(sequence<object>? arg); |
|
412 void passOptionalNullableSequenceOfNullableSequenceOfObject(optional sequence<sequence<object>?>? arg); |
|
413 void passOptionalNullableSequenceOfNullableSequenceOfNullableObject(optional sequence<sequence<object?>?>? arg); |
|
414 void passMozMapOfObject(MozMap<object> arg); |
|
415 object receiveObject(); |
|
416 object? receiveNullableObject(); |
|
417 |
|
418 // Union types |
|
419 void passUnion((object or long) arg); |
|
420 // Some union tests are debug-only to avoid creating all those |
|
421 // unused union types in opt builds. |
|
422 #ifdef DEBUG |
|
423 void passUnion2((long or boolean) arg); |
|
424 void passUnion3((object or long or boolean) arg); |
|
425 void passUnion4((Node or long or boolean) arg); |
|
426 void passUnion5((object or boolean) arg); |
|
427 void passUnion6((object or DOMString) arg); |
|
428 void passUnion7((object or DOMString or long) arg); |
|
429 void passUnion8((object or DOMString or boolean) arg); |
|
430 void passUnion9((object or DOMString or long or boolean) arg); |
|
431 void passUnion10(optional (EventInit or long) arg); |
|
432 void passUnion11(optional (CustomEventInit or long) arg); |
|
433 void passUnion12(optional (EventInit or long) arg = 5); |
|
434 void passUnion13(optional (object or long?) arg = null); |
|
435 void passUnion14(optional (object or long?) arg = 5); |
|
436 void passUnionWithCallback((EventHandler or long) arg); |
|
437 #endif |
|
438 void passUnionWithNullable((object? or long) arg); |
|
439 void passNullableUnion((object or long)? arg); |
|
440 void passOptionalUnion(optional (object or long) arg); |
|
441 void passOptionalNullableUnion(optional (object or long)? arg); |
|
442 void passOptionalNullableUnionWithDefaultValue(optional (object or long)? arg = null); |
|
443 //void passUnionWithInterfaces((TestJSImplInterface or TestExternalInterface) arg); |
|
444 //void passUnionWithInterfacesAndNullable((TestJSImplInterface? or TestExternalInterface) arg); |
|
445 //void passUnionWithSequence((sequence<object> or long) arg); |
|
446 void passUnionWithArrayBuffer((ArrayBuffer or long) arg); |
|
447 void passUnionWithString((DOMString or object) arg); |
|
448 //void passUnionWithEnum((MyTestEnum or object) arg); |
|
449 // Trying to use a callback in a union won't include the test |
|
450 // headers, unfortunately, so won't compile. |
|
451 // void passUnionWithCallback((MyTestCallback or long) arg); |
|
452 void passUnionWithObject((object or long) arg); |
|
453 //void passUnionWithDict((Dict or long) arg); |
|
454 |
|
455 void passUnionWithDefaultValue1(optional (double or DOMString) arg = ""); |
|
456 void passUnionWithDefaultValue2(optional (double or DOMString) arg = 1); |
|
457 void passUnionWithDefaultValue3(optional (double or DOMString) arg = 1.5); |
|
458 void passUnionWithDefaultValue4(optional (float or DOMString) arg = ""); |
|
459 void passUnionWithDefaultValue5(optional (float or DOMString) arg = 1); |
|
460 void passUnionWithDefaultValue6(optional (float or DOMString) arg = 1.5); |
|
461 void passUnionWithDefaultValue7(optional (unrestricted double or DOMString) arg = ""); |
|
462 void passUnionWithDefaultValue8(optional (unrestricted double or DOMString) arg = 1); |
|
463 void passUnionWithDefaultValue9(optional (unrestricted double or DOMString) arg = 1.5); |
|
464 void passUnionWithDefaultValue10(optional (unrestricted double or DOMString) arg = Infinity); |
|
465 void passUnionWithDefaultValue11(optional (unrestricted float or DOMString) arg = ""); |
|
466 void passUnionWithDefaultValue12(optional (unrestricted float or DOMString) arg = 1); |
|
467 void passUnionWithDefaultValue13(optional (unrestricted float or DOMString) arg = Infinity); |
|
468 |
|
469 void passNullableUnionWithDefaultValue1(optional (double or DOMString)? arg = ""); |
|
470 void passNullableUnionWithDefaultValue2(optional (double or DOMString)? arg = 1); |
|
471 void passNullableUnionWithDefaultValue3(optional (double or DOMString)? arg = null); |
|
472 void passNullableUnionWithDefaultValue4(optional (float or DOMString)? arg = ""); |
|
473 void passNullableUnionWithDefaultValue5(optional (float or DOMString)? arg = 1); |
|
474 void passNullableUnionWithDefaultValue6(optional (float or DOMString)? arg = null); |
|
475 void passNullableUnionWithDefaultValue7(optional (unrestricted double or DOMString)? arg = ""); |
|
476 void passNullableUnionWithDefaultValue8(optional (unrestricted double or DOMString)? arg = 1); |
|
477 void passNullableUnionWithDefaultValue9(optional (unrestricted double or DOMString)? arg = null); |
|
478 void passNullableUnionWithDefaultValue10(optional (unrestricted float or DOMString)? arg = ""); |
|
479 void passNullableUnionWithDefaultValue11(optional (unrestricted float or DOMString)? arg = 1); |
|
480 void passNullableUnionWithDefaultValue12(optional (unrestricted float or DOMString)? arg = null); |
|
481 |
|
482 void passSequenceOfUnions(sequence<(CanvasPattern or CanvasGradient)> arg); |
|
483 void passSequenceOfUnions2(sequence<(object or long)> arg); |
|
484 void passVariadicUnion((CanvasPattern or CanvasGradient)... arg); |
|
485 |
|
486 void passSequenceOfNullableUnions(sequence<(CanvasPattern or CanvasGradient)?> arg); |
|
487 void passVariadicNullableUnion((CanvasPattern or CanvasGradient)?... arg); |
|
488 void passMozMapOfUnions(MozMap<(CanvasPattern or CanvasGradient)> arg); |
|
489 // XXXbz no move constructor on some unions |
|
490 // void passMozMapOfUnions2(MozMap<(object or long)> arg); |
|
491 |
|
492 //(CanvasPattern or CanvasGradient) receiveUnion(); |
|
493 //(object or long) receiveUnion2(); |
|
494 //(CanvasPattern? or CanvasGradient) receiveUnionContainingNull(); |
|
495 //(CanvasPattern or CanvasGradient)? receiveNullableUnion(); |
|
496 //(object or long)? receiveNullableUnion2(); |
|
497 |
|
498 //attribute (CanvasPattern or CanvasGradient) writableUnion; |
|
499 //attribute (CanvasPattern? or CanvasGradient) writableUnionContainingNull; |
|
500 //attribute (CanvasPattern or CanvasGradient)? writableNullableUnion; |
|
501 |
|
502 // Date types |
|
503 void passDate(Date arg); |
|
504 void passNullableDate(Date? arg); |
|
505 void passOptionalDate(optional Date arg); |
|
506 void passOptionalNullableDate(optional Date? arg); |
|
507 void passOptionalNullableDateWithDefaultValue(optional Date? arg = null); |
|
508 void passDateSequence(sequence<Date> arg); |
|
509 void passNullableDateSequence(sequence<Date?> arg); |
|
510 void passDateMozMap(MozMap<Date> arg); |
|
511 Date receiveDate(); |
|
512 Date? receiveNullableDate(); |
|
513 |
|
514 // binaryNames tests |
|
515 void methodRenamedFrom(); |
|
516 void methodRenamedFrom(byte argument); |
|
517 readonly attribute byte attributeGetterRenamedFrom; |
|
518 attribute byte attributeRenamedFrom; |
|
519 |
|
520 void passDictionary(optional Dict x); |
|
521 [Cached, Pure] |
|
522 readonly attribute Dict readonlyDictionary; |
|
523 [Cached, Pure] |
|
524 readonly attribute Dict? readonlyNullableDictionary; |
|
525 [Cached, Pure] |
|
526 attribute Dict writableDictionary; |
|
527 [Cached, Pure, Frozen] |
|
528 readonly attribute Dict readonlyFrozenDictionary; |
|
529 [Cached, Pure, Frozen] |
|
530 readonly attribute Dict? readonlyFrozenNullableDictionary; |
|
531 [Cached, Pure, Frozen] |
|
532 attribute Dict writableFrozenDictionary; |
|
533 Dict receiveDictionary(); |
|
534 Dict? receiveNullableDictionary(); |
|
535 void passOtherDictionary(optional GrandparentDict x); |
|
536 void passSequenceOfDictionaries(sequence<Dict> x); |
|
537 void passMozMapOfDictionaries(MozMap<GrandparentDict> x); |
|
538 // No support for nullable dictionaries inside a sequence (nor should there be) |
|
539 // void passSequenceOfNullableDictionaries(sequence<Dict?> x); |
|
540 void passDictionaryOrLong(optional Dict x); |
|
541 void passDictionaryOrLong(long x); |
|
542 |
|
543 void passDictContainingDict(optional DictContainingDict arg); |
|
544 void passDictContainingSequence(optional DictContainingSequence arg); |
|
545 DictContainingSequence receiveDictContainingSequence(); |
|
546 |
|
547 // EnforceRange/Clamp tests |
|
548 void dontEnforceRangeOrClamp(byte arg); |
|
549 void doEnforceRange([EnforceRange] byte arg); |
|
550 void doClamp([Clamp] byte arg); |
|
551 [EnforceRange] attribute byte enforcedByte; |
|
552 [Clamp] attribute byte clampedByte; |
|
553 |
|
554 // Typedefs |
|
555 const myLong myLongConstant = 5; |
|
556 void exerciseTypedefInterfaces1(AnotherNameForTestJSImplInterface arg); |
|
557 AnotherNameForTestJSImplInterface exerciseTypedefInterfaces2(NullableTestJSImplInterface arg); |
|
558 void exerciseTypedefInterfaces3(YetAnotherNameForTestJSImplInterface arg); |
|
559 |
|
560 // Static methods and attributes |
|
561 // FIXME: Bug 863952 Static things are not supported yet |
|
562 /* |
|
563 static attribute boolean staticAttribute; |
|
564 static void staticMethod(boolean arg); |
|
565 static void staticMethodWithContext(any arg); |
|
566 */ |
|
567 |
|
568 // Overload resolution tests |
|
569 //void overload1(DOMString... strs); |
|
570 boolean overload1(TestJSImplInterface arg); |
|
571 TestJSImplInterface overload1(DOMString strs, TestJSImplInterface arg); |
|
572 void overload2(TestJSImplInterface arg); |
|
573 void overload2(optional Dict arg); |
|
574 void overload2(boolean arg); |
|
575 void overload2(DOMString arg); |
|
576 void overload2(Date arg); |
|
577 void overload3(TestJSImplInterface arg); |
|
578 void overload3(MyTestCallback arg); |
|
579 void overload3(boolean arg); |
|
580 void overload4(TestJSImplInterface arg); |
|
581 void overload4(TestCallbackInterface arg); |
|
582 void overload4(DOMString arg); |
|
583 void overload5(long arg); |
|
584 void overload5(MyTestEnum arg); |
|
585 void overload6(long arg); |
|
586 void overload6(boolean arg); |
|
587 void overload7(long arg); |
|
588 void overload7(boolean arg); |
|
589 void overload7(ByteString arg); |
|
590 void overload8(long arg); |
|
591 void overload8(TestJSImplInterface arg); |
|
592 void overload9(long? arg); |
|
593 void overload9(DOMString arg); |
|
594 void overload10(long? arg); |
|
595 void overload10(object arg); |
|
596 void overload11(long arg); |
|
597 void overload11(DOMString? arg); |
|
598 void overload12(long arg); |
|
599 void overload12(boolean? arg); |
|
600 void overload13(long? arg); |
|
601 void overload13(boolean arg); |
|
602 void overload14(optional long arg); |
|
603 void overload14(TestInterface arg); |
|
604 void overload15(long arg); |
|
605 void overload15(optional TestInterface arg); |
|
606 void overload16(long arg); |
|
607 void overload16(optional TestInterface? arg); |
|
608 |
|
609 // Variadic handling |
|
610 void passVariadicThirdArg(DOMString arg1, long arg2, TestJSImplInterface... arg3); |
|
611 |
|
612 // Conditionally exposed methods/attributes |
|
613 [Pref="abc.def"] |
|
614 readonly attribute boolean prefable1; |
|
615 [Pref="abc.def"] |
|
616 readonly attribute boolean prefable2; |
|
617 [Pref="ghi.jkl"] |
|
618 readonly attribute boolean prefable3; |
|
619 [Pref="ghi.jkl"] |
|
620 readonly attribute boolean prefable4; |
|
621 [Pref="abc.def"] |
|
622 readonly attribute boolean prefable5; |
|
623 [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] |
|
624 readonly attribute boolean prefable6; |
|
625 [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] |
|
626 readonly attribute boolean prefable7; |
|
627 [Pref="ghi.jkl", Func="nsGenericHTMLElement::TouchEventsEnabled"] |
|
628 readonly attribute boolean prefable8; |
|
629 [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] |
|
630 readonly attribute boolean prefable9; |
|
631 [Pref="abc.def"] |
|
632 void prefable10(); |
|
633 [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] |
|
634 void prefable11(); |
|
635 [Pref="abc.def", Func="TestFuncControlledMember"] |
|
636 readonly attribute boolean prefable12; |
|
637 [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] |
|
638 void prefable13(); |
|
639 [Pref="abc.def", Func="TestFuncControlledMember"] |
|
640 readonly attribute boolean prefable14; |
|
641 [Func="TestFuncControlledMember"] |
|
642 readonly attribute boolean prefable15; |
|
643 [Func="TestFuncControlledMember"] |
|
644 readonly attribute boolean prefable16; |
|
645 [Pref="abc.def", Func="TestFuncControlledMember"] |
|
646 void prefable17(); |
|
647 [Func="TestFuncControlledMember"] |
|
648 void prefable18(); |
|
649 [Func="TestFuncControlledMember"] |
|
650 void prefable19(); |
|
651 [Pref="abc.def", Func="TestFuncControlledMember", ChromeOnly] |
|
652 void prefable20(); |
|
653 [Func="TestFuncControlledMember", AvailableIn=CertifiedApps] |
|
654 void prefable21(); |
|
655 [Func="TestFuncControlledMember", AvailableIn=CertifiedApps] |
|
656 void prefable22(); |
|
657 [Pref="abc.def", Func="TestFuncControlledMember", AvailableIn=CertifiedApps] |
|
658 void prefable23(); |
|
659 [Pref="abc.def", Func="TestFuncControlledMember", AvailableIn=PrivilegedApps] |
|
660 void prefable24(); |
|
661 |
|
662 // Miscellania |
|
663 [LenientThis] attribute long attrWithLenientThis; |
|
664 // FIXME: Bug 863954 Unforgeable things get all confused when |
|
665 // non-JS-implemented interfaces inherit from JS-implemented ones or vice |
|
666 // versa. |
|
667 // [Unforgeable] readonly attribute long unforgeableAttr; |
|
668 // [Unforgeable, ChromeOnly] readonly attribute long unforgeableAttr2; |
|
669 // FIXME: Bug 863955 No stringifiers yet |
|
670 // stringifier; |
|
671 void passRenamedInterface(TestRenamedInterface arg); |
|
672 [PutForwards=writableByte] readonly attribute TestJSImplInterface putForwardsAttr; |
|
673 [PutForwards=writableByte, LenientThis] readonly attribute TestJSImplInterface putForwardsAttr2; |
|
674 [PutForwards=writableByte, ChromeOnly] readonly attribute TestJSImplInterface putForwardsAttr3; |
|
675 [Throws] void throwingMethod(); |
|
676 [Throws] attribute boolean throwingAttr; |
|
677 [GetterThrows] attribute boolean throwingGetterAttr; |
|
678 [SetterThrows] attribute boolean throwingSetterAttr; |
|
679 // legacycaller short(unsigned long arg1, TestInterface arg2); |
|
680 void passArgsWithDefaults(optional long arg1, |
|
681 optional TestInterface? arg2 = null, |
|
682 optional Dict arg3, optional double arg4 = 5.0, |
|
683 optional float arg5); |
|
684 attribute any jsonifierShouldSkipThis; |
|
685 attribute TestParentInterface jsonifierShouldSkipThis2; |
|
686 attribute TestCallbackInterface jsonifierShouldSkipThis3; |
|
687 jsonifier; |
|
688 |
|
689 // If you add things here, add them to TestCodeGen as well |
|
690 }; |
|
691 |
|
692 [NavigatorProperty="TestNavigator", JSImplementation="@mozilla.org/test;1"] |
|
693 interface TestNavigator { |
|
694 }; |
|
695 |
|
696 [Constructor, NavigatorProperty="TestNavigatorWithConstructor", JSImplementation="@mozilla.org/test;1"] |
|
697 interface TestNavigatorWithConstructor { |
|
698 }; |
|
699 |
|
700 interface TestCImplementedInterface : TestJSImplInterface { |
|
701 }; |
|
702 |
|
703 interface TestCImplementedInterface2 { |
|
704 }; |