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