Bug 1610775 [wpt PR 21336] - Update urllib3 to 1.25.8, a=testonly
[gecko.git] / dom / webidl / TestInterfaceJS.webidl
blob7bbb7f4e8d94242109adfe5089d378f964ebbb96
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 dictionary TestInterfaceJSUnionableDictionary {
8   object objectMember;
9   any anyMember;
12 [JSImplementation="@mozilla.org/dom/test-interface-js;1",
13  Pref="dom.expose_test_interfaces",
14  Exposed=Window]
15 interface TestInterfaceJS : EventTarget {
16   [Throws]
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   void 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   void testSequenceOverload(sequence<DOMString> arg);
48   void testSequenceOverload(DOMString arg);
50   void testSequenceUnion((sequence<DOMString> or DOMString) arg);
52   // Tests for exception-throwing behavior
53   [Throws]
54   void testThrowError();
56   [Throws]
57   void testThrowDOMException();
59   [Throws]
60   void testThrowTypeError();
62   [Throws]
63   void testThrowCallbackError(Function callback);
65   [Throws]
66   void testThrowXraySelfHosted();
68   [Throws]
69   void testThrowSelfHosted();
71   // Tests for promise-rejection behavior
72   Promise<void> testPromiseWithThrowingChromePromiseInit();
73   Promise<void> testPromiseWithThrowingContentPromiseInit(Function func);
74   Promise<void> testPromiseWithDOMExceptionThrowingPromiseInit();
75   Promise<void> testPromiseWithThrowingChromeThenFunction();
76   Promise<void> testPromiseWithThrowingContentThenFunction(AnyCallback func);
77   Promise<void> testPromiseWithDOMExceptionThrowingThenFunction();
78   Promise<void> testPromiseWithThrowingChromeThenable();
79   Promise<void> testPromiseWithThrowingContentThenable(object thenable);
80   Promise<void> testPromiseWithDOMExceptionThrowingThenable();
82   // Event handler tests
83   attribute EventHandler onsomething;