diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /toolkit/components/extensions/test/xpcshell/webidl-api | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/extensions/test/xpcshell/webidl-api')
6 files changed, 23 insertions, 23 deletions
diff --git a/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api.js b/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api.js index 489cc3a754..57aed8a700 100644 --- a/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api.js +++ b/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api.js @@ -55,7 +55,7 @@ add_task(async function test_propagated_extension_error() { throw err; } }, - mockAPIRequestHandler(policy, request) { + mockAPIRequestHandler() { return { type: Ci.mozIExtensionAPIRequestResult.EXTENSION_ERROR, value: new Error("Fake Extension Error"), @@ -76,7 +76,7 @@ add_task(async function test_system_errors_donot_leak() { ); } - function mockAPIRequestHandler(policy, request) { + function mockAPIRequestHandler() { throw new Error("Fake handleAPIRequest exception"); } @@ -183,7 +183,7 @@ add_task(async function test_call_sync_fn_missing_return() { backgroundScript() { self.browser.mockExtensionAPI.methodSyncWithReturn("arg0"); }, - mockAPIRequestHandler(policy, request) { + mockAPIRequestHandler() { return undefined; }, assertResults({ testError }) { @@ -208,7 +208,7 @@ add_task(async function test_call_async_throw_extension_error() { throw err; } }, - mockAPIRequestHandler(policy, request) { + mockAPIRequestHandler() { return { type: Ci.mozIExtensionAPIRequestResult.EXTENSION_ERROR, value: new Error("Fake Param Validation Error"), @@ -233,7 +233,7 @@ add_task(async function test_call_async_reject_error() { throw err; } }, - mockAPIRequestHandler(policy, request) { + mockAPIRequestHandler() { return { type: Ci.mozIExtensionAPIRequestResult.RETURN_VALUE, value: Promise.reject(new Error("Fake API rejected error object")), @@ -311,7 +311,7 @@ add_task(async function test_call_no_return_throw_extension_error() { throw err; } }, - mockAPIRequestHandler(policy, request) { + mockAPIRequestHandler() { return { type: Ci.mozIExtensionAPIRequestResult.EXTENSION_ERROR, value: new Error("Fake Param Validation Error"), @@ -331,7 +331,7 @@ add_task(async function test_call_no_return_without_errors() { backgroundScript() { self.browser.mockExtensionAPI.methodNoReturn("arg0"); }, - mockAPIRequestHandler(policy, request) { + mockAPIRequestHandler() { return undefined; }, assertResults({ testError }) { @@ -446,7 +446,7 @@ add_task(async function test_get_property() { backgroundScript() { return self.browser.mockExtensionAPI.propertyAsString; }, - mockAPIRequestHandler(policy, request) { + mockAPIRequestHandler() { return { type: Ci.mozIExtensionAPIRequestResult.RETURN_VALUE, value: "property-value", @@ -478,7 +478,7 @@ add_task(async function test_get_property() { value: ChromeUtils.createError("fake extension error", savedFrame), }; }, - assertResults({ testError, testResult }) { + assertResults({ testError }) { Assert.deepEqual(testError, null, "Got no error as expected"); }, } diff --git a/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_event_callback.js b/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_event_callback.js index 576ec760d3..88c89a77e0 100644 --- a/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_event_callback.js +++ b/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_event_callback.js @@ -18,7 +18,7 @@ add_task(async function setup() { add_task(async function test_api_event_manager_methods() { await runExtensionAPITest("extension event manager methods", { - backgroundScript({ testAsserts, testLog }) { + backgroundScript({ testAsserts }) { const api = browser.mockExtensionAPI; const listener = () => {}; @@ -48,7 +48,7 @@ add_task(async function test_api_event_manager_methods() { ); } }, - assertResults({ testError, testResult }) { + assertResults({ testError }) { Assert.deepEqual(testError, null, "Got no error as expected"); }, }); @@ -104,7 +104,7 @@ add_task(async function test_api_event_eventListener_call_with_result() { await runExtensionAPITest( "extension event eventListener wrapper forwarded call result", { - backgroundScript({ testAsserts, testLog }) { + backgroundScript({ testLog }) { const api = browser.mockExtensionAPI; let listener; @@ -206,11 +206,11 @@ add_task(async function test_api_event_eventListener_result_rejected() { await runExtensionAPITest( "extension event eventListener throws (mozIExtensionCallback.call)", { - backgroundScript({ testAsserts, testLog }) { + backgroundScript({ testLog }) { const api = browser.mockExtensionAPI; let listener; - return new Promise((resolve, reject) => { + return new Promise(resolve => { testLog("addListener and wait for event to be fired"); listener = (msg, arg1) => { if (msg === "test-done") { @@ -263,7 +263,7 @@ add_task(async function test_api_event_eventListener_throws_on_call() { await runExtensionAPITest( "extension event eventListener throws (mozIExtensionCallback.call)", { - backgroundScript({ testAsserts, testLog }) { + backgroundScript({ testLog }) { const api = browser.mockExtensionAPI; let listener; @@ -280,7 +280,7 @@ add_task(async function test_api_event_eventListener_throws_on_call() { api.onTestEvent.addListener(listener); }); }, - assertResults({ testError, testResult }) { + assertResults({ testError }) { Assert.deepEqual(testError, null, "Got no error as expected"); }, mockAPIRequestHandler(policy, request) { @@ -305,7 +305,7 @@ add_task(async function test_send_response_eventListener() { await runExtensionAPITest( "extension event eventListener sendResponse eventListener argument", { - backgroundScript({ testAsserts, testLog }) { + backgroundScript({ testLog }) { const api = browser.mockExtensionAPI; let listener; @@ -353,14 +353,14 @@ add_task(async function test_send_response_eventListener() { add_task(async function test_send_response_multiple_eventListener() { await runExtensionAPITest("multiple extension event eventListeners", { - backgroundScript({ testAsserts, testLog }) { + backgroundScript({ testLog }) { const api = browser.mockExtensionAPI; let listenerNoReply; let listenerSendResponseReply; return new Promise(resolve => { testLog("addListener and wait for event to be fired"); - listenerNoReply = (msg, sendResponse) => { + listenerNoReply = () => { return false; }; listenerSendResponseReply = (msg, sendResponse) => { diff --git a/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_request_handler.js b/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_request_handler.js index 070a45fa95..4886db37d0 100644 --- a/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_request_handler.js +++ b/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_request_handler.js @@ -29,7 +29,7 @@ add_task(async function test_sw_api_request_handling_local_process_api() { files: { "page.html": "<!DOCTYPE html><body></body>", "sw.js": async function () { - browser.test.onMessage.addListener(async msg => { + browser.test.onMessage.addListener(async () => { browser.test.succeed("call to test.succeed"); browser.test.assertTrue(true, "call to test.assertTrue"); browser.test.assertFalse(false, "call to test.assertFalse"); diff --git a/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_schema_errors.js b/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_schema_errors.js index d8684c1574..b532ca5203 100644 --- a/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_schema_errors.js +++ b/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_schema_errors.js @@ -17,7 +17,7 @@ AddonTestUtils.createAppInfo( // is no JSON schema for this namespace so we add one here that is tailored for // our testing needs. const API = class extends ExtensionAPI { - getAPI(context) { + getAPI() { return { mockExtensionAPI: { methodAsync: () => { diff --git a/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_schema_formatters.js b/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_schema_formatters.js index a7310f345e..d6f0d83896 100644 --- a/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_schema_formatters.js +++ b/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_schema_formatters.js @@ -17,7 +17,7 @@ AddonTestUtils.createAppInfo( // is no JSON schema for this namespace so we add one here that is tailored for // our testing needs. const API = class extends ExtensionAPI { - getAPI(context) { + getAPI() { return { mockExtensionAPI: { methodAsync: files => { diff --git a/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_runtime_port.js b/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_runtime_port.js index 0d88014f32..1ca5994f60 100644 --- a/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_runtime_port.js +++ b/toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_runtime_port.js @@ -16,7 +16,7 @@ add_task(async function setup() { add_task(async function test_method_return_runtime_port() { await runExtensionAPITest("API method returns an ExtensionPort instance", { - backgroundScript({ testAsserts, testLog }) { + backgroundScript({ testAsserts }) { try { browser.mockExtensionAPI.methodReturnsPort("port-create-error"); throw new Error("methodReturnsPort should have raised an exception"); |