1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/.
5 * You are granted a license to use, reproduce and create derivative works of
8 * This IDL file is related to the WebExtensions API object only used in
11 * More info about generating webidl API bindings for WebExtensions API at:
13 * https://firefox-source-docs.mozilla.org/toolkit/components/extensions/webextensions/webidl_bindings.html
15 * A short summary of the special setup used by these WebIDL files (meant to aid
16 * webidl peers reviews and sign-offs) is available in the following section:
18 * https://firefox-source-docs.mozilla.org/toolkit/components/extensions/webextensions/webidl_bindings.html#review-process-on-changes-to-webidl-definitions
21 // WebIDL definition for the "mockExtensionAPI" WebExtensions API,
22 // only available in tests and locked behind an about:config preference
23 // ("extensions.webidl-api.expose_mock_interface").
24 [Exposed=(ServiceWorker), LegacyNoInterfaceObject]
25 interface ExtensionMockAPI {
26 // Test API methods scenarios.
28 [Throws, WebExtensionStub]
29 any methodSyncWithReturn(any... args);
31 [Throws, WebExtensionStub="NoReturn"]
32 undefined methodNoReturn(any... args);
34 [Throws, WebExtensionStub="Async"]
35 any methodAsync(any arg0, optional Function cb);
37 [Throws, WebExtensionStub="AsyncAmbiguous"]
38 any methodAmbiguousArgsAsync(any... args);
40 [Throws, WebExtensionStub="ReturnsPort"]
41 ExtensionPort methodReturnsPort(DOMString testName);
43 // Test API properties.
46 readonly attribute any propertyAsErrorObject;
49 readonly attribute DOMString propertyAsString;
53 [Replaceable, SameObject]
54 readonly attribute ExtensionEventManager onTestEvent;