diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /toolkit/components/extensions/test/mochitest | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-upstream/125.0.1.tar.xz firefox-upstream/125.0.1.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/extensions/test/mochitest')
39 files changed, 64 insertions, 64 deletions
diff --git a/toolkit/components/extensions/test/mochitest/chrome_cleanup_script.js b/toolkit/components/extensions/test/mochitest/chrome_cleanup_script.js index 9afa95f302..2c54bea61c 100644 --- a/toolkit/components/extensions/test/mochitest/chrome_cleanup_script.js +++ b/toolkit/components/extensions/test/mochitest/chrome_cleanup_script.js @@ -35,7 +35,7 @@ for (let win of iterBrowserWindows()) { initialTabs.set(win, new Set(getBrowserApp(win).tabs)); } -addMessageListener("check-cleanup", extensionId => { +addMessageListener("check-cleanup", () => { Services.console.unregisterListener(listener); let results = { diff --git a/toolkit/components/extensions/test/mochitest/file_indexedDB.html b/toolkit/components/extensions/test/mochitest/file_indexedDB.html index 65b7e0ad2f..ce4b96f079 100644 --- a/toolkit/components/extensions/test/mochitest/file_indexedDB.html +++ b/toolkit/components/extensions/test/mochitest/file_indexedDB.html @@ -15,7 +15,7 @@ request.onupgradeneeded = event => { let objectStore = db.createObjectStore(objectStoreName, {autoIncrement: 0}); request = objectStore.add(test.value, test.key); - request.onsuccess = event => { + request.onsuccess = () => { db.close(); window.postMessage("indexedDBCreated", "*"); }; diff --git a/toolkit/components/extensions/test/mochitest/file_simple_iframe_worker.html b/toolkit/components/extensions/test/mochitest/file_simple_iframe_worker.html index 2ecc24e648..d0c2f59844 100644 --- a/toolkit/components/extensions/test/mochitest/file_simple_iframe_worker.html +++ b/toolkit/components/extensions/test/mochitest/file_simple_iframe_worker.html @@ -11,12 +11,12 @@ fetch("file_simple_iframe.txt"); const worker = new Worker("file_simple_worker.js?iniframe=true"); -worker.onmessage = (msg) => { +worker.onmessage = () => { worker.postMessage("file_simple_iframe_worker.txt"); } const sharedworker = new SharedWorker("file_simple_sharedworker.js?iniframe=true"); -sharedworker.port.onmessage = (msg) => { +sharedworker.port.onmessage = () => { sharedworker.port.postMessage("file_simple_iframe_sharedworker.txt"); } sharedworker.port.start(); diff --git a/toolkit/components/extensions/test/mochitest/file_simple_webrequest_worker.html b/toolkit/components/extensions/test/mochitest/file_simple_webrequest_worker.html index a90c4509be..792fc5621b 100644 --- a/toolkit/components/extensions/test/mochitest/file_simple_webrequest_worker.html +++ b/toolkit/components/extensions/test/mochitest/file_simple_webrequest_worker.html @@ -11,12 +11,12 @@ fetch("file_simple_toplevel.txt"); const worker = new Worker("file_simple_worker.js"); -worker.onmessage = (msg) => { +worker.onmessage = () => { worker.postMessage("file_simple_worker.txt"); } const sharedworker = new SharedWorker("file_simple_sharedworker.js"); -sharedworker.port.onmessage = (msg) => { +sharedworker.port.onmessage = () => { dump(`postMessage to sharedworker\n`); sharedworker.port.postMessage("file_simple_sharedworker.txt"); } diff --git a/toolkit/components/extensions/test/mochitest/head_cookies.js b/toolkit/components/extensions/test/mochitest/head_cookies.js index 610c800c94..80c7f96266 100644 --- a/toolkit/components/extensions/test/mochitest/head_cookies.js +++ b/toolkit/components/extensions/test/mochitest/head_cookies.js @@ -30,7 +30,7 @@ async function testCookies(options) { let { url, domain, secure } = backgroundOptions; let failures = 0; - let tallyFailure = error => { + let tallyFailure = () => { failures++; }; diff --git a/toolkit/components/extensions/test/mochitest/head_webrequest.js b/toolkit/components/extensions/test/mochitest/head_webrequest.js index 9e6b5cc910..c40fd06619 100644 --- a/toolkit/components/extensions/test/mochitest/head_webrequest.js +++ b/toolkit/components/extensions/test/mochitest/head_webrequest.js @@ -200,7 +200,7 @@ function background(events) { } let listeners = { - onBeforeRequest(expected, details, result) { + onBeforeRequest(expected, details) { // Save some values to test request consistency in later events. browser.test.assertTrue( details.tabId !== undefined, @@ -263,7 +263,7 @@ function background(events) { } }, onBeforeRedirect() {}, - onSendHeaders(expected, details, result) { + onSendHeaders(expected, details) { if (expected.headers && expected.headers.request) { checkHeaders("request", expected, details); } @@ -287,7 +287,7 @@ function background(events) { onAuthRequired(expected, details, result) { result.authCredentials = expected.authInfo; }, - onCompleted(expected, details, result) { + onCompleted(expected, details) { // If we have already completed a GET request for this url, // and it was found, we expect for the response to come fromCache. // expected.cached may be undefined, force boolean. @@ -322,7 +322,7 @@ function background(events) { checkHeaders("response", expected, details); } }, - onErrorOccurred(expected, details, result) { + onErrorOccurred(expected, details) { if (expected.error) { if (Array.isArray(expected.error)) { browser.test.assertTrue( diff --git a/toolkit/components/extensions/test/mochitest/mochitest-common.toml b/toolkit/components/extensions/test/mochitest/mochitest-common.toml index 51a851a74b..782069a79c 100644 --- a/toolkit/components/extensions/test/mochitest/mochitest-common.toml +++ b/toolkit/components/extensions/test/mochitest/mochitest-common.toml @@ -130,6 +130,7 @@ skip-if = ["os == 'android'"] # only the current window is supported - bug 17959 ["test_ext_browserAction_openPopup_without_pref.html"] ["test_ext_browserSettings_overrideDocumentColors.html"] +skip-if = ["os == 'android'"] # bug 1876317 ["test_ext_browsingData_indexedDB.html"] skip-if = [ diff --git a/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_saveAs.html b/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_saveAs.html index 4b5d90814c..b026ea6245 100644 --- a/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_saveAs.html +++ b/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_saveAs.html @@ -78,7 +78,7 @@ add_task(async function test_downloads_saveAs() { defaultFile.append(DOWNLOAD_FILENAME); const {MockFilePicker} = SpecialPowers; - MockFilePicker.init(window); + MockFilePicker.init(SpecialPowers.wrap(window).browsingContext); function mockFilePickerCallback(expectedStartingDir, pickedFile) { return fp => { diff --git a/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_uniquify.html b/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_uniquify.html index 99a6c48500..35a0bb13df 100644 --- a/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_uniquify.html +++ b/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_uniquify.html @@ -42,7 +42,7 @@ add_task(async function test_downloads_uniquify() { unique.append("file_download(1).txt"); const {MockFilePicker} = SpecialPowers; - MockFilePicker.init(window); + MockFilePicker.init(SpecialPowers.wrap(window).browsingContext); MockFilePicker.returnValue = MockFilePicker.returnOK; MockFilePicker.showCallback = fp => { diff --git a/toolkit/components/extensions/test/mochitest/test_chrome_ext_permissions.html b/toolkit/components/extensions/test/mochitest/test_chrome_ext_permissions.html index 65bf0a50d0..98a9fed30e 100644 --- a/toolkit/components/extensions/test/mochitest/test_chrome_ext_permissions.html +++ b/toolkit/components/extensions/test/mochitest/test_chrome_ext_permissions.html @@ -67,7 +67,7 @@ function makeTest(manifestPermissions, optionalPermissions, checkFetch = true) { let url = new URL(window.location.pathname, "http://example.com/"); fetch(url, {}).then(response => { browser.test.sendMessage("fetch.result", response.ok); - }).catch(err => { + }).catch(() => { browser.test.sendMessage("fetch.result", false); }); }, diff --git a/toolkit/components/extensions/test/mochitest/test_chrome_ext_webrequest_background_events.html b/toolkit/components/extensions/test/mochitest/test_chrome_ext_webrequest_background_events.html index 4caa4d2464..3f824276d6 100644 --- a/toolkit/components/extensions/test/mochitest/test_chrome_ext_webrequest_background_events.html +++ b/toolkit/components/extensions/test/mochitest/test_chrome_ext_webrequest_background_events.html @@ -38,7 +38,7 @@ let testExtension = { "onCompleted", ]; - function listener(name, details) { + function listener(name) { // If we get anything, we failed. Removing the system principal check // in ext-webrequest triggers this failure. browser.test.fail(`received ${name}`); @@ -58,7 +58,7 @@ add_task(async function test_webRequest_chromeworker_events() { await extension.startup(); await new Promise(resolve => { let worker = new ChromeWorker("webrequest_chromeworker.js"); - worker.onmessage = event => { + worker.onmessage = () => { ok("chrome worker fetch finished"); resolve(); }; diff --git a/toolkit/components/extensions/test/mochitest/test_chrome_ext_webrequest_mozextension.html b/toolkit/components/extensions/test/mochitest/test_chrome_ext_webrequest_mozextension.html index 6a41b9cf08..36de902180 100644 --- a/toolkit/components/extensions/test/mochitest/test_chrome_ext_webrequest_mozextension.html +++ b/toolkit/components/extensions/test/mochitest/test_chrome_ext_webrequest_mozextension.html @@ -82,7 +82,7 @@ add_task(async function test_webRequest_mozextension_fetch() { browser.test.sendMessage("request-complete"); }, {urls: [browser.runtime.getURL("*")]}); - browser.test.onMessage.addListener((msg, data) => { + browser.test.onMessage.addListener(() => { fetch(page).then(() => { browser.test.notifyPass("fetch success"); browser.test.sendMessage("done"); diff --git a/toolkit/components/extensions/test/mochitest/test_ext_activityLog.html b/toolkit/components/extensions/test/mochitest/test_ext_activityLog.html index c426913373..ac0ec974dc 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_activityLog.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_activityLog.html @@ -27,7 +27,7 @@ add_task(async function test_api() { // This privileged test extension should not affect the webRequest // data received by non-privileged extensions (See Bug 1576272). browser.webRequest.onBeforeRequest.addListener( - details => { + () => { return { cancel: false }; }, { urls: ["http://mochi.test/*/file_sample.html"] }, @@ -79,7 +79,7 @@ add_task(async function test_api() { browser.storage.onChanged.removeListener(listen); // Test a parent event manager. - let webRequestListener = details => { + let webRequestListener = () => { browser.webRequest.onBeforeRequest.removeListener(webRequestListener); return { cancel: false }; }; diff --git a/toolkit/components/extensions/test/mochitest/test_ext_async_clipboard.html b/toolkit/components/extensions/test/mochitest/test_ext_async_clipboard.html index 4bd8339357..708b5522c3 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_async_clipboard.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_async_clipboard.html @@ -154,7 +154,7 @@ add_task(async function test_contentscript_clipboard_permission_writetext() { clipboardWriteText(str).then(function() { // nothing here browser.test.sendMessage("ready"); - }, function(err) { + }, function() { browser.test.fail("WriteText promise rejected"); browser.test.sendMessage("ready"); }); // clipboardWriteText @@ -196,7 +196,7 @@ add_task(async function test_contentscript_clipboard_permission_readtext() { browser.test.fail("ReadText read the wrong thing from clipboard:" + strData); } browser.test.sendMessage("ready"); - }, function(err) { + }, function() { browser.test.fail("ReadText promise rejected"); browser.test.sendMessage("ready"); }); // clipboardReadText @@ -237,7 +237,7 @@ add_task(async function test_contentscript_clipboard_permission_write() { clipboardWrite([item]).then(function() { // nothing here browser.test.sendMessage("ready"); - }, function(err) { // clipboardWrite promise error function + }, function() { // clipboardWrite promise error function browser.test.fail("Write promise rejected"); browser.test.sendMessage("ready"); }); // clipboard write @@ -280,7 +280,7 @@ add_task(async function test_contentscript_clipboard_permission_read() { browser.test.fail("Read read the wrong string from clipboard:" + s); } browser.test.sendMessage("ready"); - }, function(err) { // clipboardRead promise error function + }, function() { // clipboardRead promise error function browser.test.fail("Read promise rejected"); browser.test.sendMessage("ready"); }); // clipboard read diff --git a/toolkit/components/extensions/test/mochitest/test_ext_browsingData_indexedDB.html b/toolkit/components/extensions/test/mochitest/test_ext_browsingData_indexedDB.html index f8ea41ddab..0d417cbb5f 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_browsingData_indexedDB.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_browsingData_indexedDB.html @@ -52,7 +52,7 @@ add_task(async function testIndexedDB() { // eslint-disable-next-line mozilla/balanced-listeners window.addEventListener( "message", - msg => { + () => { browser.test.sendMessage("indexedDBCreated"); }, true diff --git a/toolkit/components/extensions/test/mochitest/test_ext_browsingData_localStorage.html b/toolkit/components/extensions/test/mochitest/test_ext_browsingData_localStorage.html index 2fd608f125..0e36139f14 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_browsingData_localStorage.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_browsingData_localStorage.html @@ -177,7 +177,7 @@ add_task(async function testLocalStorage() { function awaitLoad(tabId) { return new Promise(resolve => { - browser.tabs.onUpdated.addListener(function listener(tabId_, changed, tab) { + browser.tabs.onUpdated.addListener(function listener(tabId_, changed) { if (tabId == tabId_ && changed.status == "complete") { browser.tabs.onUpdated.removeListener(listener); resolve(); diff --git a/toolkit/components/extensions/test/mochitest/test_ext_browsingData_serviceWorkers.html b/toolkit/components/extensions/test/mochitest/test_ext_browsingData_serviceWorkers.html index d8ebd8e225..36ec448ccd 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_browsingData_serviceWorkers.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_browsingData_serviceWorkers.html @@ -33,7 +33,7 @@ add_task(async function testServiceWorkers() { const PAGE = "/tests/toolkit/components/extensions/test/mochitest/file_serviceWorker.html"; - browser.runtime.onMessage.addListener(msg => { + browser.runtime.onMessage.addListener(() => { browser.test.sendMessage("serviceWorkerRegistered"); }); diff --git a/toolkit/components/extensions/test/mochitest/test_ext_browsingData_settings.html b/toolkit/components/extensions/test/mochitest/test_ext_browsingData_settings.html index 11c690e5bf..b36daf9b8d 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_browsingData_settings.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_browsingData_settings.html @@ -42,16 +42,16 @@ add_task(async function testSettings() { // Verify that we get the keys back we expect. isDeeply( Object.entries(settings.dataToRemove) - .filter(([key, value]) => value) - .map(([key, value]) => key) + .filter(([, value]) => value) + .map(([key]) => key) .sort(), SETTINGS_LIST, "dataToRemove contains expected properties." ); isDeeply( Object.entries(settings.dataRemovalPermitted) - .filter(([key, value]) => value) - .map(([key, value]) => key) + .filter(([, value]) => value) + .map(([key]) => key) .sort(), SETTINGS_LIST, "dataToRemove contains expected properties." diff --git a/toolkit/components/extensions/test/mochitest/test_ext_exclude_include_globs.html b/toolkit/components/extensions/test/mochitest/test_ext_exclude_include_globs.html index f87b5620d6..8d425656e0 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_exclude_include_globs.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_exclude_include_globs.html @@ -14,7 +14,7 @@ add_task(async function test_contentscript() { function background() { - browser.runtime.onMessage.addListener(([script], sender) => { + browser.runtime.onMessage.addListener(([script]) => { browser.test.sendMessage("run", {script}); browser.test.sendMessage("run-" + script); }); @@ -65,7 +65,7 @@ add_task(async function test_contentscript() { let extension = ExtensionTestUtils.loadExtension(extensionData); let ran = 0; - extension.onMessage("run", ({script}) => { + extension.onMessage("run", () => { ran++; }); diff --git a/toolkit/components/extensions/test/mochitest/test_ext_extension_iframe_messaging.html b/toolkit/components/extensions/test/mochitest/test_ext_extension_iframe_messaging.html index 403782ab7d..2b47a9c0f7 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_extension_iframe_messaging.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_extension_iframe_messaging.html @@ -72,7 +72,7 @@ add_task(async function test_moz_extension_iframe_messaging() { }, }, background() { - browser.test.onMessage.addListener(async msg => { + browser.test.onMessage.addListener(async () => { await browser.test.assertRejects( browser.runtime.sendMessage("from-background"), diff --git a/toolkit/components/extensions/test/mochitest/test_ext_redirect_jar.html b/toolkit/components/extensions/test/mochitest/test_ext_redirect_jar.html index 18ff14a6de..c21b18de95 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_redirect_jar.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_redirect_jar.html @@ -46,7 +46,7 @@ function getExtension() { }, background: async () => { let redirectUrl = browser.runtime.getURL("finished.html"); - browser.webRequest.onBeforeRequest.addListener(details => { + browser.webRequest.onBeforeRequest.addListener(() => { return {redirectUrl}; }, {urls: ["*://*/intercept*"]}, ["blocking"]); diff --git a/toolkit/components/extensions/test/mochitest/test_ext_request_urlClassification.html b/toolkit/components/extensions/test/mochitest/test_ext_request_urlClassification.html index a139e94687..fa4bd0a05d 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_request_urlClassification.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_request_urlClassification.html @@ -115,7 +115,7 @@ add_task(async function teardown() { /* eslint-env mozilla/chrome-script */ // Cleanup cache await new Promise(resolve => { - Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, value => resolve()); + Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, () => resolve()); }); const {UrlClassifierTestUtils} = ChromeUtils.importESModule( diff --git a/toolkit/components/extensions/test/mochitest/test_ext_sendmessage_doublereply.html b/toolkit/components/extensions/test/mochitest/test_ext_sendmessage_doublereply.html index ffdbc90efb..6958e906b9 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_sendmessage_doublereply.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_sendmessage_doublereply.html @@ -41,7 +41,7 @@ function background() { } let done_count = 0; - browser.runtime.onMessage.addListener((msg, sender, sendReply) => { + browser.runtime.onMessage.addListener((msg, sender) => { browser.test.assertTrue(sender.tab.url.endsWith("file_sample.html"), "sender url correct"); if (msg == "done") { diff --git a/toolkit/components/extensions/test/mochitest/test_ext_sendmessage_reply2.html b/toolkit/components/extensions/test/mochitest/test_ext_sendmessage_reply2.html index 8cce833b49..5da378de2b 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_sendmessage_reply2.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_sendmessage_reply2.html @@ -54,7 +54,7 @@ function backgroundScript(token, id, otherId) { function contentScript(token, id, otherId) { let gotContentMessage = false; - browser.runtime.onMessage.addListener((msg, sender, sendReply) => { + browser.runtime.onMessage.addListener((msg, sender) => { browser.test.assertEq(id, sender.id, `${id}: Got expected sender ID`); browser.test.assertEq(`${token}-contentMessage`, msg, @@ -83,7 +83,7 @@ function contentScript(token, id, otherId) { async function tabScript(token, id, otherId) { let gotTabMessage = false; - browser.runtime.onMessage.addListener((msg, sender, sendReply) => { + browser.runtime.onMessage.addListener((msg, sender) => { browser.test.assertEq(id, sender.id, `${id}: Got expected sender ID`); if (String(msg).startsWith("content-")) { diff --git a/toolkit/components/extensions/test/mochitest/test_ext_storage_cleanup.html b/toolkit/components/extensions/test/mochitest/test_ext_storage_cleanup.html index 33029cf61e..e6a885a3c7 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_storage_cleanup.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_storage_cleanup.html @@ -71,7 +71,7 @@ const storageTestHelpers = { reject(new Error(`indexedDB open failed with ${e.errorCode}`)); }; - req.onupgradeneeded = e => { + req.onupgradeneeded = () => { // no database, data is not present resolve(false); }; diff --git a/toolkit/components/extensions/test/mochitest/test_ext_streamfilter_multiple.html b/toolkit/components/extensions/test/mochitest/test_ext_streamfilter_multiple.html index d1bfbd824b..50d7d6cb7d 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_streamfilter_multiple.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_streamfilter_multiple.html @@ -53,7 +53,7 @@ add_task(async () => { filter.ondata = event => { filter.write(event.data); }; - filter.onstop = event => { + filter.onstop = () => { filter.write(new TextEncoder().encode(" End")); filter.close(); }; diff --git a/toolkit/components/extensions/test/mochitest/test_ext_streamfilter_processswitch.html b/toolkit/components/extensions/test/mochitest/test_ext_streamfilter_processswitch.html index 049178cad0..7240e01c02 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_streamfilter_processswitch.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_streamfilter_processswitch.html @@ -36,7 +36,7 @@ add_task(async () => { filter.ondata = event => { filter.write(event.data); }; - filter.onstop = event => { + filter.onstop = () => { filter.write(new TextEncoder().encode(" End")); filter.close(); }; diff --git a/toolkit/components/extensions/test/mochitest/test_ext_subframes_privileges.html b/toolkit/components/extensions/test/mochitest/test_ext_subframes_privileges.html index fd034f0b65..f791d08602 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_subframes_privileges.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_subframes_privileges.html @@ -303,7 +303,7 @@ add_task(async function test_sub_subframe_conduit_verified_env() { `, }; - async function expectErrors(ext, log) { + async function expectErrors(ext) { let err = await ext.awaitMessage("content_child"); is(err, "Bad sender context envType: content_child"); diff --git a/toolkit/components/extensions/test/mochitest/test_ext_tabs_executeScript_good.html b/toolkit/components/extensions/test/mochitest/test_ext_tabs_executeScript_good.html index 9b0f41f789..0704b93be9 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_tabs_executeScript_good.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_tabs_executeScript_good.html @@ -16,7 +16,7 @@ async function testHasPermission(params) { let contentSetup = params.contentSetup || (() => Promise.resolve()); async function background(contentSetup) { - browser.runtime.onMessage.addListener((msg, sender) => { + browser.runtime.onMessage.addListener((msg) => { browser.test.assertEq(msg, "script ran", "script ran"); browser.test.notifyPass("executeScript"); }); diff --git a/toolkit/components/extensions/test/mochitest/test_ext_tabs_permissions.html b/toolkit/components/extensions/test/mochitest/test_ext_tabs_permissions.html index 217139f12b..062e3a79e3 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_tabs_permissions.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_tabs_permissions.html @@ -69,8 +69,7 @@ const helperExtensionDef = { hasTitleChangeInfo = false; browser.tabs.onUpdated.addListener(function listener( tabId, - changeInfo, - tab + changeInfo ) { if (changeInfo.url?.endsWith(message.data.urlHash)) { hasURLChangeInfo = true; @@ -413,7 +412,7 @@ async function test_restricted_properties( let hasURLChangeInfo = false, hasTitleChangeInfo = false; - function onUpdateListener(tabId, changeInfo, tab) { + function onUpdateListener(tabId, changeInfo) { if (changeInfo.url?.endsWith(urlHash)) { hasURLChangeInfo = true; } @@ -550,7 +549,7 @@ async function test_onUpdateFilter(testCases, permissions) { async background() { let listenerGotCalled = false; - function onUpdateListener(tabId, changeInfo, tab) { + function onUpdateListener() { listenerGotCalled = true; } diff --git a/toolkit/components/extensions/test/mochitest/test_ext_web_accessible_incognito.html b/toolkit/components/extensions/test/mochitest/test_ext_web_accessible_incognito.html index d1c41d2030..1009eb0496 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_web_accessible_incognito.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_web_accessible_incognito.html @@ -17,7 +17,7 @@ let image = atob("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAA" + const IMAGE_ARRAYBUFFER = Uint8Array.from(image, byte => byte.charCodeAt(0)).buffer; async function testImageLoading(src, expectedAction) { - let imageLoadingPromise = new Promise((resolve, reject) => { + let imageLoadingPromise = new Promise((resolve) => { let cleanupListeners; let testImage = new window.Image(); // Set the src via wrappedJSObject so the load is triggered with the diff --git a/toolkit/components/extensions/test/mochitest/test_ext_web_accessible_resources.html b/toolkit/components/extensions/test/mochitest/test_ext_web_accessible_resources.html index c13e40e265..c8ab397e4a 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_web_accessible_resources.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_web_accessible_resources.html @@ -27,7 +27,7 @@ const IMAGE_ARRAYBUFFER = Uint8Array.from(image, byte => byte.charCodeAt(0)) const ANDROID = navigator.userAgent.includes("Android"); 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 diff --git a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_auth.html b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_auth.html index f260f040a1..ec5f00a18c 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_auth.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_auth.html @@ -79,13 +79,13 @@ add_task(async function test_webRequest_auth_nonblocking_forwardAuthProvider() { "nsIAuthPrompt2"]), getInterface: ChromeUtils.generateQI(["nsIAuthPromptProvider", "nsIAuthPrompt2"]), - promptAuth(channel, level, authInfo) { + promptAuth() { throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE); }, - getAuthPrompt(reason, iid) { + getAuthPrompt() { return this; }, - asyncPromptAuth(channel, callback, context, level, authInfo) { + asyncPromptAuth(channel, callback, context) { // We just cancel here, we're only ensuring that non-webrequest // notificationcallbacks get called if webrequest doesn't handle it. Promise.resolve().then(() => { @@ -138,10 +138,10 @@ add_task(async function test_webRequest_auth_nonblocking_forwardAuthPrompt2() { QueryInterface: ChromeUtils.generateQI(["nsIInterfaceRequestor", "nsIAuthPrompt2"]), getInterface: ChromeUtils.generateQI(["nsIAuthPrompt2"]), - promptAuth(request, level, authInfo) { + promptAuth() { throw Components.Exception("", Cr.NS_ERROR_NO_INTERFACE); }, - asyncPromptAuth(request, callback, context, level, authInfo) { + asyncPromptAuth(request) { // We just cancel here, we're only ensuring that non-webrequest // notificationcallbacks get called if webrequest doesn't handle it. Promise.resolve().then(() => { diff --git a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_background_events.html b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_background_events.html index 86cec62fb4..5ac3dccaa7 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_background_events.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_background_events.html @@ -35,7 +35,7 @@ add_task(async function test_webRequest_serviceworker_events() { "onErrorOccurred", ]); - function listener(name, details) { + function listener(name) { browser.test.assertTrue(eventNames.has(name), `received ${name}`); eventNames.delete(name); if (name == "onCompleted") { diff --git a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_basic.html b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_basic.html index 9d57d55681..1e769a3156 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_basic.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_basic.html @@ -303,7 +303,7 @@ add_task(async function test_webRequest_tabId() { add_task(async function test_webRequest_tabId_browser() { async function background(url) { let tabId; - browser.test.onMessage.addListener(async (msg, expected) => { + browser.test.onMessage.addListener(async (msg) => { if (msg == "create") { let tab = await browser.tabs.create({url}); tabId = tab.id; diff --git a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_errors.html b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_errors.html index cbfc5c17e7..d29638b408 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_errors.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_errors.html @@ -23,7 +23,7 @@ async function test_connection_refused(url, expectedError) { }, {urls: ["<all_urls>"]}); let tabId; - browser.test.onMessage.addListener(async (msg, expected) => { + browser.test.onMessage.addListener(async () => { await browser.tabs.remove(tabId); browser.test.sendMessage("done"); }); diff --git a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_hsts.html b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_hsts.html index e66b5c471a..7b06a30551 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_hsts.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_hsts.html @@ -15,13 +15,13 @@ function getExtension() { async function background() { let expect; let urls = ["*://*.example.org/tests/*"]; - browser.webRequest.onBeforeRequest.addListener(details => { + browser.webRequest.onBeforeRequest.addListener(() => { browser.test.assertEq(expect.shift(), "onBeforeRequest"); }, {urls}, ["blocking"]); - browser.webRequest.onBeforeSendHeaders.addListener(details => { + browser.webRequest.onBeforeSendHeaders.addListener(() => { browser.test.assertEq(expect.shift(), "onBeforeSendHeaders"); }, {urls}, ["blocking", "requestHeaders"]); - browser.webRequest.onSendHeaders.addListener(details => { + browser.webRequest.onSendHeaders.addListener(() => { browser.test.assertEq(expect.shift(), "onSendHeaders"); }, {urls}, ["requestHeaders"]); @@ -82,10 +82,10 @@ function getExtension() { } return {responseHeaders: headers}; }, {urls}, ["blocking", "responseHeaders"]); - browser.webRequest.onBeforeRedirect.addListener(details => { + browser.webRequest.onBeforeRedirect.addListener(() => { browser.test.assertEq(expect.shift(), "onBeforeRedirect"); }, {urls}); - browser.webRequest.onResponseStarted.addListener(details => { + browser.webRequest.onResponseStarted.addListener(() => { browser.test.assertEq(expect.shift(), "onResponseStarted"); }, {urls}); browser.webRequest.onCompleted.addListener(details => { diff --git a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_redirect_bypass_cors.html b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_redirect_bypass_cors.html index 87dbbd6598..7ba92f5c80 100644 --- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_redirect_bypass_cors.html +++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_redirect_bypass_cors.html @@ -57,7 +57,7 @@ add_task(async function test_webRequest_redirect_cors_bypass() { let win = window.open(WIN_URL); // Creating a message channel to the new tab. const channel = new BroadcastChannel("test_bus"); - await new Promise((resolve, reject) => { + await new Promise((resolve) => { channel.onmessage = async function(fetch_result) { // Fetch result data will either be the text content of file_sample.txt -> 'Sample' // or a network-Error. diff --git a/toolkit/components/extensions/test/mochitest/webrequest_chromeworker.js b/toolkit/components/extensions/test/mochitest/webrequest_chromeworker.js index 14d3ad2bab..9fb71430bf 100644 --- a/toolkit/components/extensions/test/mochitest/webrequest_chromeworker.js +++ b/toolkit/components/extensions/test/mochitest/webrequest_chromeworker.js @@ -2,7 +2,7 @@ /* eslint-env worker */ -onmessage = function (event) { +onmessage = function () { fetch("https://example.com/example.txt").then(() => { postMessage("Done!"); }); |