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/.
7 dictionary TestInterfaceJSUnionableDictionary {
12 [JSImplementation="@mozilla.org/dom/test-interface-js;1",
13 Pref="dom.expose_test_interfaces",
15 interface TestInterfaceJS : EventTarget {
17 constructor(optional any anyArg, optional object objectArg,
18 optional TestInterfaceJSDictionary dictionaryArg = {});
20 readonly attribute any anyArg;
21 readonly attribute object objectArg;
22 TestInterfaceJSDictionary getDictionaryArg();
23 attribute any anyAttr;
24 attribute object objectAttr;
25 TestInterfaceJSDictionary getDictionaryAttr();
26 undefined setDictionaryAttr(optional TestInterfaceJSDictionary dict = {});
27 any pingPongAny(any arg);
28 object pingPongObject(object obj);
29 any pingPongObjectOrString((object or DOMString) objOrString);
30 TestInterfaceJSDictionary pingPongDictionary(optional TestInterfaceJSDictionary dict = {});
31 long pingPongDictionaryOrLong(optional (TestInterfaceJSUnionableDictionary or long) dictOrLong = {});
32 DOMString pingPongRecord(record<DOMString, any> rec);
33 long objectSequenceLength(sequence<object> seq);
34 long anySequenceLength(sequence<any> seq);
36 // For testing bug 968335.
37 DOMString getCallerPrincipal();
39 DOMString convertSVS(USVString svs);
41 (TestInterfaceJS or long) pingPongUnion((TestInterfaceJS or long) something);
42 (DOMString or TestInterfaceJS?) pingPongUnionContainingNull((TestInterfaceJS? or DOMString) something);
43 (TestInterfaceJS or long)? pingPongNullableUnion((TestInterfaceJS or long)? something);
44 (Location or TestInterfaceJS) returnBadUnion();
46 // Test for sequence overloading and union behavior
47 undefined testSequenceOverload(sequence<DOMString> arg);
48 undefined testSequenceOverload(DOMString arg);
50 undefined testSequenceUnion((sequence<DOMString> or DOMString) arg);
52 // Tests for exception-throwing behavior
54 undefined testThrowError();
57 undefined testThrowDOMException();
60 undefined testThrowTypeError();
63 undefined testThrowCallbackError(Function callback);
66 undefined testThrowXraySelfHosted();
69 undefined testThrowSelfHosted();
71 // Tests for promise-rejection behavior
72 Promise<undefined> testPromiseWithThrowingChromePromiseInit();
73 Promise<undefined> testPromiseWithThrowingContentPromiseInit(Function func);
74 Promise<undefined> testPromiseWithDOMExceptionThrowingPromiseInit();
75 Promise<undefined> testPromiseWithThrowingChromeThenFunction();
76 Promise<undefined> testPromiseWithThrowingContentThenFunction(AnyCallback func);
77 Promise<undefined> testPromiseWithDOMExceptionThrowingThenFunction();
78 Promise<undefined> testPromiseWithThrowingChromeThenable();
79 Promise<undefined> testPromiseWithThrowingContentThenable(object thenable);
80 Promise<undefined> testPromiseWithDOMExceptionThrowingThenable();
82 // Event handler tests
83 attribute EventHandler onsomething;