summaryrefslogtreecommitdiffstats
path: root/toolkit/components/extensions/test/xpcshell
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/extensions/test/xpcshell')
-rw-r--r--toolkit/components/extensions/test/xpcshell/data/file_page_xhr.html2
-rw-r--r--toolkit/components/extensions/test/xpcshell/data/file_permission_xhr.html2
-rw-r--r--toolkit/components/extensions/test/xpcshell/head.js22
-rw-r--r--toolkit/components/extensions/test/xpcshell/head_schemas.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/head_service_worker.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_csp_validator.js6
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_alarms_does_not_fire.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_api_events_listener_calls_exceptions.js1
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_captivePortal.js5
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_contentscript.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_contentscript_context.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_contentscript_create_iframe.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_contentscript_importmap.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_contentscript_module_import.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_contentscript_triggeringPrincipal.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_contexts.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_contexts_gc.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_dnr_allowAllRequests.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_dnr_download.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_dnr_modifyHeaders.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_dnr_webrequest.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_dns.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_downloads_partitionKey.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_downloads_search.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_downloads_urlencoded.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_eventpage_messaging.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_experiments.js8
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_i18n.js8
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_indexedDB_principal.js12
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_management.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_management_uninstall_self.js6
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_messaging_startup.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_native_messaging.js6
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_notifications_incognito.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_permissions.js26
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_persistent_events.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_privacy_disable.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_proxy_authorization_via_proxyinfo.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_proxy_onauthrequired.js8
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_proxy_settings.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_proxy_socks.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_proxy_startup.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_redirects.js10
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_runtime_onInstalled_and_onStartup.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_runtime_ports.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_runtime_ports_gc.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_runtime_sendMessage.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_same_site_redirects.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_schemas.js6
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_schemas_interactive.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_schemas_manifest_permissions.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_schemas_privileged.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_schemas_roots.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_scripting_persistAcrossSessions.js12
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_storage_idb_data_migration.js3
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_storage_sanitizer.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_storage_sync_kinto.js117
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_storage_tab.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_userScripts_exports.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_webRequest_auth.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_webRequest_cancelWithReason.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_webRequest_download.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_webRequest_filterResponseData.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_webRequest_permission.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_webRequest_redirectProperty.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_webRequest_responseBody.js40
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_webRequest_startup.js22
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_webRequest_suspend.js4
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_webRequest_viewsource.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_webRequest_webSocket.js10
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_ext_web_accessible_resources.js8
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_native_manifests.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_proxy_failover.js6
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_proxy_info_results.js29
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_proxy_listener.js6
-rw-r--r--toolkit/components/extensions/test/xpcshell/test_webRequest_filtering.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api.js18
-rw-r--r--toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_event_callback.js20
-rw-r--r--toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_request_handler.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_schema_errors.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_api_schema_formatters.js2
-rw-r--r--toolkit/components/extensions/test/xpcshell/webidl-api/test_ext_webidl_runtime_port.js2
84 files changed, 312 insertions, 255 deletions
diff --git a/toolkit/components/extensions/test/xpcshell/data/file_page_xhr.html b/toolkit/components/extensions/test/xpcshell/data/file_page_xhr.html
index 387b5285f5..58b053f7d9 100644
--- a/toolkit/components/extensions/test/xpcshell/data/file_page_xhr.html
+++ b/toolkit/components/extensions/test/xpcshell/data/file_page_xhr.html
@@ -8,7 +8,7 @@
<script>
"use strict";
-addEventListener("message", async function(event) {
+addEventListener("message", async function() {
const url = new URL("/return_headers.sjs", location).href;
const webpageFetchResult = await fetch(url).then(res => res.json());
diff --git a/toolkit/components/extensions/test/xpcshell/data/file_permission_xhr.html b/toolkit/components/extensions/test/xpcshell/data/file_permission_xhr.html
index 6f1bb4648b..8ae5955024 100644
--- a/toolkit/components/extensions/test/xpcshell/data/file_permission_xhr.html
+++ b/toolkit/components/extensions/test/xpcshell/data/file_permission_xhr.html
@@ -12,7 +12,7 @@
/* globals privilegedFetch, privilegedXHR */
/* eslint-disable mozilla/balanced-listeners */
-addEventListener("message", function rcv(event) {
+addEventListener("message", function rcv() {
removeEventListener("message", rcv, false);
function assertTrue(condition, description) {
diff --git a/toolkit/components/extensions/test/xpcshell/head.js b/toolkit/components/extensions/test/xpcshell/head.js
index 6935e3f0da..ff58d36f7d 100644
--- a/toolkit/components/extensions/test/xpcshell/head.js
+++ b/toolkit/components/extensions/test/xpcshell/head.js
@@ -3,8 +3,9 @@
promiseQuotaManagerServiceReset, promiseQuotaManagerServiceClear,
runWithPrefs, testEnv, withHandlingUserInput, resetHandlingUserInput,
assertPersistentListeners, promiseExtensionEvent, assertHasPersistedScriptsCachedFlag,
- assertIsPersistedScriptsCachedFlag
- setup_crash_reporter_override_and_cleaner crashFrame crashExtensionBackground
+ assertIsPersistedScriptsCachedFlag,
+ setup_crash_reporter_override_and_cleaner, crashFrame, crashExtensionBackground,
+ makeRkvDatabaseDir
*/
var { AppConstants } = ChromeUtils.importESModule(
@@ -81,6 +82,19 @@ var createHttpServer = (...args) => {
return AddonTestUtils.createHttpServer(...args);
};
+async function makeRkvDatabaseDir(name, { mockCorrupted = false } = {}) {
+ const databaseDir = PathUtils.join(PathUtils.profileDir, name);
+ await IOUtils.makeDirectory(databaseDir);
+ if (mockCorrupted) {
+ // Mock a corrupted db.
+ await IOUtils.write(
+ PathUtils.join(databaseDir, "data.safe.bin"),
+ new Uint8Array([0x00, 0x00, 0x00, 0x00])
+ );
+ }
+ return databaseDir;
+}
+
// Some tests load non-moz-extension:-URLs in their extension document. When
// extensions run in-process (extensions.webextensions.remote set to false),
// that fails.
@@ -285,7 +299,7 @@ function handlingUserInputFrameScript() {
let handle;
MessageChannel.addListener(this, "ExtensionTest:HandleUserInput", {
- receiveMessage({ name, data }) {
+ receiveMessage({ data }) {
if (data) {
handle = content.windowUtils.setHandlingUserInput(true);
} else if (handle) {
@@ -367,7 +381,7 @@ const optionalPermissionsPromptHandler = {
});
},
- observe(subject, topic, data) {
+ observe(subject, topic) {
if (topic == "webextension-optional-permission-prompt") {
this.sawPrompt = true;
let { resolve } = subject.wrappedJSObject;
diff --git a/toolkit/components/extensions/test/xpcshell/head_schemas.js b/toolkit/components/extensions/test/xpcshell/head_schemas.js
index 94af4a631a..b74d461444 100644
--- a/toolkit/components/extensions/test/xpcshell/head_schemas.js
+++ b/toolkit/components/extensions/test/xpcshell/head_schemas.js
@@ -102,7 +102,7 @@ function getContextWrapper(manifestVersion = 2) {
},
preprocessors: {
- localize(value, context) {
+ localize(value) {
return value.replace(
/__MSG_(.*?)__/g,
(m0, m1) => `${m1.toUpperCase()}`
@@ -118,7 +118,7 @@ function getContextWrapper(manifestVersion = 2) {
return this.permissions.has(permission);
},
- shouldInject(ns, name, allowedContexts) {
+ shouldInject(ns, name) {
return name != "do-not-inject";
},
diff --git a/toolkit/components/extensions/test/xpcshell/head_service_worker.js b/toolkit/components/extensions/test/xpcshell/head_service_worker.js
index aa1cf5cb18..771f3b1179 100644
--- a/toolkit/components/extensions/test/xpcshell/head_service_worker.js
+++ b/toolkit/components/extensions/test/xpcshell/head_service_worker.js
@@ -150,7 +150,7 @@ class TestWorkerWatcher extends ExtensionCommon.EventEmitter {
}
}
- observe(subject, topic, childIDString) {
+ observe() {
// Keep the watched process and related test child process actor updated
// when a process is created or destroyed.
this.getAndWatchExtensionProcess();
diff --git a/toolkit/components/extensions/test/xpcshell/test_csp_validator.js b/toolkit/components/extensions/test/xpcshell/test_csp_validator.js
index 12ba3f93e9..011628f027 100644
--- a/toolkit/components/extensions/test/xpcshell/test_csp_validator.js
+++ b/toolkit/components/extensions/test/xpcshell/test_csp_validator.js
@@ -7,7 +7,7 @@ const cps = Cc["@mozilla.org/addons/content-policy;1"].getService(
);
add_task(async function test_csp_validator_flags() {
- let checkPolicy = (policy, flags, expectedResult, message = null) => {
+ let checkPolicy = (policy, flags, expectedResult) => {
info(`Checking policy: ${policy}`);
let result = cps.validateAddonCSP(policy, flags);
@@ -76,7 +76,7 @@ add_task(async function test_csp_validator_flags() {
});
add_task(async function test_csp_validator() {
- let checkPolicy = (policy, expectedResult, message = null) => {
+ let checkPolicy = (policy, expectedResult) => {
info(`Checking policy: ${policy}`);
let result = cps.validateAddonCSP(
@@ -199,7 +199,7 @@ add_task(async function test_csp_validator() {
});
add_task(async function test_csp_validator_extension_pages() {
- let checkPolicy = (policy, expectedResult, message = null) => {
+ let checkPolicy = (policy, expectedResult) => {
info(`Checking policy: ${policy}`);
// While Schemas.jsm uses Ci.nsIAddonContentPolicy.CSP_ALLOW_WASM, we don't
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_alarms_does_not_fire.js b/toolkit/components/extensions/test/xpcshell/test_ext_alarms_does_not_fire.js
index fe385004ba..77be9b22bd 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_alarms_does_not_fire.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_alarms_does_not_fire.js
@@ -7,7 +7,7 @@ add_task(async function test_cleared_alarm_does_not_fire() {
async function backgroundScript() {
let ALARM_NAME = "test_ext_alarms";
- browser.alarms.onAlarm.addListener(alarm => {
+ browser.alarms.onAlarm.addListener(() => {
browser.test.fail("cleared alarm does not fire");
browser.test.notifyFail("alarm-cleared");
});
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_api_events_listener_calls_exceptions.js b/toolkit/components/extensions/test/xpcshell/test_ext_api_events_listener_calls_exceptions.js
index 44ff592d83..02970f9144 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_api_events_listener_calls_exceptions.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_api_events_listener_calls_exceptions.js
@@ -141,6 +141,7 @@ add_task(async function test_api_listener_call_exception() {
// catch with a failure if we are running the extension code as a side effect
// of logging the error to the console service.
const nonError = {
+ // eslint-disable-next-line getter-return
get message() {
browser.test.fail(`Unexpected extension code executed`);
},
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_captivePortal.js b/toolkit/components/extensions/test/xpcshell/test_ext_captivePortal.js
index dfb5c4c415..9141aa89cb 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_captivePortal.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_captivePortal.js
@@ -1,10 +1,5 @@
"use strict";
-Services.prefs.setBoolPref(
- "extensions.webextensions.background-delayed-startup",
- true
-);
-
AddonTestUtils.init(this);
AddonTestUtils.overrideCertDB();
AddonTestUtils.createAppInfo(
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js b/toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js
index c92ed11022..819b51ac8c 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js
@@ -305,7 +305,7 @@ add_task(async function test_contentscripts_unregister_on_context_unload() {
add_task(async function test_contentscripts_register_js() {
async function background() {
browser.runtime.onMessage.addListener(
- ([msg, expectedStates, readyState], sender) => {
+ ([msg, expectedStates, readyState]) => {
if (msg == "chrome-namespace-ok") {
browser.test.sendMessage(msg);
return;
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript.js b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript.js
index cb2f342d4e..734e084b57 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript.js
@@ -12,7 +12,7 @@ ExtensionTestUtils.mockAppInfo();
add_task(async function test_contentscript_runAt() {
function background() {
browser.runtime.onMessage.addListener(
- ([msg, expectedStates, readyState], sender) => {
+ ([msg, expectedStates, readyState]) => {
if (msg == "chrome-namespace-ok") {
browser.test.sendMessage(msg);
return;
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_context.js b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_context.js
index fc27b84200..44ecde6fcd 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_context.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_context.js
@@ -340,7 +340,7 @@ add_task(async function test_contentscript_context_valid_during_execution() {
await extension.startup();
await extension.awaitMessage("content-script-ready");
- await contentPage.legacySpawn(extension.id, async extensionId => {
+ await contentPage.legacySpawn(extension.id, async () => {
// Navigate so that the content page is frozen in the bfcache.
this.content.location = "http://example.org/dummy?second";
});
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_create_iframe.js b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_create_iframe.js
index 41d9901c80..2bd475ec15 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_create_iframe.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_create_iframe.js
@@ -5,7 +5,7 @@ server.registerDirectory("/data/", do_get_file("data"));
add_task(async function test_contentscript_create_iframe() {
function background() {
- browser.runtime.onMessage.addListener((msg, sender) => {
+ browser.runtime.onMessage.addListener(msg => {
let { name, availableAPIs, manifest, testGetManifest } = msg;
let hasExtTabsAPI = availableAPIs.indexOf("tabs") > 0;
let hasExtWindowsAPI = availableAPIs.indexOf("windows") > 0;
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_importmap.js b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_importmap.js
index ba7f7120d9..2f80840bf6 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_importmap.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_importmap.js
@@ -52,7 +52,7 @@ server.registerPathHandler("/importmap.html", (request, response) => {
response.write(importMapHtml);
});
-server.registerPathHandler("/simple.js", (request, response) => {
+server.registerPathHandler("/simple.js", () => {
ok(false, "Unexpected request to /simple.js");
});
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_module_import.js b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_module_import.js
index 3e4e5dd983..80183567c4 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_module_import.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_module_import.js
@@ -8,7 +8,7 @@ server.registerPathHandler("/dummy", (request, response) => {
response.write("<!DOCTYPE html><html></html>");
});
-server.registerPathHandler("/script.js", (request, response) => {
+server.registerPathHandler("/script.js", () => {
ok(false, "Unexpected request to /script.js");
});
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_triggeringPrincipal.js b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_triggeringPrincipal.js
index 3b8721ad8d..4ebe6df636 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_triggeringPrincipal.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_contentscript_triggeringPrincipal.js
@@ -989,7 +989,7 @@ function awaitLoads(urlsPromise, origins) {
}
});
- observer = (channel, topic, data) => {
+ observer = channel => {
if (expectedURLs) {
checkChannel(channel.QueryInterface(Ci.nsIChannel));
} else {
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_contexts.js b/toolkit/components/extensions/test/xpcshell/test_ext_contexts.js
index 028f5b5638..7cb244aa3a 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_contexts.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_contexts.js
@@ -18,7 +18,7 @@ class StubContext extends BaseContext {
this.sandbox = Cu.Sandbox(global);
}
- logActivity(type, name, data) {
+ logActivity() {
// no-op required by subclass
}
@@ -128,7 +128,7 @@ class Context extends BaseContext {
this.sandbox = Cu.Sandbox(principal, { wantXrays: false });
}
- logActivity(type, name, data) {
+ logActivity() {
// no-op required by subclass
}
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_contexts_gc.js b/toolkit/components/extensions/test/xpcshell/test_ext_contexts_gc.js
index a828584ced..2a36f51637 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_contexts_gc.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_contexts_gc.js
@@ -187,7 +187,7 @@ add_task(async function test_ExtensionPageContextChild_in_child_frame() {
);
await extension.awaitMessage("extensionPageLoaded");
- await contentPage.legacySpawn(extension.id, async extensionId => {
+ await contentPage.legacySpawn(extension.id, async () => {
let { ExtensionPageChild } = ChromeUtils.importESModule(
"resource://gre/modules/ExtensionPageChild.sys.mjs"
);
@@ -237,7 +237,7 @@ add_task(async function test_ExtensionPageContextChild_in_toplevel() {
);
await extension.awaitMessage("extensionPageLoaded");
- await contentPage.legacySpawn(extension.id, async extensionId => {
+ await contentPage.legacySpawn(extension.id, async () => {
let { ExtensionPageChild } = ChromeUtils.importESModule(
"resource://gre/modules/ExtensionPageChild.sys.mjs"
);
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_dnr_allowAllRequests.js b/toolkit/components/extensions/test/xpcshell/test_ext_dnr_allowAllRequests.js
index ccb380180f..b67b28a811 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_dnr_allowAllRequests.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_dnr_allowAllRequests.js
@@ -18,7 +18,7 @@ add_setup(() => {
const server = createHttpServer({
hosts: ["example.com", "example.net", "example.org"],
});
-server.registerPathHandler("/never_reached", (req, res) => {
+server.registerPathHandler("/never_reached", () => {
Assert.ok(false, "Server should never have been reached");
});
server.registerPathHandler("/allowed", (req, res) => {
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_dnr_download.js b/toolkit/components/extensions/test/xpcshell/test_ext_dnr_download.js
index cd24b75855..5a5ac79473 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_dnr_download.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_dnr_download.js
@@ -2,7 +2,7 @@
let server = createHttpServer({ hosts: ["example.com"] });
let downloadReqCount = 0;
-server.registerPathHandler("/downloadtest", (req, res) => {
+server.registerPathHandler("/downloadtest", () => {
++downloadReqCount;
});
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_dnr_modifyHeaders.js b/toolkit/components/extensions/test/xpcshell/test_ext_dnr_modifyHeaders.js
index 236cda4e37..4b7bebe188 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_dnr_modifyHeaders.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_dnr_modifyHeaders.js
@@ -73,7 +73,7 @@ server.registerPathHandler("/setcookie", (req, res) => {
res.setHeader("Set-Cookie", "second=serving; max-age=999", /* merge */ true);
res.write(req.hasHeader("Cookie") ? req.getHeader("Cookie") : "");
});
-server.registerPathHandler("/empty", (req, res) => {});
+server.registerPathHandler("/empty", () => {});
add_setup(() => {
Services.prefs.setBoolPref("extensions.manifestV3.enabled", true);
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_dnr_webrequest.js b/toolkit/components/extensions/test/xpcshell/test_ext_dnr_webrequest.js
index 415ab42c5f..6573286d24 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_dnr_webrequest.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_dnr_webrequest.js
@@ -8,7 +8,7 @@ add_setup(() => {
const server = createHttpServer({
hosts: ["example.com", "redir"],
});
-server.registerPathHandler("/never_reached", (req, res) => {
+server.registerPathHandler("/never_reached", () => {
Assert.ok(false, "Server should never have been reached");
});
server.registerPathHandler("/source", (req, res) => {
@@ -223,7 +223,7 @@ add_task(async function redirect_with_webRequest_after_failing_dnr_redirect() {
const VERY_LONG_STRING = "x".repeat(network_standard_url_max_length - 20);
browser.webRequest.onBeforeRequest.addListener(
- d => {
+ () => {
return { redirectUrl: "http://redir/destination?by-webrequest" };
},
{ urls: ["*://example.com/*"] },
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_dns.js b/toolkit/components/extensions/test/xpcshell/test_ext_dns.js
index 4b8599b0c5..c9e9d29ed5 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_dns.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_dns.js
@@ -14,7 +14,7 @@ AddonTestUtils.createAppInfo(
"42"
);
-function getExtension(background = undefined) {
+function getExtension() {
let manifest = {
permissions: ["dns", "proxy"],
};
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js
index e2867d1f03..6bf313511a 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js
@@ -453,7 +453,7 @@ async function testHttpErrors(allowHttpErrors) {
response.write(content);
});
- function background(code) {
+ function background() {
let dlid = 0;
let expectedState;
browser.test.onMessage.addListener(async options => {
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_partitionKey.js b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_partitionKey.js
index 3326ed0ce9..169a147e0d 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_partitionKey.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_partitionKey.js
@@ -29,7 +29,7 @@ let downloadDir;
function observeDownloadChannel(uri, partitionKey, isPrivate) {
return new Promise(resolve => {
let observer = {
- observe(subject, topic, data) {
+ observe(subject, topic) {
if (topic === "http-on-modify-request") {
let httpChannel = subject.QueryInterface(Ci.nsIHttpChannel);
if (httpChannel.URI.spec != uri) {
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_search.js b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_search.js
index 37c497a9b6..2ca18abf86 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_search.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_search.js
@@ -77,7 +77,7 @@ function backgroundScript() {
browser.test.sendMessage("ready");
}
-async function clearDownloads(callback) {
+async function clearDownloads() {
let list = await Downloads.getList(Downloads.ALL);
let downloads = await list.getAll();
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_urlencoded.js b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_urlencoded.js
index 03288fb5d5..ae40faf909 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_urlencoded.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_urlencoded.js
@@ -62,7 +62,7 @@ function backgroundScript() {
browser.test.sendMessage("ready");
}
-async function clearDownloads(callback) {
+async function clearDownloads() {
let list = await Downloads.getList(Downloads.ALL);
let downloads = await list.getAll();
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_eventpage_messaging.js b/toolkit/components/extensions/test/xpcshell/test_ext_eventpage_messaging.js
index c343f19a5c..b3ad24c461 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_eventpage_messaging.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_eventpage_messaging.js
@@ -107,7 +107,7 @@ add_task(async function test_runtime_onConnect_cancels_suspend() {
// extension API. This ensures that if the event page suspend is canceled,
// that it was intentionally done by the listener, and not as a side
// effect of an unrelated extension API call.
- browser.runtime.onConnect.addListener(port => {
+ browser.runtime.onConnect.addListener(() => {
// Set by extensionPageScript before runtime.connect():
globalThis.notify_extensionPage_got_onConnect();
});
@@ -162,7 +162,7 @@ add_task(async function test_runtime_Port_onMessage_cancels_suspend() {
// that it was intentionally done by the listener, and not as a side
// effect of an unrelated extension API call.
browser.runtime.onConnect.addListener(port => {
- port.onMessage.addListener(msg => {
+ port.onMessage.addListener(() => {
// Set by extensionPageScript before runtime.connect():
globalThis.notify_extensionPage_got_port_onMessage();
});
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_experiments.js b/toolkit/components/extensions/test/xpcshell/test_ext_experiments.js
index cd2eb4dbb7..25ac794d66 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_experiments.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_experiments.js
@@ -76,7 +76,7 @@ let fooExperimentFiles = {
/* globals ExtensionAPI */
"parent.js": () => {
this.foo = class extends ExtensionAPI {
- getAPI(context) {
+ getAPI() {
return {
experiments: {
foo: {
@@ -129,7 +129,7 @@ let fooExperimentFiles = {
onChildEvent: new EventManagerWithAssertions({
context,
name: `experiments.foo.onChildEvent`,
- register: fire => {
+ register: () => {
return () => {};
},
}).api(),
@@ -379,7 +379,7 @@ add_task(async function test_unbundled_experiments() {
"parent.js": () => {
this.crunk = class extends ExtensionAPI {
- getAPI(context) {
+ getAPI() {
return {
experiments: {
crunk: {
@@ -395,7 +395,7 @@ add_task(async function test_unbundled_experiments() {
"child.js": () => {
this.crunk = class extends ExtensionAPI {
- getAPI(context) {
+ getAPI() {
return {
experiments: {
crunk: {
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_i18n.js b/toolkit/components/extensions/test/xpcshell/test_ext_i18n.js
index 048e675a3e..1e46e19527 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_i18n.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_i18n.js
@@ -306,7 +306,7 @@ add_task(async function test_get_accept_languages() {
}
function background(checkResultsFn) {
- browser.test.onMessage.addListener(([msg, expected]) => {
+ browser.test.onMessage.addListener(([, expected]) => {
browser.i18n.getAcceptLanguages().then(results => {
checkResultsFn("background", results, expected);
@@ -316,7 +316,7 @@ add_task(async function test_get_accept_languages() {
}
function content(checkResultsFn) {
- browser.test.onMessage.addListener(([msg, expected]) => {
+ browser.test.onMessage.addListener(([, expected]) => {
browser.i18n.getAcceptLanguages().then(results => {
checkResultsFn("contentScript", results, expected);
@@ -392,7 +392,7 @@ add_task(async function test_get_ui_language() {
}
function background(getResultsFn, checkResultsFn) {
- browser.test.onMessage.addListener(([msg, expected]) => {
+ browser.test.onMessage.addListener(([, expected]) => {
checkResultsFn("background", getResultsFn(), expected);
browser.test.sendMessage("background-done");
@@ -400,7 +400,7 @@ add_task(async function test_get_ui_language() {
}
function content(getResultsFn, checkResultsFn) {
- browser.test.onMessage.addListener(([msg, expected]) => {
+ browser.test.onMessage.addListener(([, expected]) => {
checkResultsFn("contentScript", getResultsFn(), expected);
browser.test.sendMessage("content-done");
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_indexedDB_principal.js b/toolkit/components/extensions/test/xpcshell/test_ext_indexedDB_principal.js
index f355b1d43a..2428dcc461 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_indexedDB_principal.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_indexedDB_principal.js
@@ -30,13 +30,13 @@ add_task(async function test_indexedDB_principal() {
let store = tx.objectStore("TestStore");
tx.oncomplete = () => browser.test.sendMessage("storage-created");
store.add("foo", "bar");
- tx.onerror = function (e) {
+ tx.onerror = function () {
browser.test.fail(`Failed with error ${tx.error.message}`);
// Don't wait for timeout
browser.test.sendMessage("storage-created");
};
};
- request.onerror = function (e) {
+ request.onerror = function () {
browser.test.fail(`Failed with error ${request.error.message}`);
// Don't wait for timeout
browser.test.sendMessage("storage-created");
@@ -52,7 +52,7 @@ add_task(async function test_indexedDB_principal() {
dbRequest.onsuccess = function (e) {
let db = e.target.result;
let transaction = db.transaction("TestStore");
- transaction.onerror = function (e) {
+ transaction.onerror = function () {
browser.test.fail(
`Failed with error ${transaction.error.message}`
);
@@ -60,7 +60,7 @@ add_task(async function test_indexedDB_principal() {
};
let objectStore = transaction.objectStore("TestStore");
let request = objectStore.get("bar");
- request.onsuccess = function (event) {
+ request.onsuccess = function () {
browser.test.assertEq(
request.result,
"foo",
@@ -68,12 +68,12 @@ add_task(async function test_indexedDB_principal() {
);
browser.test.notifyPass("done");
};
- request.onerror = function (e) {
+ request.onerror = function () {
browser.test.fail(`Failed with error ${request.error.message}`);
browser.test.notifyFail("done");
};
};
- dbRequest.onerror = function (e) {
+ dbRequest.onerror = function () {
browser.test.fail(`Failed with error ${dbRequest.error.message}`);
browser.test.notifyFail("done");
};
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_management.js b/toolkit/components/extensions/test/xpcshell/test_ext_management.js
index 8fb6b0d9a1..89c3403f1f 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_management.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_management.js
@@ -65,7 +65,7 @@ add_task(async function test_management_permission() {
await testAvailable();
- browser.test.onMessage.addListener(async msg => {
+ browser.test.onMessage.addListener(async () => {
browser.test.log("test with permission");
// get permission
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_management_uninstall_self.js b/toolkit/components/extensions/test/xpcshell/test_ext_management_uninstall_self.js
index 45c981811b..0d923d60fa 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_management_uninstall_self.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_management_uninstall_self.js
@@ -59,7 +59,7 @@ add_task(async function setup() {
add_task(async function test_management_uninstall_no_prompt() {
function background() {
- browser.test.onMessage.addListener(msg => {
+ browser.test.onMessage.addListener(() => {
browser.management.uninstallSelf();
});
}
@@ -82,7 +82,7 @@ add_task(async function test_management_uninstall_prompt_uninstall() {
promptService._response = 0;
function background() {
- browser.test.onMessage.addListener(msg => {
+ browser.test.onMessage.addListener(() => {
browser.management.uninstallSelf({ showConfirmDialog: true });
});
}
@@ -114,7 +114,7 @@ add_task(async function test_management_uninstall_prompt_keep() {
promptService._response = 1;
function background() {
- browser.test.onMessage.addListener(async msg => {
+ browser.test.onMessage.addListener(async () => {
await browser.test.assertRejects(
browser.management.uninstallSelf({ showConfirmDialog: true }),
"User cancelled uninstall of extension",
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_messaging_startup.js b/toolkit/components/extensions/test/xpcshell/test_ext_messaging_startup.js
index 120bebb431..59d6794c7f 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_messaging_startup.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_messaging_startup.js
@@ -158,7 +158,7 @@ add_task(function test_onMessage() {
}
async function background() {
- browser.runtime.onMessage.addListener((msg, sender) => {
+ browser.runtime.onMessage.addListener(msg => {
browser.test.assertEq(
msg,
"ping",
@@ -217,7 +217,7 @@ add_task(async function test_other_startup() {
useAddonManager: "permanent",
async background() {
- browser.runtime.onMessage.addListener(msg => {
+ browser.runtime.onMessage.addListener(() => {
browser.test.notifyPass("startup");
});
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_native_messaging.js b/toolkit/components/extensions/test/xpcshell/test_ext_native_messaging.js
index cb08a70151..5b6719a1b6 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_native_messaging.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_native_messaging.js
@@ -531,7 +531,7 @@ add_task(async function test_disconnect() {
);
browser.test.sendMessage("message", msg);
});
- port.onDisconnect.addListener(msgPort => {
+ port.onDisconnect.addListener(() => {
browser.test.fail("onDisconnect should not be called for disconnect()");
});
browser.test.onMessage.addListener((what, payload) => {
@@ -660,7 +660,7 @@ add_task(async function test_read_limit() {
);
browser.test.sendMessage("result", "disconnected");
});
- port.onMessage.addListener(msg => {
+ port.onMessage.addListener(() => {
browser.test.sendMessage("result", "message");
});
port.postMessage(PAYLOAD);
@@ -881,7 +881,7 @@ add_task(async function test_connect_native_from_content_script() {
);
browser.test.sendMessage("result", "disconnected");
});
- port.onMessage.addListener(msg => {
+ port.onMessage.addListener(() => {
browser.test.sendMessage("result", "message");
});
port.postMessage({ test: "test" });
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_notifications_incognito.js b/toolkit/components/extensions/test/xpcshell/test_ext_notifications_incognito.js
index fda60c3a82..b287e0a6ad 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_notifications_incognito.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_notifications_incognito.js
@@ -33,7 +33,7 @@ const mockAlertsService = {
this.showAlert({ cookie, title, text, privateBrowsing }, alertListener);
},
- closeAlert(name) {
+ closeAlert() {
// This mock immediately close the alert on show, so this is empty.
},
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_permissions.js b/toolkit/components/extensions/test/xpcshell/test_ext_permissions.js
index 7fb8d4ca07..948b75978a 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_permissions.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_permissions.js
@@ -49,6 +49,32 @@ add_setup(async () => {
AddonTestUtils.usePrivilegedSignatures = false;
});
+add_task(
+ {
+ skip_if: () => ExtensionPermissions._useLegacyStorageBackend,
+ },
+ async function test_permissions_rkv_recovery_rename() {
+ const databaseDir = await makeRkvDatabaseDir(
+ "extension-store-permissions",
+ {
+ mockCorrupted: true,
+ }
+ );
+ const res = await ExtensionPermissions.get("@testextension");
+ Assert.deepEqual(
+ res,
+ { permissions: [], origins: [] },
+ "Expect ExtensionPermissions get promise to be resolved"
+ );
+ Assert.ok(
+ await IOUtils.exists(
+ PathUtils.join(databaseDir, "data.safe.bin.corrupt")
+ ),
+ "Expect corrupt file to be found"
+ );
+ }
+);
+
add_task(async function test_permissions_on_startup() {
let extensionId = "@permissionTest";
let extension = ExtensionTestUtils.loadExtension({
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_persistent_events.js b/toolkit/components/extensions/test/xpcshell/test_ext_persistent_events.js
index 07cc29bfe2..d1660ccb6d 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_persistent_events.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_persistent_events.js
@@ -41,7 +41,7 @@ const API = class extends ExtensionAPI {
const FIRE_TOPIC = `fire-${namespace}.${event}`;
- async function listener(subject, topic, data) {
+ async function listener(subject) {
try {
if (subject.wrappedJSObject.waitForBackground) {
await fire.wakeup();
@@ -257,7 +257,7 @@ const global = this;
async function promiseObservable(topic, count, fn = null) {
let _countResolve;
let results = [];
- function listener(subject, _topic, data) {
+ function listener(subject, _topic) {
const eventDetails = subject.wrappedJSObject;
results.push(eventDetails);
if (results.length > count) {
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_privacy_disable.js b/toolkit/components/extensions/test/xpcshell/test_ext_privacy_disable.js
index 637751f473..4e05954b7e 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_privacy_disable.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_privacy_disable.js
@@ -32,7 +32,7 @@ function awaitEvent(eventName) {
function awaitPrefChange(prefName) {
return new Promise(resolve => {
- let listener = args => {
+ let listener = () => {
Preferences.ignore(prefName, listener);
resolve();
};
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_proxy_authorization_via_proxyinfo.js b/toolkit/components/extensions/test/xpcshell/test_ext_proxy_authorization_via_proxyinfo.js
index 27f537b73b..e6d2653445 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_proxy_authorization_via_proxyinfo.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_proxy_authorization_via_proxyinfo.js
@@ -73,7 +73,7 @@ add_task(async function test_webRequest_auth_proxy() {
);
browser.webRequest.onAuthRequired.addListener(
- details => {
+ () => {
// Using proxyAuthorizationHeader should prevent an auth request coming to us in the extension.
browser.test.fail("onAuthRequired");
},
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_proxy_onauthrequired.js b/toolkit/components/extensions/test/xpcshell/test_ext_proxy_onauthrequired.js
index db041d20d0..4b1128a349 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_proxy_onauthrequired.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_proxy_onauthrequired.js
@@ -191,7 +191,7 @@ add_task(async function test_webRequest_auth_proxy_https() {
let authReceived = false;
browser.webRequest.onBeforeSendHeaders.addListener(
- details => {
+ () => {
if (authReceived) {
browser.test.sendMessage("done");
return { cancel: true };
@@ -202,7 +202,7 @@ add_task(async function test_webRequest_auth_proxy_https() {
);
browser.webRequest.onAuthRequired.addListener(
- details => {
+ () => {
authReceived = true;
return { authCredentials: { username: "puser", password: "ppass" } };
},
@@ -241,14 +241,14 @@ add_task(async function test_webRequest_auth_proxy_https() {
add_task(async function test_webRequest_auth_proxy_system() {
async function background(port) {
browser.webRequest.onBeforeRequest.addListener(
- details => {
+ () => {
browser.test.fail("onBeforeRequest");
},
{ urls: ["<all_urls>"] }
);
browser.webRequest.onAuthRequired.addListener(
- details => {
+ () => {
browser.test.sendMessage("onAuthRequired");
// cancel is silently ignored, if it were not (e.g someone messes up in
// WebRequest.jsm and allows cancel) this test would fail.
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_proxy_settings.js b/toolkit/components/extensions/test/xpcshell/test_ext_proxy_settings.js
index 33c91309f0..2db12c4b57 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_proxy_settings.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_proxy_settings.js
@@ -45,13 +45,13 @@ add_task(async function test_proxy_settings() {
{ urls: ["http://example.com/*"] }
);
browser.webRequest.onCompleted.addListener(
- details => {
+ () => {
browser.test.notifyPass("proxytest");
},
{ urls: ["http://example.com/*"] }
);
browser.webRequest.onErrorOccurred.addListener(
- details => {
+ () => {
browser.test.notifyFail("proxytest");
},
{ urls: ["http://example.com/*"] }
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_proxy_socks.js b/toolkit/components/extensions/test/xpcshell/test_ext_proxy_socks.js
index 6ebd9fbfcc..fd0aff709a 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_proxy_socks.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_proxy_socks.js
@@ -46,7 +46,7 @@ class SocksClient {
this.state = STATE_WAIT_GREETING;
this.socket = socket;
- socket.onclose = event => {
+ socket.onclose = () => {
this.server.requestCompleted(this);
};
socket.ondata = event => {
@@ -566,7 +566,7 @@ add_task(async function test_webRequest_socks_proxy() {
{ urls: ["<all_urls>"] }
);
browser.webRequest.onAuthRequired.addListener(
- details => {
+ () => {
// We should never get onAuthRequired for socks proxy
browser.test.fail("onAuthRequired");
},
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_proxy_startup.js b/toolkit/components/extensions/test/xpcshell/test_ext_proxy_startup.js
index 4130d407b7..3c48adf56d 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_proxy_startup.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_proxy_startup.js
@@ -175,7 +175,7 @@ add_task(async function webRequest_before_proxy() {
function background() {
browser.webRequest.onBeforeRequest.addListener(
- details => {
+ () => {
return { redirectUrl: "data:,response_from_webRequest" };
},
{
@@ -185,7 +185,7 @@ add_task(async function webRequest_before_proxy() {
["blocking"]
);
browser.proxy.onRequest.addListener(
- details => {
+ () => {
browser.test.sendMessage("seen_proxy_request");
},
{
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_redirects.js b/toolkit/components/extensions/test/xpcshell/test_ext_redirects.js
index 7b950355f3..d563df5b53 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_redirects.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_redirects.js
@@ -52,10 +52,10 @@ function onStopListener(channel) {
}
async function onModifyListener(originUrl, redirectToUrl) {
- return TestUtils.topicObserved("http-on-modify-request", (subject, data) => {
+ return TestUtils.topicObserved("http-on-modify-request", subject => {
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
return channel.URI && channel.URI.spec == originUrl;
- }).then(([subject, data]) => {
+ }).then(([subject]) => {
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
if (redirectToUrl) {
channel.redirectTo(Services.io.newURI(redirectToUrl));
@@ -229,7 +229,7 @@ add_task(async function test_extension_302_redirect_web() {
{ urls: [serverUrl] }
);
browser.webRequest.onHeadersReceived.addListener(
- details => {
+ () => {
browser.test.assertEq(
expected.shift(),
"onHeadersReceived",
@@ -239,7 +239,7 @@ add_task(async function test_extension_302_redirect_web() {
{ urls: [serverUrl] }
);
browser.webRequest.onResponseStarted.addListener(
- details => {
+ () => {
browser.test.assertEq(
expected.shift(),
"onResponseStarted",
@@ -527,7 +527,7 @@ add_task(async function test_extension_redirect() {
let myuri = browser.runtime.getURL("*");
let exturi = browser.runtime.getURL("finished.html");
browser.webRequest.onBeforeRequest.addListener(
- details => {
+ () => {
return { redirectUrl: exturi };
},
{ urls: ["<all_urls>", myuri] },
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_onInstalled_and_onStartup.js b/toolkit/components/extensions/test/xpcshell/test_ext_runtime_onInstalled_and_onStartup.js
index c330aaafde..1b6d5c331b 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_onInstalled_and_onStartup.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_runtime_onInstalled_and_onStartup.js
@@ -51,7 +51,7 @@ function background() {
}
});
- browser.runtime.onUpdateAvailable.addListener(details => {
+ browser.runtime.onUpdateAvailable.addListener(() => {
browser.test.sendMessage("reloading");
browser.runtime.reload();
});
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_ports.js b/toolkit/components/extensions/test/xpcshell/test_ext_runtime_ports.js
index 7365a13f93..d871acf2cf 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_ports.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_runtime_ports.js
@@ -17,7 +17,7 @@ add_task(async function test_port_disconnected_from_wrong_window() {
done = true;
});
- port.onDisconnect.addListener(err => {
+ port.onDisconnect.addListener(() => {
if (port === ports[1]) {
browser.test.log("Port 1 disconnected, sending message via port 2");
ports[2].postMessage("port-2-msg");
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_ports_gc.js b/toolkit/components/extensions/test/xpcshell/test_ext_runtime_ports_gc.js
index dd47744a97..ca63e683be 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_ports_gc.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_runtime_ports_gc.js
@@ -56,7 +56,7 @@ let gcExperimentFiles = {
);
/* globals ExtensionAPI */
this.gcHelper = class extends ExtensionAPI {
- getAPI(context) {
+ getAPI() {
let witnesses = new Map();
return {
gcHelper: {
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_sendMessage.js b/toolkit/components/extensions/test/xpcshell/test_ext_runtime_sendMessage.js
index 2bbc9864d7..2f9f07046c 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_runtime_sendMessage.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_runtime_sendMessage.js
@@ -49,7 +49,7 @@ add_task(async function runtimeSendMessageReply() {
}
});
- browser.runtime.onMessage.addListener((msg, sender, respond) => {
+ browser.runtime.onMessage.addListener(msg => {
if (msg == "respond-now") {
// If a response from another listener is received first, this
// exception should be ignored. Test fails if it is not.
@@ -271,7 +271,7 @@ add_task(async function sendMessageResponseGC() {
savedResolve("saved-resolve");
return;
case "promise-never":
- return new Promise(r => {});
+ return new Promise(() => {});
case "callback-save":
savedRespond = respond;
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_same_site_redirects.js b/toolkit/components/extensions/test/xpcshell/test_ext_same_site_redirects.js
index a3000e4e1f..f42a74e0bb 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_same_site_redirects.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_same_site_redirects.js
@@ -97,7 +97,7 @@ server.registerPathHandler("/final", (request, response) => {
function promiseFinalResponse() {
Assert.deepEqual(receivedCookies, [], "Test starts without observed cookies");
return new Promise(resolve => {
- server.registerPathHandler("/final_and_clean", (request, response) => {
+ server.registerPathHandler("/final_and_clean", request => {
Assert.equal(request.host, SITE_FINAL);
Assert.equal(getCookies(request), "", "Cookies cleaned up");
resolve(receivedCookies.splice(0));
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_schemas.js b/toolkit/components/extensions/test/xpcshell/test_ext_schemas.js
index a89ddf0728..24fcf9e1a9 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_schemas.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_schemas.js
@@ -1898,7 +1898,7 @@ add_task(async function testDefaults() {
let localWrapper = {
manifestVersion: 2,
cloneScope: global,
- shouldInject(ns) {
+ shouldInject() {
return true;
},
getImplementation(ns, name) {
@@ -1973,7 +1973,7 @@ add_task(async function testReturns() {
const localWrapper = {
manifestVersion: 2,
cloneScope: global,
- shouldInject(ns) {
+ shouldInject() {
return true;
},
getImplementation(ns, name) {
@@ -2096,7 +2096,7 @@ add_task(async function testCrossOriginArguments() {
let localWrapper = {
manifestVersion: 2,
cloneScope: sandbox,
- shouldInject(ns) {
+ shouldInject() {
return true;
},
getImplementation(ns, name) {
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_schemas_interactive.js b/toolkit/components/extensions/test/xpcshell/test_ext_schemas_interactive.js
index 986dc74bc5..712daecf72 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_schemas_interactive.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_schemas_interactive.js
@@ -46,7 +46,7 @@ let experimentFiles = {
/* globals ExtensionAPI */
"parent.js": () => {
this.userinputtest = class extends ExtensionAPI {
- getAPI(context) {
+ getAPI() {
return {
userinputtest: {
test() {},
@@ -58,7 +58,7 @@ let experimentFiles = {
"child.js": () => {
this.userinputtest = class extends ExtensionAPI {
- getAPI(context) {
+ getAPI() {
return {
userinputtest: {
child() {},
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_schemas_manifest_permissions.js b/toolkit/components/extensions/test/xpcshell/test_ext_schemas_manifest_permissions.js
index 562ab5c36d..85e645e67b 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_schemas_manifest_permissions.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_schemas_manifest_permissions.js
@@ -41,7 +41,7 @@ add_task(async function () {
];
class FakeAPI extends ExtensionAPI {
- getAPI(context) {
+ getAPI() {
return {
testManifestPermission: {
get testProperty() {
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_schemas_privileged.js b/toolkit/components/extensions/test/xpcshell/test_ext_schemas_privileged.js
index e2da7e5a74..14cbca7443 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_schemas_privileged.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_schemas_privileged.js
@@ -26,7 +26,7 @@ add_setup(async () => {
];
class API extends ExtensionAPI {
- getAPI(context) {
+ getAPI() {
return {
privileged: {
test: "hello",
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_schemas_roots.js b/toolkit/components/extensions/test/xpcshell/test_ext_schemas_roots.js
index 21434228a3..86f52bde7b 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_schemas_roots.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_schemas_roots.js
@@ -149,7 +149,7 @@ let wrapper = {
},
preprocessors: {
- localize(value, context) {
+ localize(value) {
return value.replace(/__MSG_(.*?)__/g, (m0, m1) => `${m1.toUpperCase()}`);
},
},
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_scripting_persistAcrossSessions.js b/toolkit/components/extensions/test/xpcshell/test_ext_scripting_persistAcrossSessions.js
index cae09b5d2e..1527be54d5 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_scripting_persistAcrossSessions.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_scripting_persistAcrossSessions.js
@@ -18,6 +18,18 @@ const { TestUtils } = ChromeUtils.importESModule(
"resource://testing-common/TestUtils.sys.mjs"
);
+add_task(async function test_scriptingstore_rkv_recovery_rename() {
+ ExtensionScriptingStore._getStoreForTesting()._uninitForTesting();
+ const databaseDir = await makeRkvDatabaseDir("extension-store", {
+ mockCorrupted: true,
+ });
+ await ExtensionScriptingStore._getStoreForTesting().lazyInit();
+ Assert.ok(
+ await IOUtils.exists(PathUtils.join(databaseDir, "data.safe.bin.corrupt")),
+ "Expect corrupt file to be found"
+ );
+});
+
const makeExtension = ({ manifest: manifestProps, ...otherProps }) => {
return ExtensionTestUtils.loadExtension({
manifest: {
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_storage_idb_data_migration.js b/toolkit/components/extensions/test/xpcshell/test_ext_storage_idb_data_migration.js
index 8a6631f26b..2a2aead4b5 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_storage_idb_data_migration.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_storage_idb_data_migration.js
@@ -397,8 +397,7 @@ add_task(async function test_storage_local_data_migration() {
Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS,
true
);
- const filterByCategory = ([timestamp, category]) =>
- category === EVENT_CATEGORY;
+ const filterByCategory = ([, category]) => category === EVENT_CATEGORY;
ok(
!snapshot.parent || snapshot.parent.filter(filterByCategory).length === 0,
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_storage_sanitizer.js b/toolkit/components/extensions/test/xpcshell/test_ext_storage_sanitizer.js
index 6c69ad1a4c..1150ed570d 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_storage_sanitizer.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_storage_sanitizer.js
@@ -81,7 +81,7 @@ add_task(async function test_sanitize_offlineApps_extension_indexedDB() {
const store = tx.objectStore("TestStore");
return new Promise((resolve, reject) => {
const req = store.get(k);
- tx.oncomplete = evt => resolve(req.result);
+ tx.oncomplete = () => resolve(req.result);
tx.onerror = evt => reject(evt.target.error);
});
});
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_storage_sync_kinto.js b/toolkit/components/extensions/test/xpcshell/test_ext_storage_sync_kinto.js
index 9e26eedfcf..64a325bf71 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_storage_sync_kinto.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_storage_sync_kinto.js
@@ -254,7 +254,7 @@ class KintoServer {
}
installCatchAll() {
- this.httpServer.registerPathHandler("/", (request, response) => {
+ this.httpServer.registerPathHandler("/", request => {
dump(
`got request: ${request.method}:${request.path}?${request.queryString}\n`
);
@@ -774,76 +774,65 @@ add_task(async function ensureCanSync_clearAll() {
const extension2 = { id: extensionId2 };
await withContextAndServer(async function (context, server) {
- await withSignedInUser(
- loggedInUser,
- async function (extensionStorageSync, fxaService) {
- async function assertSetAndGetData(extension, data) {
- await extensionStorageSync.set(extension, data, context);
- let storedData = await extensionStorageSync.get(
- extension,
- Object.keys(data),
- context
- );
- const extId = extensionId;
- deepEqual(
- storedData,
- data,
- `${extId} should get back the data we set`
- );
- }
-
- async function assertDataCleared(extension, keys) {
- const storedData = await extensionStorageSync.get(
- extension,
- keys,
- context
- );
- deepEqual(
- storedData,
- {},
- `${extension.id} should have lost the data`
- );
- }
-
- server.installCollection("storage-sync-crypto");
- server.etag = 1000;
-
- let newKeys = await extensionStorageSync.ensureCanSync([
- extensionId,
- extensionId2,
- ]);
- ok(
- newKeys.hasKeysFor([extensionId]),
- `key isn't present for ${extensionId}`
+ await withSignedInUser(loggedInUser, async function (extensionStorageSync) {
+ async function assertSetAndGetData(extension, data) {
+ await extensionStorageSync.set(extension, data, context);
+ let storedData = await extensionStorageSync.get(
+ extension,
+ Object.keys(data),
+ context
);
- ok(
- newKeys.hasKeysFor([extensionId2]),
- `key isn't present for ${extensionId2}`
+ const extId = extensionId;
+ deepEqual(storedData, data, `${extId} should get back the data we set`);
+ }
+
+ async function assertDataCleared(extension, keys) {
+ const storedData = await extensionStorageSync.get(
+ extension,
+ keys,
+ context
);
+ deepEqual(storedData, {}, `${extension.id} should have lost the data`);
+ }
- let posts = server.getPosts();
- equal(posts.length, 1);
- assertPostedNewRecord(posts[0]);
+ server.installCollection("storage-sync-crypto");
+ server.etag = 1000;
+
+ let newKeys = await extensionStorageSync.ensureCanSync([
+ extensionId,
+ extensionId2,
+ ]);
+ ok(
+ newKeys.hasKeysFor([extensionId]),
+ `key isn't present for ${extensionId}`
+ );
+ ok(
+ newKeys.hasKeysFor([extensionId2]),
+ `key isn't present for ${extensionId2}`
+ );
- await assertSetAndGetData(extension, { "my-key": 1 });
- await assertSetAndGetData(extension2, { "my-key": 2 });
+ let posts = server.getPosts();
+ equal(posts.length, 1);
+ assertPostedNewRecord(posts[0]);
- // Call cleanup for the first extension, to double check it has
- // been wiped out even without an active extension context.
- cleanUpForContext(extension, context);
+ await assertSetAndGetData(extension, { "my-key": 1 });
+ await assertSetAndGetData(extension2, { "my-key": 2 });
- // clear everything.
- await extensionStorageSync.clearAll();
+ // Call cleanup for the first extension, to double check it has
+ // been wiped out even without an active extension context.
+ cleanUpForContext(extension, context);
- // Assert that the data is gone for both the extensions.
- await assertDataCleared(extension, ["my-key"]);
- await assertDataCleared(extension2, ["my-key"]);
+ // clear everything.
+ await extensionStorageSync.clearAll();
- // should have been no posts caused by the clear.
- posts = server.getPosts();
- equal(posts.length, 1);
- }
- );
+ // Assert that the data is gone for both the extensions.
+ await assertDataCleared(extension, ["my-key"]);
+ await assertDataCleared(extension2, ["my-key"]);
+
+ // should have been no posts caused by the clear.
+ posts = server.getPosts();
+ equal(posts.length, 1);
+ });
});
await testExtension.unload();
@@ -1407,7 +1396,7 @@ add_task(async function checkSyncKeyRing_overwrites_on_conflict() {
// overwrite it with our keys.
const extensionId = uuid();
let extensionKey;
- await withSyncContext(async function (context) {
+ await withSyncContext(async function () {
await withServer(async function (server) {
// The old device has this kbHash, which is very similar to the
// current kbHash but with the last character changed.
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_storage_tab.js b/toolkit/components/extensions/test/xpcshell/test_ext_storage_tab.js
index cfa49c334b..4ff080887f 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_storage_tab.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_storage_tab.js
@@ -90,7 +90,7 @@ async function test_multiple_pages() {
contentPage = await ExtensionTestUtils.loadContentPage(url, { extension });
extension.sendMessage("page-loaded");
});
- extension.onMessage("remove-page", async url => {
+ extension.onMessage("remove-page", async () => {
await contentPage.close();
extension.sendMessage("page-removed");
});
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_userScripts_exports.js b/toolkit/components/extensions/test/xpcshell/test_ext_userScripts_exports.js
index 5950377f85..d6aa7a038c 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_userScripts_exports.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_userScripts_exports.js
@@ -225,7 +225,7 @@ add_task(async function test_apiScript_async_method() {
browser.userScripts.onBeforeScript.addListener(script => {
script.defineGlobals({
...sharedTestAPIMethods,
- testAPIMethod(param, cb, cb2, objWithCb) {
+ testAPIMethod(param, cb, cb2) {
browser.test.assertEq(
"function",
typeof cb,
@@ -696,7 +696,7 @@ add_task(
getPrototypeOf() {
throw new Error("Proxy's getPrototypeOf trap");
},
- get(target, prop, receiver) {
+ get() {
throw new Error("Proxy's get trap");
},
});
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_auth.js b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_auth.js
index c616d162a5..578e69ebdf 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_auth.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_auth.js
@@ -14,7 +14,7 @@ server.registerPathHandler("/authenticate.sjs", (request, response) => {
let realm = url.searchParams.get("realm") || "mochitest";
let proxy_realm = url.searchParams.get("proxy_realm");
- function checkAuthorization(authorization) {
+ function checkAuthorization() {
let expected_user = url.searchParams.get("user");
if (!expected_user) {
return true;
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_cancelWithReason.js b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_cancelWithReason.js
index a8405e5962..2ad729d0b4 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_cancelWithReason.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_cancelWithReason.js
@@ -41,9 +41,9 @@ add_task(async function test_cancel_with_reason() {
channel.asyncOpen({
QueryInterface: ChromeUtils.generateQI(["nsIStreamListener"]),
- onStartRequest(request) {},
+ onStartRequest() {},
- onStopRequest(request, statusCode) {
+ onStopRequest(request) {
let properties = request.QueryInterface(Ci.nsIPropertyBag);
let id = properties.getProperty("cancelledByExtension");
let reason = request.loadInfo.requestBlockingReason;
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_download.js b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_download.js
index 3485996f56..f1415ca87a 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_download.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_download.js
@@ -15,7 +15,7 @@ add_task(async function testDownload() {
},
background: async function () {
browser.webRequest.onBeforeRequest.addListener(
- details => {
+ () => {
browser.test.sendMessage("request_intercepted");
return { cancel: true };
},
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_filterResponseData.js b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_filterResponseData.js
index 0b826be08f..0ca0b36de8 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_filterResponseData.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_filterResponseData.js
@@ -371,7 +371,7 @@ add_task(async function test_filter_302() {
let filter = browser.webRequest.filterResponseData(details.requestId);
browser.test.sendMessage("filter-created");
- filter.ondata = event => {
+ filter.ondata = () => {
const script = "forceError();";
filter.write(new Uint8Array(new TextEncoder().encode(script)));
filter.close();
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_permission.js b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_permission.js
index bfb4b55856..17c22e156d 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_permission.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_permission.js
@@ -47,7 +47,7 @@ add_task(async function test_permissions() {
const frameScript = () => {
const messageListener = {
- async receiveMessage({ target, messageName, recipient, data, name }) {
+ async receiveMessage() {
/* globals content */
let doc = content.document;
let iframe = doc.createElement("iframe");
@@ -130,7 +130,7 @@ add_task(async function test_no_webRequestBlocking_error() {
browser.test.assertThrows(
() => {
browser.webRequest[eventName].addListener(
- details => {},
+ () => {},
{ urls: ["<all_urls>"] },
["blocking"]
);
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_redirectProperty.js b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_redirectProperty.js
index 5a448abb2a..91d13e8296 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_redirectProperty.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_redirectProperty.js
@@ -42,9 +42,9 @@ add_task(async function test_redirect_property() {
channel.asyncOpen({
QueryInterface: ChromeUtils.generateQI(["nsIStreamListener"]),
- onStartRequest(request) {},
+ onStartRequest() {},
- onStopRequest(request, statusCode) {
+ onStopRequest(request) {
let properties = request.QueryInterface(Ci.nsIPropertyBag);
let id = properties.getProperty("redirectedByExtension");
resolve({ id, url: request.QueryInterface(Ci.nsIChannel).URI.spec });
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_responseBody.js b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_responseBody.js
index 8995870ba6..3f94615db9 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_responseBody.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_responseBody.js
@@ -128,7 +128,7 @@ const TASKS = [
`(${num}): Got expected initial status`
);
- filter.onstart = event => {
+ filter.onstart = () => {
browser.test.assertEq(
"transferringdata",
filter.status,
@@ -136,7 +136,7 @@ const TASKS = [
);
};
- filter.onstop = event => {
+ filter.onstop = () => {
browser.test.fail(
`(${num}): Got unexpected onStop event while disconnected`
);
@@ -207,7 +207,7 @@ const TASKS = [
}
};
- filter.onerror = event => {
+ filter.onerror = () => {
browser.test.fail(
`(${num}): Got unexpected error event: ${filter.error}`
);
@@ -222,7 +222,7 @@ const TASKS = [
task(filter, resolve, num) {
let decoder = new TextDecoder("utf-8");
- filter.onstop = event => {
+ filter.onstop = () => {
browser.test.fail(
`(${num}): Got unexpected onStop event while disconnected`
);
@@ -254,7 +254,7 @@ const TASKS = [
}
};
- filter.onerror = event => {
+ filter.onerror = () => {
browser.test.fail(
`(${num}): Got unexpected error event: ${filter.error}`
);
@@ -269,7 +269,7 @@ const TASKS = [
task(filter, resolve, num) {
let encoder = new TextEncoder();
- filter.onstop = event => {
+ filter.onstop = () => {
browser.test.fail(
`(${num}): Got unexpected onStop event while disconnected`
);
@@ -330,7 +330,7 @@ const TASKS = [
}
};
- filter.onerror = event => {
+ filter.onerror = () => {
browser.test.fail(
`(${num}): Got unexpected error event: ${filter.error}`
);
@@ -346,7 +346,7 @@ const TASKS = [
let encoder = new TextEncoder();
let decoder = new TextDecoder("utf-8");
- filter.onstop = event => {
+ filter.onstop = () => {
browser.test.fail(`(${num}): Got unexpected onStop event while closed`);
};
@@ -406,7 +406,7 @@ const TASKS = [
}
};
- filter.onerror = event => {
+ filter.onerror = () => {
browser.test.fail(
`(${num}): Got unexpected error event: ${filter.error}`
);
@@ -422,11 +422,11 @@ const TASKS = [
let response = "";
let decoder = new TextDecoder("utf-8");
- filter.onstart = event => {
+ filter.onstart = () => {
browser.test.log(`(${num}): Request start`);
};
- filter.onstop = event => {
+ filter.onstop = () => {
browser.test.assertEq(
"finishedtransferringdata",
filter.status,
@@ -456,7 +456,7 @@ const TASKS = [
filter.write(event.data);
};
- filter.onerror = event => {
+ filter.onerror = () => {
browser.test.fail(
`(${num}): Got unexpected error event: ${filter.error}`
);
@@ -469,11 +469,11 @@ const TASKS = [
{
url: "multipart",
task(filter, resolve, num) {
- filter.onstart = event => {
+ filter.onstart = () => {
browser.test.log(`(${num}): Request start`);
};
- filter.onstop = event => {
+ filter.onstop = () => {
filter.disconnect();
resolve();
};
@@ -482,7 +482,7 @@ const TASKS = [
filter.write(event.data);
};
- filter.onerror = event => {
+ filter.onerror = () => {
browser.test.fail(
`(${num}): Got unexpected error event: ${filter.error}`
);
@@ -499,11 +499,11 @@ const TASKS = [
{
url: "multipart2",
task(filter, resolve, num) {
- filter.onstart = event => {
+ filter.onstart = () => {
browser.test.log(`(${num}): Request start`);
};
- filter.onstop = event => {
+ filter.onstop = () => {
filter.disconnect();
resolve();
};
@@ -512,7 +512,7 @@ const TASKS = [
filter.write(event.data);
};
- filter.onerror = event => {
+ filter.onerror = () => {
browser.test.fail(
`(${num}): Got unexpected error event: ${filter.error}`
);
@@ -628,7 +628,7 @@ add_task(async function test_cachedResponse() {
data => {
let filter = browser.webRequest.filterResponseData(data.requestId);
- filter.onstop = event => {
+ filter.onstop = () => {
filter.close();
};
filter.ondata = event => {
@@ -669,7 +669,7 @@ add_task(async function test_late_close() {
data => {
let filter = browser.webRequest.filterResponseData(data.requestId);
- filter.onstop = event => {
+ filter.onstop = () => {
browser.test.fail("Should not receive onstop after close()");
browser.test.assertEq(
"closed",
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_startup.js b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_startup.js
index 616dc1fb50..2765fe949d 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_startup.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_startup.js
@@ -89,7 +89,7 @@ add_task(async function test_nonblocking() {
background() {
browser.webRequest.onBeforeRequest.addListener(
- details => {
+ () => {
browser.test.sendMessage("got-request");
},
{ urls: ["http://example.com/data/file_sample.html"] }
@@ -163,7 +163,7 @@ add_task(async function test_eventpage_nonblocking() {
background() {
browser.webRequest.onBeforeRequest.addListener(
- details => {
+ () => {
browser.test.sendMessage("got-request");
},
{ urls: ["http://example.com/data/file_sample.html"] }
@@ -237,7 +237,7 @@ add_task(async function test_persistent_blocking() {
background() {
browser.webRequest.onBeforeRequest.addListener(
- details => {
+ () => {
browser.test.fail("Listener should not have been called");
},
{ urls: ["http://test1.example.com/*"] },
@@ -290,7 +290,7 @@ add_task(async function test_persistent_listener_after_sideload_upgrade() {
background() {
browser.webRequest.onBeforeRequest.addListener(
- details => {
+ () => {
browser.test.sendMessage("got-request");
},
{ urls: ["http://example.com/data/file_sample.html"] },
@@ -405,7 +405,7 @@ add_task(
});
browser.webRequest.onBeforeRequest.addListener(
- details => {
+ () => {
browser.test.sendMessage("got-request");
},
{ urls: ["http://example.com/data/file_sample.html"] },
@@ -501,14 +501,14 @@ add_task(async function test_persistent_listener_after_staged_upgrade() {
background() {
browser.webRequest.onBeforeRequest.addListener(
- details => {
+ () => {
browser.test.sendMessage("got-request");
},
{ urls: ["http://example.com/data/file_sample.html"] },
["blocking"]
);
browser.webRequest.onSendHeaders.addListener(
- details => {
+ () => {
browser.test.sendMessage("got-sendheaders");
},
{ urls: ["http://example.com/data/file_sample.html"] }
@@ -540,20 +540,20 @@ add_task(async function test_persistent_listener_after_staged_upgrade() {
delete extensionData.manifest.optional_permissions;
extensionData.background = function () {
browser.webRequest.onBeforeRequest.addListener(
- details => {
+ () => {
browser.test.sendMessage("got-request");
},
{ urls: ["http://example.com/data/file_sample.html"] },
["blocking"]
);
browser.webRequest.onBeforeSendHeaders.addListener(
- details => {
+ () => {
browser.test.sendMessage("got-beforesendheaders");
},
{ urls: ["http://example.com/data/file_sample.html"] }
);
browser.webRequest.onSendHeaders.addListener(
- details => {
+ () => {
browser.test.sendMessage("got-sendheaders");
},
{ urls: ["http://example.com/data/file_sample.html"] }
@@ -688,7 +688,7 @@ add_task(async function test_persistent_listener_after_permission_removal() {
background() {
browser.webRequest.onBeforeRequest.addListener(
- details => {
+ () => {
browser.test.sendMessage("got-request");
},
{ urls: ["http://example.com/data/file_sample.html"] },
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_suspend.js b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_suspend.js
index f8116aced0..52af6a9b3d 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_suspend.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_suspend.js
@@ -31,7 +31,7 @@ add_task(async function test_suspend() {
background() {
browser.webRequest.onBeforeSendHeaders.addListener(
- details => {
+ () => {
// Make sure that returning undefined or a promise that resolves to
// undefined does not break later handlers.
},
@@ -40,7 +40,7 @@ add_task(async function test_suspend() {
);
browser.webRequest.onBeforeSendHeaders.addListener(
- details => {
+ () => {
return Promise.resolve();
},
{ urls: ["<all_urls>"] },
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_viewsource.js b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_viewsource.js
index 35b713e59b..5c59cbd924 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_viewsource.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_viewsource.js
@@ -51,7 +51,7 @@ add_task(async function test_webRequest_viewsource() {
);
browser.webRequest.onCompleted.addListener(
- details => {
+ () => {
// If cancel fails we get onCompleted.
browser.test.fail("onCompleted received");
},
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_webSocket.js b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_webSocket.js
index 7e34d2b0b3..1bd5b54f2b 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_webSocket.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_webSocket.js
@@ -28,14 +28,14 @@ add_task(async function test_webSocket() {
["blocking"]
);
- browser.test.onMessage.addListener(msg => {
+ browser.test.onMessage.addListener(() => {
let ws = new WebSocket("ws://example.com/dummy");
- ws.onopen = e => {
+ ws.onopen = () => {
ws.send("data");
};
- ws.onclose = e => {};
- ws.onerror = e => {};
- ws.onmessage = e => {
+ ws.onclose = () => {};
+ ws.onerror = () => {};
+ ws.onmessage = () => {
ws.close();
};
});
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_web_accessible_resources.js b/toolkit/components/extensions/test/xpcshell/test_ext_web_accessible_resources.js
index 0b34dd8127..e7f35da711 100644
--- a/toolkit/components/extensions/test/xpcshell/test_ext_web_accessible_resources.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_web_accessible_resources.js
@@ -12,7 +12,7 @@ const IMAGE_ARRAYBUFFER = Uint8Array.from(image, byte =>
).buffer;
async function testImageLoading(src, expectedAction) {
- let imageLoadingPromise = new Promise((resolve, reject) => {
+ let imageLoadingPromise = new Promise(resolve => {
let cleanupListeners;
let testImage = document.createElement("img");
// Set the src via wrappedJSObject so the load is triggered with the
@@ -50,7 +50,7 @@ async function testImageLoading(src, expectedAction) {
add_task(async function test_web_accessible_resources_csp() {
function background() {
- browser.runtime.onMessage.addListener((msg, sender) => {
+ browser.runtime.onMessage.addListener(msg => {
if (msg.name === "image-loading") {
browser.test.assertTrue(msg.success, `Image was ${msg.expectedAction}`);
browser.test.sendMessage(`image-${msg.expectedAction}`);
@@ -63,7 +63,7 @@ add_task(async function test_web_accessible_resources_csp() {
}
function content() {
- window.addEventListener("message", function rcv(event) {
+ window.addEventListener("message", function rcv() {
browser.runtime.sendMessage("script-ran");
window.removeEventListener("message", rcv);
});
@@ -116,7 +116,7 @@ add_task(async function test_web_accessible_resources_csp() {
await page.legacySpawn(null, () => {
this.obs = {
events: [],
- observe(subject, topic, data) {
+ observe(subject) {
this.events.push(subject.QueryInterface(Ci.nsIURI).spec);
},
done() {
diff --git a/toolkit/components/extensions/test/xpcshell/test_native_manifests.js b/toolkit/components/extensions/test/xpcshell/test_native_manifests.js
index 6a6fb91e3f..1f5bc88740 100644
--- a/toolkit/components/extensions/test/xpcshell/test_native_manifests.js
+++ b/toolkit/components/extensions/test/xpcshell/test_native_manifests.js
@@ -313,7 +313,7 @@ add_task(async function test_manifest_with_invalid_utf_8() {
);
equal(result, null, "lookupApplication should reject file with invalid UTF8");
let errorPattern =
- /NotReadableError: Could not read file.* because it is not UTF-8 encoded/;
+ /NotReadableError: Could not read `.*': file is not UTF-8 encoded/;
let utf8Errors = messages.filter(({ message }) => errorPattern.test(message));
equal(utf8Errors.length, 1, "lookupApplication logs error about UTF-8");
});
diff --git a/toolkit/components/extensions/test/xpcshell/test_proxy_failover.js b/toolkit/components/extensions/test/xpcshell/test_proxy_failover.js
index bca71df63e..699b57b757 100644
--- a/toolkit/components/extensions/test/xpcshell/test_proxy_failover.js
+++ b/toolkit/components/extensions/test/xpcshell/test_proxy_failover.js
@@ -95,7 +95,7 @@ add_task(async function setup() {
async function getProxyExtension(proxyDetails) {
async function background(proxyDetails) {
browser.proxy.onRequest.addListener(
- details => {
+ () => {
return proxyDetails;
},
{ urls: ["<all_urls>"] }
@@ -165,7 +165,7 @@ add_task(
contentUrl,
`${contentUrl}?t=${Math.random()}`
)
- .then(text => {
+ .then(() => {
ok(false, "xhr unexpectedly completed");
})
.catch(e => {
@@ -196,7 +196,7 @@ add_task(
equal(req.proxy.type, "direct", "proxy failover to direct");
equal(req.text, "ok!", "xhr completed");
})
- .catch(req => {
+ .catch(() => {
ok(false, "xhr failed");
});
diff --git a/toolkit/components/extensions/test/xpcshell/test_proxy_info_results.js b/toolkit/components/extensions/test/xpcshell/test_proxy_info_results.js
index 0a7e1422d2..7a4aea9c4f 100644
--- a/toolkit/components/extensions/test/xpcshell/test_proxy_info_results.js
+++ b/toolkit/components/extensions/test/xpcshell/test_proxy_info_results.js
@@ -57,14 +57,14 @@ async function testProxyResolution(test) {
if (expected.error) {
errorMsg = extension.awaitMessage("proxy-error-received");
}
- let proxyInfo = await new Promise((resolve, reject) => {
+ let proxyInfo = await new Promise(resolve => {
let channel = NetUtil.newChannel({
uri,
loadUsingSystemPrincipal: true,
});
gProxyService.asyncResolve(channel, 0, {
- onProxyAvailable(req, uri, pi, status) {
+ onProxyAvailable(req, uri, pi) {
resolve(pi && pi.QueryInterface(Ci.nsIProxyInfo));
},
});
@@ -186,14 +186,15 @@ add_task(async function test_proxyInfo_results() {
{
proxy: [
{
- type: "http",
+ type: "socks",
host: "foo.bar",
port: 3128,
proxyAuthorizationHeader: "test",
},
],
expected: {
- error: 'ProxyInfoData: ProxyAuthorizationHeader requires type "https"',
+ error:
+ 'ProxyInfoData: ProxyAuthorizationHeader requires type "https" or "http"',
},
},
{
@@ -447,6 +448,26 @@ add_task(async function test_proxyInfo_results() {
},
},
},
+ {
+ proxy: [
+ {
+ type: "http",
+ host: "foo.bar",
+ port: 3128,
+ proxyAuthorizationHeader: "test",
+ connectionIsolationKey: "key",
+ },
+ ],
+ expected: {
+ proxyInfo: {
+ host: "foo.bar",
+ port: "3128",
+ type: "http",
+ proxyAuthorizationHeader: "test",
+ connectionIsolationKey: "key",
+ },
+ },
+ },
];
for (let test of tests) {
await setupProxyResult(test.proxy);
diff --git a/toolkit/components/extensions/test/xpcshell/test_proxy_listener.js b/toolkit/components/extensions/test/xpcshell/test_proxy_listener.js
index 8cc46d45e7..ef72e9ab75 100644
--- a/toolkit/components/extensions/test/xpcshell/test_proxy_listener.js
+++ b/toolkit/components/extensions/test/xpcshell/test_proxy_listener.js
@@ -11,14 +11,14 @@ const TRANSPARENT_PROXY_RESOLVES_HOST =
Ci.nsIProxyInfo.TRANSPARENT_PROXY_RESOLVES_HOST;
function getProxyInfo(url = "http://www.mozilla.org/") {
- return new Promise((resolve, reject) => {
+ return new Promise(resolve => {
let channel = NetUtil.newChannel({
uri: url,
loadUsingSystemPrincipal: true,
});
gProxyService.asyncResolve(channel, 0, {
- onProxyAvailable(req, uri, pi, status) {
+ onProxyAvailable(req, uri, pi) {
resolve(pi);
},
});
@@ -214,7 +214,7 @@ async function getExtension(expectedProxyInfo) {
`testing proxy.onRequest with proxyInfo = ${JSON.stringify(proxyInfo)}`
);
browser.proxy.onRequest.addListener(
- details => {
+ () => {
return proxyInfo;
},
{ urls: ["<all_urls>"] }
diff --git a/toolkit/components/extensions/test/xpcshell/test_webRequest_filtering.js b/toolkit/components/extensions/test/xpcshell/test_webRequest_filtering.js
index a7157f19a4..46a72a5926 100644
--- a/toolkit/components/extensions/test/xpcshell/test_webRequest_filtering.js
+++ b/toolkit/components/extensions/test/xpcshell/test_webRequest_filtering.js
@@ -73,7 +73,7 @@ function compareLists(list1, list2, kind) {
equal(String(list1), String(list2), `${kind} URLs correct`);
}
-async function openAndCloseContentPage(url) {
+async function openAndCloseContentPage() {
let contentPage = await ExtensionTestUtils.loadContentPage(URL);
// Clear the sheet cache so that it doesn't interact with following tests: A
// stylesheet with the same URI loaded from the same origin doesn't otherwise
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");