michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: */ michael@0: michael@0: typedef TestJSImplInterface AnotherNameForTestJSImplInterface; michael@0: typedef TestJSImplInterface YetAnotherNameForTestJSImplInterface; michael@0: typedef TestJSImplInterface? NullableTestJSImplInterface; michael@0: michael@0: callback MyTestCallback = void(); michael@0: michael@0: TestInterface implements ImplementedInterface; michael@0: michael@0: enum MyTestEnum { michael@0: "a", michael@0: "b" michael@0: }; michael@0: michael@0: // We don't support multiple constructors (bug 869268) or named constructors michael@0: // for JS-implemented WebIDL. michael@0: [Constructor(DOMString str, unsigned long num, boolean? boolArg, michael@0: TestInterface? iface, long arg1, michael@0: DictForConstructor dict, any any1, michael@0: object obj1, michael@0: object? obj2, sequence seq, optional any any2, michael@0: optional object obj3, michael@0: optional object? obj4), michael@0: JSImplementation="@mozilla.org/test-js-impl-interface;1"] michael@0: interface TestJSImplInterface { michael@0: // Integer types michael@0: // XXXbz add tests for throwing versions of all the integer stuff michael@0: readonly attribute byte readonlyByte; michael@0: attribute byte writableByte; michael@0: void passByte(byte arg); michael@0: byte receiveByte(); michael@0: void passOptionalByte(optional byte arg); michael@0: void passOptionalByteBeforeRequired(optional byte arg1, byte arg2); michael@0: void passOptionalByteWithDefault(optional byte arg = 0); michael@0: void passOptionalByteWithDefaultBeforeRequired(optional byte arg1 = 0, byte arg2); michael@0: void passNullableByte(byte? arg); michael@0: void passOptionalNullableByte(optional byte? arg); michael@0: void passVariadicByte(byte... arg); michael@0: [Cached, Pure] michael@0: readonly attribute byte cachedByte; michael@0: [Cached, Constant] michael@0: readonly attribute byte cachedConstantByte; michael@0: [Cached, Pure] michael@0: attribute byte cachedWritableByte; michael@0: michael@0: readonly attribute short readonlyShort; michael@0: attribute short writableShort; michael@0: void passShort(short arg); michael@0: short receiveShort(); michael@0: void passOptionalShort(optional short arg); michael@0: void passOptionalShortWithDefault(optional short arg = 5); michael@0: michael@0: readonly attribute long readonlyLong; michael@0: attribute long writableLong; michael@0: void passLong(long arg); michael@0: long receiveLong(); michael@0: void passOptionalLong(optional long arg); michael@0: void passOptionalLongWithDefault(optional long arg = 7); michael@0: michael@0: readonly attribute long long readonlyLongLong; michael@0: attribute long long writableLongLong; michael@0: void passLongLong(long long arg); michael@0: long long receiveLongLong(); michael@0: void passOptionalLongLong(optional long long arg); michael@0: void passOptionalLongLongWithDefault(optional long long arg = -12); michael@0: michael@0: readonly attribute octet readonlyOctet; michael@0: attribute octet writableOctet; michael@0: void passOctet(octet arg); michael@0: octet receiveOctet(); michael@0: void passOptionalOctet(optional octet arg); michael@0: void passOptionalOctetWithDefault(optional octet arg = 19); michael@0: michael@0: readonly attribute unsigned short readonlyUnsignedShort; michael@0: attribute unsigned short writableUnsignedShort; michael@0: void passUnsignedShort(unsigned short arg); michael@0: unsigned short receiveUnsignedShort(); michael@0: void passOptionalUnsignedShort(optional unsigned short arg); michael@0: void passOptionalUnsignedShortWithDefault(optional unsigned short arg = 2); michael@0: michael@0: readonly attribute unsigned long readonlyUnsignedLong; michael@0: attribute unsigned long writableUnsignedLong; michael@0: void passUnsignedLong(unsigned long arg); michael@0: unsigned long receiveUnsignedLong(); michael@0: void passOptionalUnsignedLong(optional unsigned long arg); michael@0: void passOptionalUnsignedLongWithDefault(optional unsigned long arg = 6); michael@0: michael@0: readonly attribute unsigned long long readonlyUnsignedLongLong; michael@0: attribute unsigned long long writableUnsignedLongLong; michael@0: void passUnsignedLongLong(unsigned long long arg); michael@0: unsigned long long receiveUnsignedLongLong(); michael@0: void passOptionalUnsignedLongLong(optional unsigned long long arg); michael@0: void passOptionalUnsignedLongLongWithDefault(optional unsigned long long arg = 17); michael@0: michael@0: attribute float writableFloat; michael@0: attribute unrestricted float writableUnrestrictedFloat; michael@0: attribute float? writableNullableFloat; michael@0: attribute unrestricted float? writableNullableUnrestrictedFloat; michael@0: attribute double writableDouble; michael@0: attribute unrestricted double writableUnrestrictedDouble; michael@0: attribute double? writableNullableDouble; michael@0: attribute unrestricted double? writableNullableUnrestrictedDouble; michael@0: void passFloat(float arg1, unrestricted float arg2, michael@0: float? arg3, unrestricted float? arg4, michael@0: double arg5, unrestricted double arg6, michael@0: double? arg7, unrestricted double? arg8, michael@0: sequence arg9, sequence arg10, michael@0: sequence arg11, sequence arg12, michael@0: sequence arg13, sequence arg14, michael@0: sequence arg15, sequence arg16); michael@0: [LenientFloat] michael@0: void passLenientFloat(float arg1, unrestricted float arg2, michael@0: float? arg3, unrestricted float? arg4, michael@0: double arg5, unrestricted double arg6, michael@0: double? arg7, unrestricted double? arg8, michael@0: sequence arg9, michael@0: sequence arg10, michael@0: sequence arg11, michael@0: sequence arg12, michael@0: sequence arg13, michael@0: sequence arg14, michael@0: sequence arg15, michael@0: sequence arg16); michael@0: [LenientFloat] michael@0: attribute float lenientFloatAttr; michael@0: [LenientFloat] michael@0: attribute double lenientDoubleAttr; michael@0: michael@0: // Castable interface types michael@0: // XXXbz add tests for throwing versions of all the castable interface stuff michael@0: TestJSImplInterface receiveSelf(); michael@0: TestJSImplInterface? receiveNullableSelf(); michael@0: michael@0: // Callback interface ignores 'resultNotAddRefed'. See bug 843272. michael@0: //TestJSImplInterface receiveWeakSelf(); michael@0: //TestJSImplInterface? receiveWeakNullableSelf(); michael@0: michael@0: // A version to test for casting to TestJSImplInterface& michael@0: void passSelf(TestJSImplInterface arg); michael@0: void passNullableSelf(TestJSImplInterface? arg); michael@0: attribute TestJSImplInterface nonNullSelf; michael@0: attribute TestJSImplInterface? nullableSelf; michael@0: [Cached, Pure] michael@0: readonly attribute TestJSImplInterface cachedSelf; michael@0: // Optional arguments michael@0: void passOptionalSelf(optional TestJSImplInterface? arg); michael@0: void passOptionalNonNullSelf(optional TestJSImplInterface arg); michael@0: void passOptionalSelfWithDefault(optional TestJSImplInterface? arg = null); michael@0: michael@0: // Non-wrapper-cache interface types michael@0: [NewObject] michael@0: TestNonWrapperCacheInterface receiveNonWrapperCacheInterface(); michael@0: [NewObject] michael@0: TestNonWrapperCacheInterface? receiveNullableNonWrapperCacheInterface(); michael@0: michael@0: [NewObject] michael@0: sequence receiveNonWrapperCacheInterfaceSequence(); michael@0: [NewObject] michael@0: sequence receiveNullableNonWrapperCacheInterfaceSequence(); michael@0: [NewObject] michael@0: sequence? receiveNonWrapperCacheInterfaceNullableSequence(); michael@0: [NewObject] michael@0: sequence? receiveNullableNonWrapperCacheInterfaceNullableSequence(); michael@0: michael@0: // Non-castable interface types michael@0: IndirectlyImplementedInterface receiveOther(); michael@0: IndirectlyImplementedInterface? receiveNullableOther(); michael@0: // Callback interface ignores 'resultNotAddRefed'. See bug 843272. michael@0: //IndirectlyImplementedInterface receiveWeakOther(); michael@0: //IndirectlyImplementedInterface? receiveWeakNullableOther(); michael@0: michael@0: void passOther(IndirectlyImplementedInterface arg); michael@0: void passNullableOther(IndirectlyImplementedInterface? arg); michael@0: attribute IndirectlyImplementedInterface nonNullOther; michael@0: attribute IndirectlyImplementedInterface? nullableOther; michael@0: // Optional arguments michael@0: void passOptionalOther(optional IndirectlyImplementedInterface? arg); michael@0: void passOptionalNonNullOther(optional IndirectlyImplementedInterface arg); michael@0: void passOptionalOtherWithDefault(optional IndirectlyImplementedInterface? arg = null); michael@0: michael@0: // External interface types michael@0: TestExternalInterface receiveExternal(); michael@0: TestExternalInterface? receiveNullableExternal(); michael@0: // Callback interface ignores 'resultNotAddRefed'. See bug 843272. michael@0: //TestExternalInterface receiveWeakExternal(); michael@0: //TestExternalInterface? receiveWeakNullableExternal(); michael@0: void passExternal(TestExternalInterface arg); michael@0: void passNullableExternal(TestExternalInterface? arg); michael@0: attribute TestExternalInterface nonNullExternal; michael@0: attribute TestExternalInterface? nullableExternal; michael@0: // Optional arguments michael@0: void passOptionalExternal(optional TestExternalInterface? arg); michael@0: void passOptionalNonNullExternal(optional TestExternalInterface arg); michael@0: void passOptionalExternalWithDefault(optional TestExternalInterface? arg = null); michael@0: michael@0: // Callback interface types michael@0: TestCallbackInterface receiveCallbackInterface(); michael@0: TestCallbackInterface? receiveNullableCallbackInterface(); michael@0: // Callback interface ignores 'resultNotAddRefed'. See bug 843272. michael@0: //TestCallbackInterface receiveWeakCallbackInterface(); michael@0: //TestCallbackInterface? receiveWeakNullableCallbackInterface(); michael@0: void passCallbackInterface(TestCallbackInterface arg); michael@0: void passNullableCallbackInterface(TestCallbackInterface? arg); michael@0: attribute TestCallbackInterface nonNullCallbackInterface; michael@0: attribute TestCallbackInterface? nullableCallbackInterface; michael@0: // Optional arguments michael@0: void passOptionalCallbackInterface(optional TestCallbackInterface? arg); michael@0: void passOptionalNonNullCallbackInterface(optional TestCallbackInterface arg); michael@0: void passOptionalCallbackInterfaceWithDefault(optional TestCallbackInterface? arg = null); michael@0: michael@0: // Miscellaneous interface tests michael@0: IndirectlyImplementedInterface receiveConsequentialInterface(); michael@0: void passConsequentialInterface(IndirectlyImplementedInterface arg); michael@0: michael@0: // Sequence types michael@0: [Cached, Pure] michael@0: readonly attribute sequence readonlySequence; michael@0: [Cached, Pure] michael@0: readonly attribute sequence readonlySequenceOfDictionaries; michael@0: [Cached, Pure] michael@0: readonly attribute sequence? readonlyNullableSequenceOfDictionaries; michael@0: [Cached, Pure, Frozen] michael@0: readonly attribute sequence readonlyFrozenSequence; michael@0: [Cached, Pure, Frozen] michael@0: readonly attribute sequence? readonlyFrozenNullableSequence; michael@0: sequence receiveSequence(); michael@0: sequence? receiveNullableSequence(); michael@0: sequence receiveSequenceOfNullableInts(); michael@0: sequence? receiveNullableSequenceOfNullableInts(); michael@0: void passSequence(sequence arg); michael@0: void passNullableSequence(sequence? arg); michael@0: void passSequenceOfNullableInts(sequence arg); michael@0: void passOptionalSequenceOfNullableInts(optional sequence arg); michael@0: void passOptionalNullableSequenceOfNullableInts(optional sequence? arg); michael@0: sequence receiveCastableObjectSequence(); michael@0: sequence receiveCallbackObjectSequence(); michael@0: sequence receiveNullableCastableObjectSequence(); michael@0: sequence receiveNullableCallbackObjectSequence(); michael@0: sequence? receiveCastableObjectNullableSequence(); michael@0: sequence? receiveNullableCastableObjectNullableSequence(); michael@0: sequence receiveWeakCastableObjectSequence(); michael@0: sequence receiveWeakNullableCastableObjectSequence(); michael@0: sequence? receiveWeakCastableObjectNullableSequence(); michael@0: sequence? receiveWeakNullableCastableObjectNullableSequence(); michael@0: void passCastableObjectSequence(sequence arg); michael@0: void passNullableCastableObjectSequence(sequence arg); michael@0: void passCastableObjectNullableSequence(sequence? arg); michael@0: void passNullableCastableObjectNullableSequence(sequence? arg); michael@0: void passOptionalSequence(optional sequence arg); michael@0: void passOptionalNullableSequence(optional sequence? arg); michael@0: void passOptionalNullableSequenceWithDefaultValue(optional sequence? arg = null); michael@0: void passOptionalObjectSequence(optional sequence arg); michael@0: void passExternalInterfaceSequence(sequence arg); michael@0: void passNullableExternalInterfaceSequence(sequence arg); michael@0: michael@0: sequence receiveStringSequence(); michael@0: sequence receiveByteStringSequence(); michael@0: // Callback interface problem. See bug 843261. michael@0: //void passStringSequence(sequence arg); michael@0: sequence receiveAnySequence(); michael@0: sequence? receiveNullableAnySequence(); michael@0: //XXXbz No support for sequence of sequence return values yet. michael@0: //sequence> receiveAnySequenceSequence(); michael@0: michael@0: sequence receiveObjectSequence(); michael@0: sequence receiveNullableObjectSequence(); michael@0: michael@0: void passSequenceOfSequences(sequence> arg); michael@0: //XXXbz No support for sequence of sequence return values yet. michael@0: //sequence> receiveSequenceOfSequences(); michael@0: michael@0: // MozMap types michael@0: void passMozMap(MozMap arg); michael@0: void passNullableMozMap(MozMap? arg); michael@0: void passMozMapOfNullableInts(MozMap arg); michael@0: void passOptionalMozMapOfNullableInts(optional MozMap arg); michael@0: void passOptionalNullableMozMapOfNullableInts(optional MozMap? arg); michael@0: void passCastableObjectMozMap(MozMap arg); michael@0: void passNullableCastableObjectMozMap(MozMap arg); michael@0: void passCastableObjectNullableMozMap(MozMap? arg); michael@0: void passNullableCastableObjectNullableMozMap(MozMap? arg); michael@0: void passOptionalMozMap(optional MozMap arg); michael@0: void passOptionalNullableMozMap(optional MozMap? arg); michael@0: void passOptionalNullableMozMapWithDefaultValue(optional MozMap? arg = null); michael@0: void passOptionalObjectMozMap(optional MozMap arg); michael@0: void passExternalInterfaceMozMap(MozMap arg); michael@0: void passNullableExternalInterfaceMozMap(MozMap arg); michael@0: void passStringMozMap(MozMap arg); michael@0: void passByteStringMozMap(MozMap arg); michael@0: void passMozMapOfMozMaps(MozMap> arg); michael@0: MozMap receiveMozMap(); michael@0: MozMap? receiveNullableMozMap(); michael@0: MozMap receiveMozMapOfNullableInts(); michael@0: MozMap? receiveNullableMozMapOfNullableInts(); michael@0: //XXXbz No support for MozMap of MozMaps return values yet. michael@0: //MozMap> receiveMozMapOfMozMaps(); michael@0: MozMap receiveAnyMozMap(); michael@0: michael@0: // ArrayBuffer is handled differently in callback interfaces and the example generator. michael@0: // Need to figure out what should be done there. Seems like other typed array stuff is michael@0: // similarly not working in the JS implemented generator. Probably some other issues michael@0: // here as well. michael@0: // Typed array types michael@0: //void passArrayBuffer(ArrayBuffer arg); michael@0: //void passNullableArrayBuffer(ArrayBuffer? arg); michael@0: //void passOptionalArrayBuffer(optional ArrayBuffer arg); michael@0: //void passOptionalNullableArrayBuffer(optional ArrayBuffer? arg); michael@0: //void passOptionalNullableArrayBufferWithDefaultValue(optional ArrayBuffer? arg= null); michael@0: //void passArrayBufferView(ArrayBufferView arg); michael@0: //void passInt8Array(Int8Array arg); michael@0: //void passInt16Array(Int16Array arg); michael@0: //void passInt32Array(Int32Array arg); michael@0: //void passUint8Array(Uint8Array arg); michael@0: //void passUint16Array(Uint16Array arg); michael@0: //void passUint32Array(Uint32Array arg); michael@0: //void passUint8ClampedArray(Uint8ClampedArray arg); michael@0: //void passFloat32Array(Float32Array arg); michael@0: //void passFloat64Array(Float64Array arg); michael@0: //void passSequenceOfArrayBuffers(sequence arg); michael@0: //void passSequenceOfNullableArrayBuffers(sequence arg); michael@0: //void passMozMapOfArrayBuffers(MozMap arg); michael@0: //void passMozMapOfNullableArrayBuffers(MozMap arg); michael@0: //void passVariadicTypedArray(Float32Array... arg); michael@0: //void passVariadicNullableTypedArray(Float32Array?... arg); michael@0: //Uint8Array receiveUint8Array(); michael@0: michael@0: // DOMString types michael@0: void passString(DOMString arg); michael@0: void passNullableString(DOMString? arg); michael@0: void passOptionalString(optional DOMString arg); michael@0: void passOptionalStringWithDefaultValue(optional DOMString arg = "abc"); michael@0: void passOptionalNullableString(optional DOMString? arg); michael@0: void passOptionalNullableStringWithDefaultValue(optional DOMString? arg = null); michael@0: void passVariadicString(DOMString... arg); michael@0: michael@0: // ByteString types michael@0: void passByteString(ByteString arg); michael@0: void passNullableByteString(ByteString? arg); michael@0: void passOptionalByteString(optional ByteString arg); michael@0: void passOptionalNullableByteString(optional ByteString? arg); michael@0: void passVariadicByteString(ByteString... arg); michael@0: michael@0: // Enumerated types michael@0: void passEnum(MyTestEnum arg); michael@0: void passNullableEnum(MyTestEnum? arg); michael@0: void passOptionalEnum(optional MyTestEnum arg); michael@0: void passEnumWithDefault(optional MyTestEnum arg = "a"); michael@0: void passOptionalNullableEnum(optional MyTestEnum? arg); michael@0: void passOptionalNullableEnumWithDefaultValue(optional MyTestEnum? arg = null); michael@0: void passOptionalNullableEnumWithDefaultValue2(optional MyTestEnum? arg = "a"); michael@0: MyTestEnum receiveEnum(); michael@0: MyTestEnum? receiveNullableEnum(); michael@0: attribute MyTestEnum enumAttribute; michael@0: readonly attribute MyTestEnum readonlyEnumAttribute; michael@0: michael@0: // Callback types michael@0: void passCallback(MyTestCallback arg); michael@0: void passNullableCallback(MyTestCallback? arg); michael@0: void passOptionalCallback(optional MyTestCallback arg); michael@0: void passOptionalNullableCallback(optional MyTestCallback? arg); michael@0: void passOptionalNullableCallbackWithDefaultValue(optional MyTestCallback? arg = null); michael@0: MyTestCallback receiveCallback(); michael@0: MyTestCallback? receiveNullableCallback(); michael@0: // Hmm. These two don't work, I think because I need a locally modified version of TestTreatAsNullCallback. michael@0: //void passNullableTreatAsNullCallback(TestTreatAsNullCallback? arg); michael@0: //void passOptionalNullableTreatAsNullCallback(optional TestTreatAsNullCallback? arg); michael@0: void passOptionalNullableTreatAsNullCallbackWithDefaultValue(optional TestTreatAsNullCallback? arg = null); michael@0: michael@0: // Any types michael@0: void passAny(any arg); michael@0: void passVariadicAny(any... arg); michael@0: void passOptionalAny(optional any arg); michael@0: void passAnyDefaultNull(optional any arg = null); michael@0: void passSequenceOfAny(sequence arg); michael@0: void passNullableSequenceOfAny(sequence? arg); michael@0: void passOptionalSequenceOfAny(optional sequence arg); michael@0: void passOptionalNullableSequenceOfAny(optional sequence? arg); michael@0: void passOptionalSequenceOfAnyWithDefaultValue(optional sequence? arg = null); michael@0: void passSequenceOfSequenceOfAny(sequence> arg); michael@0: void passSequenceOfNullableSequenceOfAny(sequence?> arg); michael@0: void passNullableSequenceOfNullableSequenceOfAny(sequence?>? arg); michael@0: void passOptionalNullableSequenceOfNullableSequenceOfAny(optional sequence?>? arg); michael@0: void passMozMapOfAny(MozMap arg); michael@0: void passNullableMozMapOfAny(MozMap? arg); michael@0: void passOptionalMozMapOfAny(optional MozMap arg); michael@0: void passOptionalNullableMozMapOfAny(optional MozMap? arg); michael@0: void passOptionalMozMapOfAnyWithDefaultValue(optional MozMap? arg = null); michael@0: void passMozMapOfMozMapOfAny(MozMap> arg); michael@0: void passMozMapOfNullableMozMapOfAny(MozMap?> arg); michael@0: void passNullableMozMapOfNullableMozMapOfAny(MozMap?>? arg); michael@0: void passOptionalNullableMozMapOfNullableMozMapOfAny(optional MozMap?>? arg); michael@0: void passOptionalNullableMozMapOfNullableSequenceOfAny(optional MozMap?>? arg); michael@0: void passOptionalNullableSequenceOfNullableMozMapOfAny(optional sequence?>? arg); michael@0: any receiveAny(); michael@0: michael@0: // object types michael@0: void passObject(object arg); michael@0: void passVariadicObject(object... arg); michael@0: void passNullableObject(object? arg); michael@0: void passVariadicNullableObject(object... arg); michael@0: void passOptionalObject(optional object arg); michael@0: void passOptionalNullableObject(optional object? arg); michael@0: void passOptionalNullableObjectWithDefaultValue(optional object? arg = null); michael@0: void passSequenceOfObject(sequence arg); michael@0: void passSequenceOfNullableObject(sequence arg); michael@0: void passNullableSequenceOfObject(sequence? arg); michael@0: void passOptionalNullableSequenceOfNullableSequenceOfObject(optional sequence?>? arg); michael@0: void passOptionalNullableSequenceOfNullableSequenceOfNullableObject(optional sequence?>? arg); michael@0: void passMozMapOfObject(MozMap arg); michael@0: object receiveObject(); michael@0: object? receiveNullableObject(); michael@0: michael@0: // Union types michael@0: void passUnion((object or long) arg); michael@0: // Some union tests are debug-only to avoid creating all those michael@0: // unused union types in opt builds. michael@0: #ifdef DEBUG michael@0: void passUnion2((long or boolean) arg); michael@0: void passUnion3((object or long or boolean) arg); michael@0: void passUnion4((Node or long or boolean) arg); michael@0: void passUnion5((object or boolean) arg); michael@0: void passUnion6((object or DOMString) arg); michael@0: void passUnion7((object or DOMString or long) arg); michael@0: void passUnion8((object or DOMString or boolean) arg); michael@0: void passUnion9((object or DOMString or long or boolean) arg); michael@0: void passUnion10(optional (EventInit or long) arg); michael@0: void passUnion11(optional (CustomEventInit or long) arg); michael@0: void passUnion12(optional (EventInit or long) arg = 5); michael@0: void passUnion13(optional (object or long?) arg = null); michael@0: void passUnion14(optional (object or long?) arg = 5); michael@0: void passUnionWithCallback((EventHandler or long) arg); michael@0: #endif michael@0: void passUnionWithNullable((object? or long) arg); michael@0: void passNullableUnion((object or long)? arg); michael@0: void passOptionalUnion(optional (object or long) arg); michael@0: void passOptionalNullableUnion(optional (object or long)? arg); michael@0: void passOptionalNullableUnionWithDefaultValue(optional (object or long)? arg = null); michael@0: //void passUnionWithInterfaces((TestJSImplInterface or TestExternalInterface) arg); michael@0: //void passUnionWithInterfacesAndNullable((TestJSImplInterface? or TestExternalInterface) arg); michael@0: //void passUnionWithSequence((sequence or long) arg); michael@0: void passUnionWithArrayBuffer((ArrayBuffer or long) arg); michael@0: void passUnionWithString((DOMString or object) arg); michael@0: //void passUnionWithEnum((MyTestEnum or object) arg); michael@0: // Trying to use a callback in a union won't include the test michael@0: // headers, unfortunately, so won't compile. michael@0: // void passUnionWithCallback((MyTestCallback or long) arg); michael@0: void passUnionWithObject((object or long) arg); michael@0: //void passUnionWithDict((Dict or long) arg); michael@0: michael@0: void passUnionWithDefaultValue1(optional (double or DOMString) arg = ""); michael@0: void passUnionWithDefaultValue2(optional (double or DOMString) arg = 1); michael@0: void passUnionWithDefaultValue3(optional (double or DOMString) arg = 1.5); michael@0: void passUnionWithDefaultValue4(optional (float or DOMString) arg = ""); michael@0: void passUnionWithDefaultValue5(optional (float or DOMString) arg = 1); michael@0: void passUnionWithDefaultValue6(optional (float or DOMString) arg = 1.5); michael@0: void passUnionWithDefaultValue7(optional (unrestricted double or DOMString) arg = ""); michael@0: void passUnionWithDefaultValue8(optional (unrestricted double or DOMString) arg = 1); michael@0: void passUnionWithDefaultValue9(optional (unrestricted double or DOMString) arg = 1.5); michael@0: void passUnionWithDefaultValue10(optional (unrestricted double or DOMString) arg = Infinity); michael@0: void passUnionWithDefaultValue11(optional (unrestricted float or DOMString) arg = ""); michael@0: void passUnionWithDefaultValue12(optional (unrestricted float or DOMString) arg = 1); michael@0: void passUnionWithDefaultValue13(optional (unrestricted float or DOMString) arg = Infinity); michael@0: michael@0: void passNullableUnionWithDefaultValue1(optional (double or DOMString)? arg = ""); michael@0: void passNullableUnionWithDefaultValue2(optional (double or DOMString)? arg = 1); michael@0: void passNullableUnionWithDefaultValue3(optional (double or DOMString)? arg = null); michael@0: void passNullableUnionWithDefaultValue4(optional (float or DOMString)? arg = ""); michael@0: void passNullableUnionWithDefaultValue5(optional (float or DOMString)? arg = 1); michael@0: void passNullableUnionWithDefaultValue6(optional (float or DOMString)? arg = null); michael@0: void passNullableUnionWithDefaultValue7(optional (unrestricted double or DOMString)? arg = ""); michael@0: void passNullableUnionWithDefaultValue8(optional (unrestricted double or DOMString)? arg = 1); michael@0: void passNullableUnionWithDefaultValue9(optional (unrestricted double or DOMString)? arg = null); michael@0: void passNullableUnionWithDefaultValue10(optional (unrestricted float or DOMString)? arg = ""); michael@0: void passNullableUnionWithDefaultValue11(optional (unrestricted float or DOMString)? arg = 1); michael@0: void passNullableUnionWithDefaultValue12(optional (unrestricted float or DOMString)? arg = null); michael@0: michael@0: void passSequenceOfUnions(sequence<(CanvasPattern or CanvasGradient)> arg); michael@0: void passSequenceOfUnions2(sequence<(object or long)> arg); michael@0: void passVariadicUnion((CanvasPattern or CanvasGradient)... arg); michael@0: michael@0: void passSequenceOfNullableUnions(sequence<(CanvasPattern or CanvasGradient)?> arg); michael@0: void passVariadicNullableUnion((CanvasPattern or CanvasGradient)?... arg); michael@0: void passMozMapOfUnions(MozMap<(CanvasPattern or CanvasGradient)> arg); michael@0: // XXXbz no move constructor on some unions michael@0: // void passMozMapOfUnions2(MozMap<(object or long)> arg); michael@0: michael@0: //(CanvasPattern or CanvasGradient) receiveUnion(); michael@0: //(object or long) receiveUnion2(); michael@0: //(CanvasPattern? or CanvasGradient) receiveUnionContainingNull(); michael@0: //(CanvasPattern or CanvasGradient)? receiveNullableUnion(); michael@0: //(object or long)? receiveNullableUnion2(); michael@0: michael@0: //attribute (CanvasPattern or CanvasGradient) writableUnion; michael@0: //attribute (CanvasPattern? or CanvasGradient) writableUnionContainingNull; michael@0: //attribute (CanvasPattern or CanvasGradient)? writableNullableUnion; michael@0: michael@0: // Date types michael@0: void passDate(Date arg); michael@0: void passNullableDate(Date? arg); michael@0: void passOptionalDate(optional Date arg); michael@0: void passOptionalNullableDate(optional Date? arg); michael@0: void passOptionalNullableDateWithDefaultValue(optional Date? arg = null); michael@0: void passDateSequence(sequence arg); michael@0: void passNullableDateSequence(sequence arg); michael@0: void passDateMozMap(MozMap arg); michael@0: Date receiveDate(); michael@0: Date? receiveNullableDate(); michael@0: michael@0: // binaryNames tests michael@0: void methodRenamedFrom(); michael@0: void methodRenamedFrom(byte argument); michael@0: readonly attribute byte attributeGetterRenamedFrom; michael@0: attribute byte attributeRenamedFrom; michael@0: michael@0: void passDictionary(optional Dict x); michael@0: [Cached, Pure] michael@0: readonly attribute Dict readonlyDictionary; michael@0: [Cached, Pure] michael@0: readonly attribute Dict? readonlyNullableDictionary; michael@0: [Cached, Pure] michael@0: attribute Dict writableDictionary; michael@0: [Cached, Pure, Frozen] michael@0: readonly attribute Dict readonlyFrozenDictionary; michael@0: [Cached, Pure, Frozen] michael@0: readonly attribute Dict? readonlyFrozenNullableDictionary; michael@0: [Cached, Pure, Frozen] michael@0: attribute Dict writableFrozenDictionary; michael@0: Dict receiveDictionary(); michael@0: Dict? receiveNullableDictionary(); michael@0: void passOtherDictionary(optional GrandparentDict x); michael@0: void passSequenceOfDictionaries(sequence x); michael@0: void passMozMapOfDictionaries(MozMap x); michael@0: // No support for nullable dictionaries inside a sequence (nor should there be) michael@0: // void passSequenceOfNullableDictionaries(sequence x); michael@0: void passDictionaryOrLong(optional Dict x); michael@0: void passDictionaryOrLong(long x); michael@0: michael@0: void passDictContainingDict(optional DictContainingDict arg); michael@0: void passDictContainingSequence(optional DictContainingSequence arg); michael@0: DictContainingSequence receiveDictContainingSequence(); michael@0: michael@0: // EnforceRange/Clamp tests michael@0: void dontEnforceRangeOrClamp(byte arg); michael@0: void doEnforceRange([EnforceRange] byte arg); michael@0: void doClamp([Clamp] byte arg); michael@0: [EnforceRange] attribute byte enforcedByte; michael@0: [Clamp] attribute byte clampedByte; michael@0: michael@0: // Typedefs michael@0: const myLong myLongConstant = 5; michael@0: void exerciseTypedefInterfaces1(AnotherNameForTestJSImplInterface arg); michael@0: AnotherNameForTestJSImplInterface exerciseTypedefInterfaces2(NullableTestJSImplInterface arg); michael@0: void exerciseTypedefInterfaces3(YetAnotherNameForTestJSImplInterface arg); michael@0: michael@0: // Static methods and attributes michael@0: // FIXME: Bug 863952 Static things are not supported yet michael@0: /* michael@0: static attribute boolean staticAttribute; michael@0: static void staticMethod(boolean arg); michael@0: static void staticMethodWithContext(any arg); michael@0: */ michael@0: michael@0: // Overload resolution tests michael@0: //void overload1(DOMString... strs); michael@0: boolean overload1(TestJSImplInterface arg); michael@0: TestJSImplInterface overload1(DOMString strs, TestJSImplInterface arg); michael@0: void overload2(TestJSImplInterface arg); michael@0: void overload2(optional Dict arg); michael@0: void overload2(boolean arg); michael@0: void overload2(DOMString arg); michael@0: void overload2(Date arg); michael@0: void overload3(TestJSImplInterface arg); michael@0: void overload3(MyTestCallback arg); michael@0: void overload3(boolean arg); michael@0: void overload4(TestJSImplInterface arg); michael@0: void overload4(TestCallbackInterface arg); michael@0: void overload4(DOMString arg); michael@0: void overload5(long arg); michael@0: void overload5(MyTestEnum arg); michael@0: void overload6(long arg); michael@0: void overload6(boolean arg); michael@0: void overload7(long arg); michael@0: void overload7(boolean arg); michael@0: void overload7(ByteString arg); michael@0: void overload8(long arg); michael@0: void overload8(TestJSImplInterface arg); michael@0: void overload9(long? arg); michael@0: void overload9(DOMString arg); michael@0: void overload10(long? arg); michael@0: void overload10(object arg); michael@0: void overload11(long arg); michael@0: void overload11(DOMString? arg); michael@0: void overload12(long arg); michael@0: void overload12(boolean? arg); michael@0: void overload13(long? arg); michael@0: void overload13(boolean arg); michael@0: void overload14(optional long arg); michael@0: void overload14(TestInterface arg); michael@0: void overload15(long arg); michael@0: void overload15(optional TestInterface arg); michael@0: void overload16(long arg); michael@0: void overload16(optional TestInterface? arg); michael@0: michael@0: // Variadic handling michael@0: void passVariadicThirdArg(DOMString arg1, long arg2, TestJSImplInterface... arg3); michael@0: michael@0: // Conditionally exposed methods/attributes michael@0: [Pref="abc.def"] michael@0: readonly attribute boolean prefable1; michael@0: [Pref="abc.def"] michael@0: readonly attribute boolean prefable2; michael@0: [Pref="ghi.jkl"] michael@0: readonly attribute boolean prefable3; michael@0: [Pref="ghi.jkl"] michael@0: readonly attribute boolean prefable4; michael@0: [Pref="abc.def"] michael@0: readonly attribute boolean prefable5; michael@0: [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] michael@0: readonly attribute boolean prefable6; michael@0: [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] michael@0: readonly attribute boolean prefable7; michael@0: [Pref="ghi.jkl", Func="nsGenericHTMLElement::TouchEventsEnabled"] michael@0: readonly attribute boolean prefable8; michael@0: [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] michael@0: readonly attribute boolean prefable9; michael@0: [Pref="abc.def"] michael@0: void prefable10(); michael@0: [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] michael@0: void prefable11(); michael@0: [Pref="abc.def", Func="TestFuncControlledMember"] michael@0: readonly attribute boolean prefable12; michael@0: [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"] michael@0: void prefable13(); michael@0: [Pref="abc.def", Func="TestFuncControlledMember"] michael@0: readonly attribute boolean prefable14; michael@0: [Func="TestFuncControlledMember"] michael@0: readonly attribute boolean prefable15; michael@0: [Func="TestFuncControlledMember"] michael@0: readonly attribute boolean prefable16; michael@0: [Pref="abc.def", Func="TestFuncControlledMember"] michael@0: void prefable17(); michael@0: [Func="TestFuncControlledMember"] michael@0: void prefable18(); michael@0: [Func="TestFuncControlledMember"] michael@0: void prefable19(); michael@0: [Pref="abc.def", Func="TestFuncControlledMember", ChromeOnly] michael@0: void prefable20(); michael@0: [Func="TestFuncControlledMember", AvailableIn=CertifiedApps] michael@0: void prefable21(); michael@0: [Func="TestFuncControlledMember", AvailableIn=CertifiedApps] michael@0: void prefable22(); michael@0: [Pref="abc.def", Func="TestFuncControlledMember", AvailableIn=CertifiedApps] michael@0: void prefable23(); michael@0: [Pref="abc.def", Func="TestFuncControlledMember", AvailableIn=PrivilegedApps] michael@0: void prefable24(); michael@0: michael@0: // Miscellania michael@0: [LenientThis] attribute long attrWithLenientThis; michael@0: // FIXME: Bug 863954 Unforgeable things get all confused when michael@0: // non-JS-implemented interfaces inherit from JS-implemented ones or vice michael@0: // versa. michael@0: // [Unforgeable] readonly attribute long unforgeableAttr; michael@0: // [Unforgeable, ChromeOnly] readonly attribute long unforgeableAttr2; michael@0: // FIXME: Bug 863955 No stringifiers yet michael@0: // stringifier; michael@0: void passRenamedInterface(TestRenamedInterface arg); michael@0: [PutForwards=writableByte] readonly attribute TestJSImplInterface putForwardsAttr; michael@0: [PutForwards=writableByte, LenientThis] readonly attribute TestJSImplInterface putForwardsAttr2; michael@0: [PutForwards=writableByte, ChromeOnly] readonly attribute TestJSImplInterface putForwardsAttr3; michael@0: [Throws] void throwingMethod(); michael@0: [Throws] attribute boolean throwingAttr; michael@0: [GetterThrows] attribute boolean throwingGetterAttr; michael@0: [SetterThrows] attribute boolean throwingSetterAttr; michael@0: // legacycaller short(unsigned long arg1, TestInterface arg2); michael@0: void passArgsWithDefaults(optional long arg1, michael@0: optional TestInterface? arg2 = null, michael@0: optional Dict arg3, optional double arg4 = 5.0, michael@0: optional float arg5); michael@0: attribute any jsonifierShouldSkipThis; michael@0: attribute TestParentInterface jsonifierShouldSkipThis2; michael@0: attribute TestCallbackInterface jsonifierShouldSkipThis3; michael@0: jsonifier; michael@0: michael@0: // If you add things here, add them to TestCodeGen as well michael@0: }; michael@0: michael@0: [NavigatorProperty="TestNavigator", JSImplementation="@mozilla.org/test;1"] michael@0: interface TestNavigator { michael@0: }; michael@0: michael@0: [Constructor, NavigatorProperty="TestNavigatorWithConstructor", JSImplementation="@mozilla.org/test;1"] michael@0: interface TestNavigatorWithConstructor { michael@0: }; michael@0: michael@0: interface TestCImplementedInterface : TestJSImplInterface { michael@0: }; michael@0: michael@0: interface TestCImplementedInterface2 { michael@0: };