dom/bindings/test/TestJSImplGen.webidl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/bindings/test/TestJSImplGen.webidl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,704 @@
     1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 + */
     1.9 +
    1.10 +typedef TestJSImplInterface AnotherNameForTestJSImplInterface;
    1.11 +typedef TestJSImplInterface YetAnotherNameForTestJSImplInterface;
    1.12 +typedef TestJSImplInterface? NullableTestJSImplInterface;
    1.13 +
    1.14 +callback MyTestCallback = void();
    1.15 +
    1.16 +TestInterface implements ImplementedInterface;
    1.17 +
    1.18 +enum MyTestEnum {
    1.19 +  "a",
    1.20 +  "b"
    1.21 +};
    1.22 +
    1.23 +// We don't support multiple constructors (bug 869268) or named constructors
    1.24 +// for JS-implemented WebIDL.
    1.25 +[Constructor(DOMString str, unsigned long num, boolean? boolArg,
    1.26 +             TestInterface? iface, long arg1,
    1.27 +             DictForConstructor dict, any any1,
    1.28 +             object obj1,
    1.29 +             object? obj2, sequence<Dict> seq, optional any any2,
    1.30 +             optional object obj3,
    1.31 +             optional object? obj4),
    1.32 + JSImplementation="@mozilla.org/test-js-impl-interface;1"]
    1.33 +interface TestJSImplInterface {
    1.34 +  // Integer types
    1.35 +  // XXXbz add tests for throwing versions of all the integer stuff
    1.36 +  readonly attribute byte readonlyByte;
    1.37 +  attribute byte writableByte;
    1.38 +  void passByte(byte arg);
    1.39 +  byte receiveByte();
    1.40 +  void passOptionalByte(optional byte arg);
    1.41 +  void passOptionalByteBeforeRequired(optional byte arg1, byte arg2);
    1.42 +  void passOptionalByteWithDefault(optional byte arg = 0);
    1.43 +  void passOptionalByteWithDefaultBeforeRequired(optional byte arg1 = 0, byte arg2);
    1.44 +  void passNullableByte(byte? arg);
    1.45 +  void passOptionalNullableByte(optional byte? arg);
    1.46 +  void passVariadicByte(byte... arg);
    1.47 +  [Cached, Pure]
    1.48 +  readonly attribute byte cachedByte;
    1.49 +  [Cached, Constant]
    1.50 +  readonly attribute byte cachedConstantByte;
    1.51 +  [Cached, Pure]
    1.52 +  attribute byte cachedWritableByte;
    1.53 +
    1.54 +  readonly attribute short readonlyShort;
    1.55 +  attribute short writableShort;
    1.56 +  void passShort(short arg);
    1.57 +  short receiveShort();
    1.58 +  void passOptionalShort(optional short arg);
    1.59 +  void passOptionalShortWithDefault(optional short arg = 5);
    1.60 +
    1.61 +  readonly attribute long readonlyLong;
    1.62 +  attribute long writableLong;
    1.63 +  void passLong(long arg);
    1.64 +  long receiveLong();
    1.65 +  void passOptionalLong(optional long arg);
    1.66 +  void passOptionalLongWithDefault(optional long arg = 7);
    1.67 +
    1.68 +  readonly attribute long long readonlyLongLong;
    1.69 +  attribute long long writableLongLong;
    1.70 +  void passLongLong(long long arg);
    1.71 +  long long receiveLongLong();
    1.72 +  void passOptionalLongLong(optional long long arg);
    1.73 +  void passOptionalLongLongWithDefault(optional long long arg = -12);
    1.74 +
    1.75 +  readonly attribute octet readonlyOctet;
    1.76 +  attribute octet writableOctet;
    1.77 +  void passOctet(octet arg);
    1.78 +  octet receiveOctet();
    1.79 +  void passOptionalOctet(optional octet arg);
    1.80 +  void passOptionalOctetWithDefault(optional octet arg = 19);
    1.81 +
    1.82 +  readonly attribute unsigned short readonlyUnsignedShort;
    1.83 +  attribute unsigned short writableUnsignedShort;
    1.84 +  void passUnsignedShort(unsigned short arg);
    1.85 +  unsigned short receiveUnsignedShort();
    1.86 +  void passOptionalUnsignedShort(optional unsigned short arg);
    1.87 +  void passOptionalUnsignedShortWithDefault(optional unsigned short arg = 2);
    1.88 +
    1.89 +  readonly attribute unsigned long readonlyUnsignedLong;
    1.90 +  attribute unsigned long writableUnsignedLong;
    1.91 +  void passUnsignedLong(unsigned long arg);
    1.92 +  unsigned long receiveUnsignedLong();
    1.93 +  void passOptionalUnsignedLong(optional unsigned long arg);
    1.94 +  void passOptionalUnsignedLongWithDefault(optional unsigned long arg = 6);
    1.95 +
    1.96 +  readonly attribute unsigned long long readonlyUnsignedLongLong;
    1.97 +  attribute unsigned long long  writableUnsignedLongLong;
    1.98 +  void passUnsignedLongLong(unsigned long long arg);
    1.99 +  unsigned long long receiveUnsignedLongLong();
   1.100 +  void passOptionalUnsignedLongLong(optional unsigned long long arg);
   1.101 +  void passOptionalUnsignedLongLongWithDefault(optional unsigned long long arg = 17);
   1.102 +
   1.103 +  attribute float writableFloat;
   1.104 +  attribute unrestricted float writableUnrestrictedFloat;
   1.105 +  attribute float? writableNullableFloat;
   1.106 +  attribute unrestricted float? writableNullableUnrestrictedFloat;
   1.107 +  attribute double writableDouble;
   1.108 +  attribute unrestricted double writableUnrestrictedDouble;
   1.109 +  attribute double? writableNullableDouble;
   1.110 +  attribute unrestricted double? writableNullableUnrestrictedDouble;
   1.111 +  void passFloat(float arg1, unrestricted float arg2,
   1.112 +                 float? arg3, unrestricted float? arg4,
   1.113 +                 double arg5, unrestricted double arg6,
   1.114 +                 double? arg7, unrestricted double? arg8,
   1.115 +                 sequence<float> arg9, sequence<unrestricted float> arg10,
   1.116 +                 sequence<float?> arg11, sequence<unrestricted float?> arg12,
   1.117 +                 sequence<double> arg13, sequence<unrestricted double> arg14,
   1.118 +                 sequence<double?> arg15, sequence<unrestricted double?> arg16);
   1.119 +  [LenientFloat]
   1.120 +  void passLenientFloat(float arg1, unrestricted float arg2,
   1.121 +                        float? arg3, unrestricted float? arg4,
   1.122 +                        double arg5, unrestricted double arg6,
   1.123 +                        double? arg7, unrestricted double? arg8,
   1.124 +                        sequence<float> arg9,
   1.125 +                        sequence<unrestricted float> arg10,
   1.126 +                        sequence<float?> arg11,
   1.127 +                        sequence<unrestricted float?> arg12,
   1.128 +                        sequence<double> arg13,
   1.129 +                        sequence<unrestricted double> arg14,
   1.130 +                        sequence<double?> arg15,
   1.131 +                        sequence<unrestricted double?> arg16);
   1.132 +  [LenientFloat]
   1.133 +  attribute float lenientFloatAttr;
   1.134 +  [LenientFloat]
   1.135 +  attribute double lenientDoubleAttr;
   1.136 +
   1.137 +  // Castable interface types
   1.138 +  // XXXbz add tests for throwing versions of all the castable interface stuff
   1.139 +  TestJSImplInterface receiveSelf();
   1.140 +  TestJSImplInterface? receiveNullableSelf();
   1.141 +
   1.142 +  // Callback interface ignores 'resultNotAddRefed'. See bug 843272.
   1.143 +  //TestJSImplInterface receiveWeakSelf();
   1.144 +  //TestJSImplInterface? receiveWeakNullableSelf();
   1.145 +
   1.146 +  // A version to test for casting to TestJSImplInterface&
   1.147 +  void passSelf(TestJSImplInterface arg);
   1.148 +  void passNullableSelf(TestJSImplInterface? arg);
   1.149 +  attribute TestJSImplInterface nonNullSelf;
   1.150 +  attribute TestJSImplInterface? nullableSelf;
   1.151 +  [Cached, Pure]
   1.152 +  readonly attribute TestJSImplInterface cachedSelf;
   1.153 +  // Optional arguments
   1.154 +  void passOptionalSelf(optional TestJSImplInterface? arg);
   1.155 +  void passOptionalNonNullSelf(optional TestJSImplInterface arg);
   1.156 +  void passOptionalSelfWithDefault(optional TestJSImplInterface? arg = null);
   1.157 +
   1.158 +  // Non-wrapper-cache interface types
   1.159 +  [NewObject]
   1.160 +  TestNonWrapperCacheInterface receiveNonWrapperCacheInterface();
   1.161 +  [NewObject]
   1.162 +  TestNonWrapperCacheInterface? receiveNullableNonWrapperCacheInterface();
   1.163 +
   1.164 +  [NewObject]
   1.165 +  sequence<TestNonWrapperCacheInterface> receiveNonWrapperCacheInterfaceSequence();
   1.166 +  [NewObject]
   1.167 +  sequence<TestNonWrapperCacheInterface?> receiveNullableNonWrapperCacheInterfaceSequence();
   1.168 +  [NewObject]
   1.169 +  sequence<TestNonWrapperCacheInterface>? receiveNonWrapperCacheInterfaceNullableSequence();
   1.170 +  [NewObject]
   1.171 +  sequence<TestNonWrapperCacheInterface?>? receiveNullableNonWrapperCacheInterfaceNullableSequence();
   1.172 +
   1.173 +  // Non-castable interface types
   1.174 +  IndirectlyImplementedInterface receiveOther();
   1.175 +  IndirectlyImplementedInterface? receiveNullableOther();
   1.176 +  // Callback interface ignores 'resultNotAddRefed'. See bug 843272.
   1.177 +  //IndirectlyImplementedInterface receiveWeakOther();
   1.178 +  //IndirectlyImplementedInterface? receiveWeakNullableOther();
   1.179 +
   1.180 +  void passOther(IndirectlyImplementedInterface arg);
   1.181 +  void passNullableOther(IndirectlyImplementedInterface? arg);
   1.182 +  attribute IndirectlyImplementedInterface nonNullOther;
   1.183 +  attribute IndirectlyImplementedInterface? nullableOther;
   1.184 +  // Optional arguments
   1.185 +  void passOptionalOther(optional IndirectlyImplementedInterface? arg);
   1.186 +  void passOptionalNonNullOther(optional IndirectlyImplementedInterface arg);
   1.187 +  void passOptionalOtherWithDefault(optional IndirectlyImplementedInterface? arg = null);
   1.188 +
   1.189 +  // External interface types
   1.190 +  TestExternalInterface receiveExternal();
   1.191 +  TestExternalInterface? receiveNullableExternal();
   1.192 +  // Callback interface ignores 'resultNotAddRefed'. See bug 843272.
   1.193 +  //TestExternalInterface receiveWeakExternal();
   1.194 +  //TestExternalInterface? receiveWeakNullableExternal();
   1.195 +  void passExternal(TestExternalInterface arg);
   1.196 +  void passNullableExternal(TestExternalInterface? arg);
   1.197 +  attribute TestExternalInterface nonNullExternal;
   1.198 +  attribute TestExternalInterface? nullableExternal;
   1.199 +  // Optional arguments
   1.200 +  void passOptionalExternal(optional TestExternalInterface? arg);
   1.201 +  void passOptionalNonNullExternal(optional TestExternalInterface arg);
   1.202 +  void passOptionalExternalWithDefault(optional TestExternalInterface? arg = null);
   1.203 +
   1.204 +  // Callback interface types
   1.205 +  TestCallbackInterface receiveCallbackInterface();
   1.206 +  TestCallbackInterface? receiveNullableCallbackInterface();
   1.207 +  // Callback interface ignores 'resultNotAddRefed'. See bug 843272.
   1.208 +  //TestCallbackInterface receiveWeakCallbackInterface();
   1.209 +  //TestCallbackInterface? receiveWeakNullableCallbackInterface();
   1.210 +  void passCallbackInterface(TestCallbackInterface arg);
   1.211 +  void passNullableCallbackInterface(TestCallbackInterface? arg);
   1.212 +  attribute TestCallbackInterface nonNullCallbackInterface;
   1.213 +  attribute TestCallbackInterface? nullableCallbackInterface;
   1.214 +  // Optional arguments
   1.215 +  void passOptionalCallbackInterface(optional TestCallbackInterface? arg);
   1.216 +  void passOptionalNonNullCallbackInterface(optional TestCallbackInterface arg);
   1.217 +  void passOptionalCallbackInterfaceWithDefault(optional TestCallbackInterface? arg = null);
   1.218 +
   1.219 +  // Miscellaneous interface tests
   1.220 +  IndirectlyImplementedInterface receiveConsequentialInterface();
   1.221 +  void passConsequentialInterface(IndirectlyImplementedInterface arg);
   1.222 +
   1.223 +  // Sequence types
   1.224 +  [Cached, Pure]
   1.225 +  readonly attribute sequence<long> readonlySequence;
   1.226 +  [Cached, Pure]
   1.227 +  readonly attribute sequence<Dict> readonlySequenceOfDictionaries;
   1.228 +  [Cached, Pure]
   1.229 +  readonly attribute sequence<Dict>? readonlyNullableSequenceOfDictionaries;
   1.230 +  [Cached, Pure, Frozen]
   1.231 +  readonly attribute sequence<long> readonlyFrozenSequence;
   1.232 +  [Cached, Pure, Frozen]
   1.233 +  readonly attribute sequence<long>? readonlyFrozenNullableSequence;
   1.234 +  sequence<long> receiveSequence();
   1.235 +  sequence<long>? receiveNullableSequence();
   1.236 +  sequence<long?> receiveSequenceOfNullableInts();
   1.237 +  sequence<long?>? receiveNullableSequenceOfNullableInts();
   1.238 +  void passSequence(sequence<long> arg);
   1.239 +  void passNullableSequence(sequence<long>? arg);
   1.240 +  void passSequenceOfNullableInts(sequence<long?> arg);
   1.241 +  void passOptionalSequenceOfNullableInts(optional sequence<long?> arg);
   1.242 +  void passOptionalNullableSequenceOfNullableInts(optional sequence<long?>? arg);
   1.243 +  sequence<TestJSImplInterface> receiveCastableObjectSequence();
   1.244 +  sequence<TestCallbackInterface> receiveCallbackObjectSequence();
   1.245 +  sequence<TestJSImplInterface?> receiveNullableCastableObjectSequence();
   1.246 +  sequence<TestCallbackInterface?> receiveNullableCallbackObjectSequence();
   1.247 +  sequence<TestJSImplInterface>? receiveCastableObjectNullableSequence();
   1.248 +  sequence<TestJSImplInterface?>? receiveNullableCastableObjectNullableSequence();
   1.249 +  sequence<TestJSImplInterface> receiveWeakCastableObjectSequence();
   1.250 +  sequence<TestJSImplInterface?> receiveWeakNullableCastableObjectSequence();
   1.251 +  sequence<TestJSImplInterface>? receiveWeakCastableObjectNullableSequence();
   1.252 +  sequence<TestJSImplInterface?>? receiveWeakNullableCastableObjectNullableSequence();
   1.253 +  void passCastableObjectSequence(sequence<TestJSImplInterface> arg);
   1.254 +  void passNullableCastableObjectSequence(sequence<TestJSImplInterface?> arg);
   1.255 +  void passCastableObjectNullableSequence(sequence<TestJSImplInterface>? arg);
   1.256 +  void passNullableCastableObjectNullableSequence(sequence<TestJSImplInterface?>? arg);
   1.257 +  void passOptionalSequence(optional sequence<long> arg);
   1.258 +  void passOptionalNullableSequence(optional sequence<long>? arg);
   1.259 +  void passOptionalNullableSequenceWithDefaultValue(optional sequence<long>? arg = null);
   1.260 +  void passOptionalObjectSequence(optional sequence<TestJSImplInterface> arg);
   1.261 +  void passExternalInterfaceSequence(sequence<TestExternalInterface> arg);
   1.262 +  void passNullableExternalInterfaceSequence(sequence<TestExternalInterface?> arg);
   1.263 +
   1.264 +  sequence<DOMString> receiveStringSequence();
   1.265 +  sequence<ByteString> receiveByteStringSequence();
   1.266 +  // Callback interface problem.  See bug 843261.
   1.267 +  //void passStringSequence(sequence<DOMString> arg);
   1.268 +  sequence<any> receiveAnySequence();
   1.269 +  sequence<any>? receiveNullableAnySequence();
   1.270 +  //XXXbz No support for sequence of sequence return values yet.
   1.271 +  //sequence<sequence<any>> receiveAnySequenceSequence();
   1.272 +
   1.273 +  sequence<object> receiveObjectSequence();
   1.274 +  sequence<object?> receiveNullableObjectSequence();
   1.275 +
   1.276 +  void passSequenceOfSequences(sequence<sequence<long>> arg);
   1.277 +  //XXXbz No support for sequence of sequence return values yet.
   1.278 +  //sequence<sequence<long>> receiveSequenceOfSequences();
   1.279 +
   1.280 +  // MozMap types
   1.281 +  void passMozMap(MozMap<long> arg);
   1.282 +  void passNullableMozMap(MozMap<long>? arg);
   1.283 +  void passMozMapOfNullableInts(MozMap<long?> arg);
   1.284 +  void passOptionalMozMapOfNullableInts(optional MozMap<long?> arg);
   1.285 +  void passOptionalNullableMozMapOfNullableInts(optional MozMap<long?>? arg);
   1.286 +  void passCastableObjectMozMap(MozMap<TestJSImplInterface> arg);
   1.287 +  void passNullableCastableObjectMozMap(MozMap<TestJSImplInterface?> arg);
   1.288 +  void passCastableObjectNullableMozMap(MozMap<TestJSImplInterface>? arg);
   1.289 +  void passNullableCastableObjectNullableMozMap(MozMap<TestJSImplInterface?>? arg);
   1.290 +  void passOptionalMozMap(optional MozMap<long> arg);
   1.291 +  void passOptionalNullableMozMap(optional MozMap<long>? arg);
   1.292 +  void passOptionalNullableMozMapWithDefaultValue(optional MozMap<long>? arg = null);
   1.293 +  void passOptionalObjectMozMap(optional MozMap<TestJSImplInterface> arg);
   1.294 +  void passExternalInterfaceMozMap(MozMap<TestExternalInterface> arg);
   1.295 +  void passNullableExternalInterfaceMozMap(MozMap<TestExternalInterface?> arg);
   1.296 +  void passStringMozMap(MozMap<DOMString> arg);
   1.297 +  void passByteStringMozMap(MozMap<ByteString> arg);
   1.298 +  void passMozMapOfMozMaps(MozMap<MozMap<long>> arg);
   1.299 +  MozMap<long> receiveMozMap();
   1.300 +  MozMap<long>? receiveNullableMozMap();
   1.301 +  MozMap<long?> receiveMozMapOfNullableInts();
   1.302 +  MozMap<long?>? receiveNullableMozMapOfNullableInts();
   1.303 +  //XXXbz No support for MozMap of MozMaps return values yet.
   1.304 +  //MozMap<MozMap<long>> receiveMozMapOfMozMaps();
   1.305 +  MozMap<any> receiveAnyMozMap();
   1.306 +
   1.307 +  // ArrayBuffer is handled differently in callback interfaces and the example generator.
   1.308 +  // Need to figure out what should be done there.  Seems like other typed array stuff is
   1.309 +  // similarly not working in the JS implemented generator.  Probably some other issues
   1.310 +  // here as well.
   1.311 +  // Typed array types
   1.312 +  //void passArrayBuffer(ArrayBuffer arg);
   1.313 +  //void passNullableArrayBuffer(ArrayBuffer? arg);
   1.314 +  //void passOptionalArrayBuffer(optional ArrayBuffer arg);
   1.315 +  //void passOptionalNullableArrayBuffer(optional ArrayBuffer? arg);
   1.316 +  //void passOptionalNullableArrayBufferWithDefaultValue(optional ArrayBuffer? arg= null);
   1.317 +  //void passArrayBufferView(ArrayBufferView arg);
   1.318 +  //void passInt8Array(Int8Array arg);
   1.319 +  //void passInt16Array(Int16Array arg);
   1.320 +  //void passInt32Array(Int32Array arg);
   1.321 +  //void passUint8Array(Uint8Array arg);
   1.322 +  //void passUint16Array(Uint16Array arg);
   1.323 +  //void passUint32Array(Uint32Array arg);
   1.324 +  //void passUint8ClampedArray(Uint8ClampedArray arg);
   1.325 +  //void passFloat32Array(Float32Array arg);
   1.326 +  //void passFloat64Array(Float64Array arg);
   1.327 +  //void passSequenceOfArrayBuffers(sequence<ArrayBuffer> arg);
   1.328 +  //void passSequenceOfNullableArrayBuffers(sequence<ArrayBuffer?> arg);
   1.329 +  //void passMozMapOfArrayBuffers(MozMap<ArrayBuffer> arg);
   1.330 +  //void passMozMapOfNullableArrayBuffers(MozMap<ArrayBuffer?> arg);
   1.331 +  //void passVariadicTypedArray(Float32Array... arg);
   1.332 +  //void passVariadicNullableTypedArray(Float32Array?... arg);
   1.333 +  //Uint8Array receiveUint8Array();
   1.334 +
   1.335 +  // DOMString types
   1.336 +  void passString(DOMString arg);
   1.337 +  void passNullableString(DOMString? arg);
   1.338 +  void passOptionalString(optional DOMString arg);
   1.339 +  void passOptionalStringWithDefaultValue(optional DOMString arg = "abc");
   1.340 +  void passOptionalNullableString(optional DOMString? arg);
   1.341 +  void passOptionalNullableStringWithDefaultValue(optional DOMString? arg = null);
   1.342 +  void passVariadicString(DOMString... arg);
   1.343 +
   1.344 +  // ByteString types
   1.345 +  void passByteString(ByteString arg);
   1.346 +  void passNullableByteString(ByteString? arg);
   1.347 +  void passOptionalByteString(optional ByteString arg);
   1.348 +  void passOptionalNullableByteString(optional ByteString? arg);
   1.349 +  void passVariadicByteString(ByteString... arg);
   1.350 +
   1.351 +  // Enumerated types
   1.352 +  void passEnum(MyTestEnum arg);
   1.353 +  void passNullableEnum(MyTestEnum? arg);
   1.354 +  void passOptionalEnum(optional MyTestEnum arg);
   1.355 +  void passEnumWithDefault(optional MyTestEnum arg = "a");
   1.356 +  void passOptionalNullableEnum(optional MyTestEnum? arg);
   1.357 +  void passOptionalNullableEnumWithDefaultValue(optional MyTestEnum? arg = null);
   1.358 +  void passOptionalNullableEnumWithDefaultValue2(optional MyTestEnum? arg = "a");
   1.359 +  MyTestEnum receiveEnum();
   1.360 +  MyTestEnum? receiveNullableEnum();
   1.361 +  attribute MyTestEnum enumAttribute;
   1.362 +  readonly attribute MyTestEnum readonlyEnumAttribute;
   1.363 +
   1.364 +  // Callback types
   1.365 +  void passCallback(MyTestCallback arg);
   1.366 +  void passNullableCallback(MyTestCallback? arg);
   1.367 +  void passOptionalCallback(optional MyTestCallback arg);
   1.368 +  void passOptionalNullableCallback(optional MyTestCallback? arg);
   1.369 +  void passOptionalNullableCallbackWithDefaultValue(optional MyTestCallback? arg = null);
   1.370 +  MyTestCallback receiveCallback();
   1.371 +  MyTestCallback? receiveNullableCallback();
   1.372 +  // Hmm. These two don't work, I think because I need a locally modified version of TestTreatAsNullCallback.
   1.373 +  //void passNullableTreatAsNullCallback(TestTreatAsNullCallback? arg);
   1.374 +  //void passOptionalNullableTreatAsNullCallback(optional TestTreatAsNullCallback? arg);
   1.375 +  void passOptionalNullableTreatAsNullCallbackWithDefaultValue(optional TestTreatAsNullCallback? arg = null);
   1.376 +
   1.377 +  // Any types
   1.378 +  void passAny(any arg);
   1.379 +  void passVariadicAny(any... arg);
   1.380 +  void passOptionalAny(optional any arg);
   1.381 +  void passAnyDefaultNull(optional any arg = null);
   1.382 +  void passSequenceOfAny(sequence<any> arg);
   1.383 +  void passNullableSequenceOfAny(sequence<any>? arg);
   1.384 +  void passOptionalSequenceOfAny(optional sequence<any> arg);
   1.385 +  void passOptionalNullableSequenceOfAny(optional sequence<any>? arg);
   1.386 +  void passOptionalSequenceOfAnyWithDefaultValue(optional sequence<any>? arg = null);
   1.387 +  void passSequenceOfSequenceOfAny(sequence<sequence<any>> arg);
   1.388 +  void passSequenceOfNullableSequenceOfAny(sequence<sequence<any>?> arg);
   1.389 +  void passNullableSequenceOfNullableSequenceOfAny(sequence<sequence<any>?>? arg);
   1.390 +  void passOptionalNullableSequenceOfNullableSequenceOfAny(optional sequence<sequence<any>?>? arg);
   1.391 +  void passMozMapOfAny(MozMap<any> arg);
   1.392 +  void passNullableMozMapOfAny(MozMap<any>? arg);
   1.393 +  void passOptionalMozMapOfAny(optional MozMap<any> arg);
   1.394 +  void passOptionalNullableMozMapOfAny(optional MozMap<any>? arg);
   1.395 +  void passOptionalMozMapOfAnyWithDefaultValue(optional MozMap<any>? arg = null);
   1.396 +  void passMozMapOfMozMapOfAny(MozMap<MozMap<any>> arg);
   1.397 +  void passMozMapOfNullableMozMapOfAny(MozMap<MozMap<any>?> arg);
   1.398 +  void passNullableMozMapOfNullableMozMapOfAny(MozMap<MozMap<any>?>? arg);
   1.399 +  void passOptionalNullableMozMapOfNullableMozMapOfAny(optional MozMap<MozMap<any>?>? arg);
   1.400 +  void passOptionalNullableMozMapOfNullableSequenceOfAny(optional MozMap<sequence<any>?>? arg);
   1.401 +  void passOptionalNullableSequenceOfNullableMozMapOfAny(optional sequence<MozMap<any>?>? arg);
   1.402 +  any receiveAny();
   1.403 +
   1.404 +  // object types
   1.405 +  void passObject(object arg);
   1.406 +  void passVariadicObject(object... arg);
   1.407 +  void passNullableObject(object? arg);
   1.408 +  void passVariadicNullableObject(object... arg);
   1.409 +  void passOptionalObject(optional object arg);
   1.410 +  void passOptionalNullableObject(optional object? arg);
   1.411 +  void passOptionalNullableObjectWithDefaultValue(optional object? arg = null);
   1.412 +  void passSequenceOfObject(sequence<object> arg);
   1.413 +  void passSequenceOfNullableObject(sequence<object?> arg);
   1.414 +  void passNullableSequenceOfObject(sequence<object>? arg);
   1.415 +  void passOptionalNullableSequenceOfNullableSequenceOfObject(optional sequence<sequence<object>?>? arg);
   1.416 +  void passOptionalNullableSequenceOfNullableSequenceOfNullableObject(optional sequence<sequence<object?>?>? arg);
   1.417 +  void passMozMapOfObject(MozMap<object> arg);
   1.418 +  object receiveObject();
   1.419 +  object? receiveNullableObject();
   1.420 +
   1.421 +  // Union types
   1.422 +  void passUnion((object or long) arg);
   1.423 +  // Some union tests are debug-only to avoid creating all those
   1.424 +  // unused union types in opt builds.
   1.425 +#ifdef DEBUG
   1.426 +  void passUnion2((long or boolean) arg);
   1.427 +  void passUnion3((object or long or boolean) arg);
   1.428 +  void passUnion4((Node or long or boolean) arg);
   1.429 +  void passUnion5((object or boolean) arg);
   1.430 +  void passUnion6((object or DOMString) arg);
   1.431 +  void passUnion7((object or DOMString or long) arg);
   1.432 +  void passUnion8((object or DOMString or boolean) arg);
   1.433 +  void passUnion9((object or DOMString or long or boolean) arg);
   1.434 +  void passUnion10(optional (EventInit or long) arg);
   1.435 +  void passUnion11(optional (CustomEventInit or long) arg);
   1.436 +  void passUnion12(optional (EventInit or long) arg = 5);
   1.437 +  void passUnion13(optional (object or long?) arg = null);
   1.438 +  void passUnion14(optional (object or long?) arg = 5);
   1.439 +  void passUnionWithCallback((EventHandler or long) arg);
   1.440 +#endif
   1.441 +  void passUnionWithNullable((object? or long) arg);
   1.442 +  void passNullableUnion((object or long)? arg);
   1.443 +  void passOptionalUnion(optional (object or long) arg);
   1.444 +  void passOptionalNullableUnion(optional (object or long)? arg);
   1.445 +  void passOptionalNullableUnionWithDefaultValue(optional (object or long)? arg = null);
   1.446 +  //void passUnionWithInterfaces((TestJSImplInterface or TestExternalInterface) arg);
   1.447 +  //void passUnionWithInterfacesAndNullable((TestJSImplInterface? or TestExternalInterface) arg);
   1.448 +  //void passUnionWithSequence((sequence<object> or long) arg);
   1.449 +  void passUnionWithArrayBuffer((ArrayBuffer or long) arg);
   1.450 +  void passUnionWithString((DOMString or object) arg);
   1.451 +  //void passUnionWithEnum((MyTestEnum or object) arg);
   1.452 +  // Trying to use a callback in a union won't include the test
   1.453 +  // headers, unfortunately, so won't compile.
   1.454 +  //  void passUnionWithCallback((MyTestCallback or long) arg);
   1.455 +  void passUnionWithObject((object or long) arg);
   1.456 +  //void passUnionWithDict((Dict or long) arg);
   1.457 +
   1.458 +  void passUnionWithDefaultValue1(optional (double or DOMString) arg = "");
   1.459 +  void passUnionWithDefaultValue2(optional (double or DOMString) arg = 1);
   1.460 +  void passUnionWithDefaultValue3(optional (double or DOMString) arg = 1.5);
   1.461 +  void passUnionWithDefaultValue4(optional (float or DOMString) arg = "");
   1.462 +  void passUnionWithDefaultValue5(optional (float or DOMString) arg = 1);
   1.463 +  void passUnionWithDefaultValue6(optional (float or DOMString) arg = 1.5);
   1.464 +  void passUnionWithDefaultValue7(optional (unrestricted double or DOMString) arg = "");
   1.465 +  void passUnionWithDefaultValue8(optional (unrestricted double or DOMString) arg = 1);
   1.466 +  void passUnionWithDefaultValue9(optional (unrestricted double or DOMString) arg = 1.5);
   1.467 +  void passUnionWithDefaultValue10(optional (unrestricted double or DOMString) arg = Infinity);
   1.468 +  void passUnionWithDefaultValue11(optional (unrestricted float or DOMString) arg = "");
   1.469 +  void passUnionWithDefaultValue12(optional (unrestricted float or DOMString) arg = 1);
   1.470 +  void passUnionWithDefaultValue13(optional (unrestricted float or DOMString) arg = Infinity);
   1.471 +
   1.472 +  void passNullableUnionWithDefaultValue1(optional (double or DOMString)? arg = "");
   1.473 +  void passNullableUnionWithDefaultValue2(optional (double or DOMString)? arg = 1);
   1.474 +  void passNullableUnionWithDefaultValue3(optional (double or DOMString)? arg = null);
   1.475 +  void passNullableUnionWithDefaultValue4(optional (float or DOMString)? arg = "");
   1.476 +  void passNullableUnionWithDefaultValue5(optional (float or DOMString)? arg = 1);
   1.477 +  void passNullableUnionWithDefaultValue6(optional (float or DOMString)? arg = null);
   1.478 +  void passNullableUnionWithDefaultValue7(optional (unrestricted double or DOMString)? arg = "");
   1.479 +  void passNullableUnionWithDefaultValue8(optional (unrestricted double or DOMString)? arg = 1);
   1.480 +  void passNullableUnionWithDefaultValue9(optional (unrestricted double or DOMString)? arg = null);
   1.481 +  void passNullableUnionWithDefaultValue10(optional (unrestricted float or DOMString)? arg = "");
   1.482 +  void passNullableUnionWithDefaultValue11(optional (unrestricted float or DOMString)? arg = 1);
   1.483 +  void passNullableUnionWithDefaultValue12(optional (unrestricted float or DOMString)? arg = null);
   1.484 +
   1.485 +  void passSequenceOfUnions(sequence<(CanvasPattern or CanvasGradient)> arg);
   1.486 +  void passSequenceOfUnions2(sequence<(object or long)> arg);
   1.487 +  void passVariadicUnion((CanvasPattern or CanvasGradient)... arg);
   1.488 +
   1.489 +  void passSequenceOfNullableUnions(sequence<(CanvasPattern or CanvasGradient)?> arg);
   1.490 +  void passVariadicNullableUnion((CanvasPattern or CanvasGradient)?... arg);
   1.491 +  void passMozMapOfUnions(MozMap<(CanvasPattern or CanvasGradient)> arg);
   1.492 +  // XXXbz no move constructor on some unions
   1.493 +  // void passMozMapOfUnions2(MozMap<(object or long)> arg);
   1.494 +
   1.495 +  //(CanvasPattern or CanvasGradient) receiveUnion();
   1.496 +  //(object or long) receiveUnion2();
   1.497 +  //(CanvasPattern? or CanvasGradient) receiveUnionContainingNull();
   1.498 +  //(CanvasPattern or CanvasGradient)? receiveNullableUnion();
   1.499 +  //(object or long)? receiveNullableUnion2();
   1.500 +
   1.501 +  //attribute (CanvasPattern or CanvasGradient) writableUnion;
   1.502 +  //attribute (CanvasPattern? or CanvasGradient) writableUnionContainingNull;
   1.503 +  //attribute (CanvasPattern or CanvasGradient)? writableNullableUnion;
   1.504 +
   1.505 +  // Date types
   1.506 +  void passDate(Date arg);
   1.507 +  void passNullableDate(Date? arg);
   1.508 +  void passOptionalDate(optional Date arg);
   1.509 +  void passOptionalNullableDate(optional Date? arg);
   1.510 +  void passOptionalNullableDateWithDefaultValue(optional Date? arg = null);
   1.511 +  void passDateSequence(sequence<Date> arg);
   1.512 +  void passNullableDateSequence(sequence<Date?> arg);
   1.513 +  void passDateMozMap(MozMap<Date> arg);
   1.514 +  Date receiveDate();
   1.515 +  Date? receiveNullableDate();
   1.516 +
   1.517 +  // binaryNames tests
   1.518 +  void methodRenamedFrom();
   1.519 +  void methodRenamedFrom(byte argument);
   1.520 +  readonly attribute byte attributeGetterRenamedFrom;
   1.521 +  attribute byte attributeRenamedFrom;
   1.522 +
   1.523 +  void passDictionary(optional Dict x);
   1.524 +  [Cached, Pure]
   1.525 +  readonly attribute Dict readonlyDictionary;
   1.526 +  [Cached, Pure]
   1.527 +  readonly attribute Dict? readonlyNullableDictionary;
   1.528 +  [Cached, Pure]
   1.529 +  attribute Dict writableDictionary;
   1.530 +  [Cached, Pure, Frozen]
   1.531 +  readonly attribute Dict readonlyFrozenDictionary;
   1.532 +  [Cached, Pure, Frozen]
   1.533 +  readonly attribute Dict? readonlyFrozenNullableDictionary;
   1.534 +  [Cached, Pure, Frozen]
   1.535 +  attribute Dict writableFrozenDictionary;
   1.536 +  Dict receiveDictionary();
   1.537 +  Dict? receiveNullableDictionary();
   1.538 +  void passOtherDictionary(optional GrandparentDict x);
   1.539 +  void passSequenceOfDictionaries(sequence<Dict> x);
   1.540 +  void passMozMapOfDictionaries(MozMap<GrandparentDict> x);
   1.541 +  // No support for nullable dictionaries inside a sequence (nor should there be)
   1.542 +  //  void passSequenceOfNullableDictionaries(sequence<Dict?> x);
   1.543 +  void passDictionaryOrLong(optional Dict x);
   1.544 +  void passDictionaryOrLong(long x);
   1.545 +
   1.546 +  void passDictContainingDict(optional DictContainingDict arg);
   1.547 +  void passDictContainingSequence(optional DictContainingSequence arg);
   1.548 +  DictContainingSequence receiveDictContainingSequence();
   1.549 +
   1.550 +  // EnforceRange/Clamp tests
   1.551 +  void dontEnforceRangeOrClamp(byte arg);
   1.552 +  void doEnforceRange([EnforceRange] byte arg);
   1.553 +  void doClamp([Clamp] byte arg);
   1.554 +  [EnforceRange] attribute byte enforcedByte;
   1.555 +  [Clamp] attribute byte clampedByte;
   1.556 +
   1.557 +  // Typedefs
   1.558 +  const myLong myLongConstant = 5;
   1.559 +  void exerciseTypedefInterfaces1(AnotherNameForTestJSImplInterface arg);
   1.560 +  AnotherNameForTestJSImplInterface exerciseTypedefInterfaces2(NullableTestJSImplInterface arg);
   1.561 +  void exerciseTypedefInterfaces3(YetAnotherNameForTestJSImplInterface arg);
   1.562 +
   1.563 +  // Static methods and attributes
   1.564 +  // FIXME: Bug 863952 Static things are not supported yet
   1.565 +  /*
   1.566 +  static attribute boolean staticAttribute;
   1.567 +  static void staticMethod(boolean arg);
   1.568 +  static void staticMethodWithContext(any arg);
   1.569 +  */
   1.570 +
   1.571 +  // Overload resolution tests
   1.572 +  //void overload1(DOMString... strs);
   1.573 +  boolean overload1(TestJSImplInterface arg);
   1.574 +  TestJSImplInterface overload1(DOMString strs, TestJSImplInterface arg);
   1.575 +  void overload2(TestJSImplInterface arg);
   1.576 +  void overload2(optional Dict arg);
   1.577 +  void overload2(boolean arg);
   1.578 +  void overload2(DOMString arg);
   1.579 +  void overload2(Date arg);
   1.580 +  void overload3(TestJSImplInterface arg);
   1.581 +  void overload3(MyTestCallback arg);
   1.582 +  void overload3(boolean arg);
   1.583 +  void overload4(TestJSImplInterface arg);
   1.584 +  void overload4(TestCallbackInterface arg);
   1.585 +  void overload4(DOMString arg);
   1.586 +  void overload5(long arg);
   1.587 +  void overload5(MyTestEnum arg);
   1.588 +  void overload6(long arg);
   1.589 +  void overload6(boolean arg);
   1.590 +  void overload7(long arg);
   1.591 +  void overload7(boolean arg);
   1.592 +  void overload7(ByteString arg);
   1.593 +  void overload8(long arg);
   1.594 +  void overload8(TestJSImplInterface arg);
   1.595 +  void overload9(long? arg);
   1.596 +  void overload9(DOMString arg);
   1.597 +  void overload10(long? arg);
   1.598 +  void overload10(object arg);
   1.599 +  void overload11(long arg);
   1.600 +  void overload11(DOMString? arg);
   1.601 +  void overload12(long arg);
   1.602 +  void overload12(boolean? arg);
   1.603 +  void overload13(long? arg);
   1.604 +  void overload13(boolean arg);
   1.605 +  void overload14(optional long arg);
   1.606 +  void overload14(TestInterface arg);
   1.607 +  void overload15(long arg);
   1.608 +  void overload15(optional TestInterface arg);
   1.609 +  void overload16(long arg);
   1.610 +  void overload16(optional TestInterface? arg);
   1.611 +
   1.612 +  // Variadic handling
   1.613 +  void passVariadicThirdArg(DOMString arg1, long arg2, TestJSImplInterface... arg3);
   1.614 +
   1.615 +  // Conditionally exposed methods/attributes
   1.616 +  [Pref="abc.def"]
   1.617 +  readonly attribute boolean prefable1;
   1.618 +  [Pref="abc.def"]
   1.619 +  readonly attribute boolean prefable2;
   1.620 +  [Pref="ghi.jkl"]
   1.621 +  readonly attribute boolean prefable3;
   1.622 +  [Pref="ghi.jkl"]
   1.623 +  readonly attribute boolean prefable4;
   1.624 +  [Pref="abc.def"]
   1.625 +  readonly attribute boolean prefable5;
   1.626 +  [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"]
   1.627 +  readonly attribute boolean prefable6;
   1.628 +  [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"]
   1.629 +  readonly attribute boolean prefable7;
   1.630 +  [Pref="ghi.jkl", Func="nsGenericHTMLElement::TouchEventsEnabled"]
   1.631 +  readonly attribute boolean prefable8;
   1.632 +  [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"]
   1.633 +  readonly attribute boolean prefable9;
   1.634 +  [Pref="abc.def"]
   1.635 +  void prefable10();
   1.636 +  [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"]
   1.637 +  void prefable11();
   1.638 +  [Pref="abc.def", Func="TestFuncControlledMember"]
   1.639 +  readonly attribute boolean prefable12;
   1.640 +  [Pref="abc.def", Func="nsGenericHTMLElement::TouchEventsEnabled"]
   1.641 +  void prefable13();
   1.642 +  [Pref="abc.def", Func="TestFuncControlledMember"]
   1.643 +  readonly attribute boolean prefable14;
   1.644 +  [Func="TestFuncControlledMember"]
   1.645 +  readonly attribute boolean prefable15;
   1.646 +  [Func="TestFuncControlledMember"]
   1.647 +  readonly attribute boolean prefable16;
   1.648 +  [Pref="abc.def", Func="TestFuncControlledMember"]
   1.649 +  void prefable17();
   1.650 +  [Func="TestFuncControlledMember"]
   1.651 +  void prefable18();
   1.652 +  [Func="TestFuncControlledMember"]
   1.653 +  void prefable19();
   1.654 +  [Pref="abc.def", Func="TestFuncControlledMember", ChromeOnly]
   1.655 +  void prefable20();
   1.656 +  [Func="TestFuncControlledMember", AvailableIn=CertifiedApps]
   1.657 +  void prefable21();
   1.658 +  [Func="TestFuncControlledMember", AvailableIn=CertifiedApps]
   1.659 +  void prefable22();
   1.660 +  [Pref="abc.def", Func="TestFuncControlledMember", AvailableIn=CertifiedApps]
   1.661 +  void prefable23();
   1.662 +  [Pref="abc.def", Func="TestFuncControlledMember", AvailableIn=PrivilegedApps]
   1.663 +  void prefable24();
   1.664 +
   1.665 +  // Miscellania
   1.666 +  [LenientThis] attribute long attrWithLenientThis;
   1.667 +  // FIXME: Bug 863954 Unforgeable things get all confused when
   1.668 +  // non-JS-implemented interfaces inherit from JS-implemented ones or vice
   1.669 +  // versa.
   1.670 +  //   [Unforgeable] readonly attribute long unforgeableAttr;
   1.671 +  //   [Unforgeable, ChromeOnly] readonly attribute long unforgeableAttr2;
   1.672 +  // FIXME: Bug 863955 No stringifiers yet
   1.673 +  //   stringifier;
   1.674 +  void passRenamedInterface(TestRenamedInterface arg);
   1.675 +  [PutForwards=writableByte] readonly attribute TestJSImplInterface putForwardsAttr;
   1.676 +  [PutForwards=writableByte, LenientThis] readonly attribute TestJSImplInterface putForwardsAttr2;
   1.677 +  [PutForwards=writableByte, ChromeOnly] readonly attribute TestJSImplInterface putForwardsAttr3;
   1.678 +  [Throws] void throwingMethod();
   1.679 +  [Throws] attribute boolean throwingAttr;
   1.680 +  [GetterThrows] attribute boolean throwingGetterAttr;
   1.681 +  [SetterThrows] attribute boolean throwingSetterAttr;
   1.682 +  // legacycaller short(unsigned long arg1, TestInterface arg2);
   1.683 +  void passArgsWithDefaults(optional long arg1,
   1.684 +                            optional TestInterface? arg2 = null,
   1.685 +                            optional Dict arg3, optional double arg4 = 5.0,
   1.686 +                            optional float arg5);
   1.687 +  attribute any jsonifierShouldSkipThis;
   1.688 +  attribute TestParentInterface jsonifierShouldSkipThis2;
   1.689 +  attribute TestCallbackInterface jsonifierShouldSkipThis3;
   1.690 +  jsonifier;
   1.691 +
   1.692 +  // If you add things here, add them to TestCodeGen as well
   1.693 +};
   1.694 +
   1.695 +[NavigatorProperty="TestNavigator", JSImplementation="@mozilla.org/test;1"]
   1.696 +interface TestNavigator {
   1.697 +};
   1.698 +
   1.699 +[Constructor, NavigatorProperty="TestNavigatorWithConstructor", JSImplementation="@mozilla.org/test;1"]
   1.700 +interface TestNavigatorWithConstructor {
   1.701 +};
   1.702 +
   1.703 +interface TestCImplementedInterface : TestJSImplInterface {
   1.704 +};
   1.705 +
   1.706 +interface TestCImplementedInterface2 {
   1.707 +};

mercurial