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/passwordmgr/test | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz firefox-adbda400be353e676059e335c3c0aaf99e719475.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/passwordmgr/test')
35 files changed, 144 insertions, 218 deletions
diff --git a/toolkit/components/passwordmgr/test/browser/browser.toml b/toolkit/components/passwordmgr/test/browser/browser.toml index 53066c92d4..77c107c6f3 100644 --- a/toolkit/components/passwordmgr/test/browser/browser.toml +++ b/toolkit/components/passwordmgr/test/browser/browser.toml @@ -36,8 +36,9 @@ support-files = [ ["browser_DOMInputPasswordAdded.js"] skip-if = [ - "os == 'linux'", # Bug 1337606 - "os == 'mac'", # Bug 1337606 + "os == 'linux' && os_version == '18.04'", # Bug 1337606 + "apple_catalina", # Bug 1337606 + "apple_silicon", # Bug 1337606 ] ["browser_autocomplete_autofocus_with_frame.js"] @@ -47,15 +48,17 @@ support-files = ["form_autofocus_frame.html"] support-files = ["form_disabled_readonly_passwordField.html"] ["browser_autocomplete_footer.js"] -skip-if = ["!debug && os == 'linux' && bits == 64 && os_version == '18.04'"] # Bug 1591126 +skip-if = ["os == 'linux' && os_version == '18.04' && bits == 64 && !debug"] # Bug 1591126 ["browser_autocomplete_generated_password_private_window.js"] ["browser_autocomplete_import.js"] https_first_disabled = true skip-if = [ - "os == 'mac'", # Bug 1775902 - "os == 'win' && !debug", # Bug 1775902 + "apple_catalina", # Bug 1775902 + "apple_silicon", # Bug 1775902 + "win10_2009 && !debug", # Bug 1775902 + "win11_2009 && !debug", # Bug 1775902 ] ["browser_autocomplete_insecure_warning.js"] @@ -64,8 +67,7 @@ skip-if = [ ["browser_autofill_hidden_document.js"] skip-if = [ - "os == 'win' && os_version == '10.0' && debug", # bug 1530935 - "apple_catalina && fission && !debug", # high frequency intermittent, Bug 1716486 + "apple_catalina && !debug", # high frequency intermittent, Bug 1716486 ] ["browser_autofill_http.js"] @@ -81,7 +83,10 @@ skip-if = ["os == 'android'"] ["browser_basicAuth_rateLimit.js"] ["browser_basicAuth_switchTab.js"] -skip-if = ["debug && os == 'mac'"] # Bug 1530566 +skip-if = [ + "apple_catalina && debug", # Bug 1530566 + "apple_silicon && debug", # Bug 1530566 +] ["browser_context_menu.js"] @@ -121,9 +126,10 @@ support-files = [ "form_password_change.html", ] skip-if = [ - "os == 'linux'", # Bug 1729196 + "os == 'linux' && os_version == '18.04'", # Bug 1729196 "win11_2009 && bits == 64", # Bug 1729196 - "os == 'mac' && debug", # Bug 1729196 + "apple_catalina && debug", # Bug 1729196 + "apple_silicon && debug", # Bug 1729196 ] ["browser_doorhanger_httpsUpgrade.js"] @@ -149,8 +155,8 @@ skip-if = ["a11y_checks"] # Bugs 1858041, 1854454 and 1824058 for causing interm fail-if = ["a11y_checks"] # Bug 1854452 clicked dropmaker may not be focusable skip-if = [ "tsan", # Bug 1661305 - "os == 'linux' && debug", # Bug 1658056 - "os == 'linux' && asan", # Bug 1695395 + "os == 'linux' && os_version == '18.04' && debug", # Bug 1658056 + "os == 'linux' && os_version == '18.04' && asan", # Bug 1695395 ] ["browser_doorhanger_target_blank.js"] @@ -165,7 +171,7 @@ support-files = [ "subtst_notifications_11.html", "subtst_notifications_11_popup.html", ] -skip-if = ["os == 'linux'"] # Bug 1312981, bug 1313136 +skip-if = ["os == 'linux' && os_version == '18.04'"] # Bug 1312981, bug 1313136 ["browser_entry_point_telemetry.js"] @@ -178,7 +184,7 @@ support-files = ["file_focus_before_DOMContentLoaded.sjs"] ["browser_form_history_fallback.js"] https_first_disabled = true # TODO remove that line and move test to HTTPS, see Bug 1776350 -skip-if = ["os == 'linux' && debug"] # Bug 1334336 +skip-if = ["os == 'linux' && os_version == '18.04' && debug"] # Bug 1334336 support-files = [ "subtst_notifications_1.html", "subtst_notifications_2.html", @@ -208,8 +214,9 @@ support-files = ["form_signup_detection.html"] ["browser_localip_frame.js"] skip-if = [ - "os == 'mac' && bits == 64", # Bug 1683848 - "os == 'linux' && !debug && bits == 64", # Bug 1683848 + "apple_catalina", # Bug 1683848 + "apple_silicon", # Bug 1683848 + "os == 'linux' && os_version == '18.04' && bits == 64 && !debug", # Bug 1683848 ] ["browser_message_onFormSubmit.js"] @@ -219,8 +226,11 @@ skip-if = [ ["browser_preselect_login.js"] fail-if = ["a11y_checks"] # Bug 1854452 clicked ac-secondary-action may not be labeled skip-if = [ - "os == 'linux' && (asan || tsan || debug)", # Bug 1840479 - "os == 'win' && (asan || debug)", # Bug 1840479 + "asan", + "tsan", + "os == 'linux' && os_version == '18.04' && debug", # Bug 1840479 + "win10_2009 && debug", # Bug 1840479 + "win11_2009 && debug", # Bug 1840479 ] ["browser_private_window.js"] @@ -229,8 +239,7 @@ support-files = [ "form_password_change.html", ] skip-if = [ - "os == 'linux' && bits == 64 && os_version == '18.04' && !debug", # Bug 1744976 - "os == 'win' && os_version == '10.0' && debug", # Bug 1782656 + "os == 'linux' && os_version == '18.04' && bits == 64 && !debug", # Bug 1744976 ] ["browser_proxyAuth_prompt.js"] diff --git a/toolkit/components/passwordmgr/test/browser/browser_autocomplete_primary_password.js b/toolkit/components/passwordmgr/test/browser/browser_autocomplete_primary_password.js index c3152740cd..8d6956a018 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_autocomplete_primary_password.js +++ b/toolkit/components/passwordmgr/test/browser/browser_autocomplete_primary_password.js @@ -105,7 +105,7 @@ add_task(async function test_mpAutocompleteUIBusy() { isProbablyANewPasswordField: true, }; - function dialogObserver(subject, topic, data) { + function dialogObserver(_subject, topic, _data) { Assert.ok(false, "A second dialog shouldn't have been shown"); Services.obs.removeObserver(dialogObserver, topic); } diff --git a/toolkit/components/passwordmgr/test/browser/browser_basicAuth_rateLimit.js b/toolkit/components/passwordmgr/test/browser/browser_basicAuth_rateLimit.js index 1c12a8fec5..b0a5b8b335 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_basicAuth_rateLimit.js +++ b/toolkit/components/passwordmgr/test/browser/browser_basicAuth_rateLimit.js @@ -85,13 +85,7 @@ add_task(async function test() { let iframe = doc.createElement("iframe"); doc.body.appendChild(iframe); let loaded = new Promise(resolve => { - iframe.addEventListener( - "load", - function (e) { - resolve(); - }, - { once: true } - ); + iframe.addEventListener("load", _e => resolve(), { once: true }); }); iframe.src = "https://example.com/browser/toolkit/components/passwordmgr/test/browser/authenticate.sjs"; @@ -113,13 +107,7 @@ add_task(async function test() { let iframe = doc.createElement("iframe"); doc.body.appendChild(iframe); let loaded = new Promise(resolve => { - iframe.addEventListener( - "load", - function (e) { - resolve(); - }, - { once: true } - ); + iframe.addEventListener("load", () => resolve(), { once: true }); }); iframe.src = "https://example.org/browser/toolkit/components/passwordmgr/test/browser/authenticate.sjs"; diff --git a/toolkit/components/passwordmgr/test/browser/browser_deleteLoginsBackup.js b/toolkit/components/passwordmgr/test/browser/browser_deleteLoginsBackup.js index a122f52845..db762ca118 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_deleteLoginsBackup.js +++ b/toolkit/components/passwordmgr/test/browser/browser_deleteLoginsBackup.js @@ -50,7 +50,7 @@ const loginBackupPath = PathUtils.join( async function waitForBackupUpdate() { return new Promise(resolve => { - Services.obs.addObserver(function observer(subject, topic) { + Services.obs.addObserver(function observer(_subject, _topic, _data) { Services.obs.removeObserver(observer, "logins-backup-updated"); resolve(); }, "logins-backup-updated"); diff --git a/toolkit/components/passwordmgr/test/browser/browser_doorhanger_crossframe.js b/toolkit/components/passwordmgr/test/browser/browser_doorhanger_crossframe.js index 8c4770d510..ca50715a1f 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_doorhanger_crossframe.js +++ b/toolkit/components/passwordmgr/test/browser/browser_doorhanger_crossframe.js @@ -7,7 +7,7 @@ async function acceptPasswordSave() { let notif = await getCaptureDoorhangerThatMayOpen("password-save"); let promiseNewSavedPassword = TestUtils.topicObserved( "LoginStats:NewSavedPassword", - (subject, data) => subject == gBrowser.selectedBrowser + (subject, _topic, _data) => subject == gBrowser.selectedBrowser ); clickDoorhangerButton(notif, REMEMBER_BUTTON); await promiseNewSavedPassword; diff --git a/toolkit/components/passwordmgr/test/browser/browser_doorhanger_generated_password.js b/toolkit/components/passwordmgr/test/browser/browser_doorhanger_generated_password.js index 3740dad1b9..798337ddda 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_doorhanger_generated_password.js +++ b/toolkit/components/passwordmgr/test/browser/browser_doorhanger_generated_password.js @@ -901,8 +901,8 @@ add_task(async function contextmenu_fill_generated_password_and_set_username() { ); await SpecialPowers.spawn( browser, - [[passwordInputSelector, usernameInputSelector]], - function checkEmptyPasswordField([passwordSelector, usernameSelector]) { + [passwordInputSelector], + function checkEmptyPasswordField(passwordSelector) { Assert.equal( content.document.querySelector(passwordSelector).value, "", diff --git a/toolkit/components/passwordmgr/test/browser/browser_doorhanger_remembering.js b/toolkit/components/passwordmgr/test/browser/browser_doorhanger_remembering.js index 93a16c2e3c..c3fb7656de 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_doorhanger_remembering.js +++ b/toolkit/components/passwordmgr/test/browser/browser_doorhanger_remembering.js @@ -68,7 +68,7 @@ add_setup(async function () { add_task(async function test_remember_opens() { await testSubmittingLoginFormHTTP( "subtst_notifications_1.html", - async function (fieldValues) { + async fieldValues => { Assert.equal( fieldValues.username, "notifyu1", @@ -90,7 +90,7 @@ add_task(async function test_remember_opens() { add_task(async function test_clickNever() { await testSubmittingLoginFormHTTP( "subtst_notifications_1.html", - async function (fieldValues) { + async fieldValues => { Assert.equal( fieldValues.username, "notifyu1", @@ -162,7 +162,7 @@ add_task(async function test_clickRemember() { await testSubmittingLoginFormHTTP( "subtst_notifications_1.html", - async function (fieldValues) { + async fieldValues => { Assert.equal( fieldValues.username, "notifyu1", @@ -186,7 +186,7 @@ add_task(async function test_clickRemember() { await checkDoorhangerUsernamePassword("notifyu1", "notifyp1"); let promiseNewSavedPassword = TestUtils.topicObserved( "LoginStats:NewSavedPassword", - (subject, data) => subject == gBrowser.selectedBrowser + (subject, _topic, _data) => subject == gBrowser.selectedBrowser ); clickDoorhangerButton(notif, REMEMBER_BUTTON); await promiseNewSavedPassword; @@ -283,7 +283,7 @@ add_task(async function test_rememberSignonsTrue() { await testSubmittingLoginFormHTTP( "subtst_notifications_1.html", - async function (fieldValues) { + async fieldValues => { Assert.equal( fieldValues.username, "notifyu1", @@ -317,7 +317,7 @@ add_task(async function test_autocompleteOffUsername() { await testSubmittingLoginFormHTTP( "subtst_notifications_2.html", - async function (fieldValues) { + async fieldValues => { Assert.equal( fieldValues.username, "notifyu1", @@ -349,7 +349,7 @@ add_task(async function test_autocompleteOffPassword() { await testSubmittingLoginFormHTTP( "subtst_notifications_3.html", - async function (fieldValues) { + async fieldValues => { Assert.equal( fieldValues.username, "notifyu1", @@ -379,7 +379,7 @@ add_task(async function test_autocompleteOffForm() { await testSubmittingLoginFormHTTP( "subtst_notifications_4.html", - async function (fieldValues) { + async fieldValues => { Assert.equal( fieldValues.username, "notifyu1", @@ -434,7 +434,7 @@ add_task(async function test_pwOnlyNewLoginMatchesUPForm() { await testSubmittingLoginFormHTTP( "subtst_notifications_1.html", - async function (fieldValues) { + async fieldValues => { Assert.equal( fieldValues.username, "notifyu1", @@ -501,7 +501,7 @@ add_task(async function test_pwOnlyOldLoginMatchesUPForm() { await testSubmittingLoginFormHTTP( "subtst_notifications_1.html", - async function (fieldValues) { + async fieldValues => { Assert.equal( fieldValues.username, "notifyu1", @@ -588,7 +588,7 @@ add_task(async function test_pwOnlyFormDoesntMatchExisting() { await testSubmittingLoginFormHTTP( "subtst_notifications_6.html", - async function (fieldValues) { + async fieldValues => { Assert.equal(fieldValues.username, "null", "Checking submitted username"); Assert.equal( fieldValues.password, @@ -618,7 +618,7 @@ add_task(async function test_changeUPLoginOnUPForm_dont() { await testSubmittingLoginFormHTTP( "subtst_notifications_8.html", - async function (fieldValues) { + async fieldValues => { Assert.equal( fieldValues.username, "notifyu1", @@ -704,7 +704,7 @@ add_task(async function test_changeUPLoginOnUPForm_change() { await testSubmittingLoginFormHTTP( "subtst_notifications_8.html", - async function (fieldValues) { + async fieldValues => { Assert.equal( fieldValues.username, "notifyu1", @@ -727,7 +727,7 @@ add_task(async function test_changeUPLoginOnUPForm_change() { await checkDoorhangerUsernamePassword("notifyu1", "pass2"); let promiseLoginUpdateSaved = TestUtils.topicObserved( "LoginStats:LoginUpdateSaved", - (subject, data) => subject == gBrowser.selectedBrowser + (subject, _topic, _data) => subject == gBrowser.selectedBrowser ); clickDoorhangerButton(notif, CHANGE_BUTTON); await promiseLoginUpdateSaved; @@ -760,7 +760,7 @@ add_task(async function test_changePLoginOnUPForm() { await testSubmittingLoginFormHTTP( "subtst_notifications_9.html", - async function (fieldValues) { + async fieldValues => { Assert.equal(fieldValues.username, "", "Checking submitted username"); Assert.equal( fieldValues.password, @@ -801,7 +801,7 @@ add_task(async function test_changePLoginOnPForm() { await testSubmittingLoginFormHTTP( "subtst_notifications_10.html", - async function (fieldValues) { + async fieldValues => { Assert.equal(fieldValues.username, "null", "Checking submitted username"); Assert.equal( fieldValues.password, @@ -842,7 +842,7 @@ add_task(async function test_checkUPSaveText() { await testSubmittingLoginFormHTTP( "subtst_notifications_1.html", - async function (fieldValues) { + async fieldValues => { Assert.equal( fieldValues.username, "notifyu1", @@ -880,7 +880,7 @@ add_task(async function test_checkPSaveText() { await testSubmittingLoginFormHTTP( "subtst_notifications_6.html", - async function (fieldValues) { + async fieldValues => { Assert.equal(fieldValues.username, "null", "Checking submitted username"); Assert.equal( fieldValues.password, @@ -917,7 +917,7 @@ add_task(async function test_capture2pw0un() { await testSubmittingLoginFormHTTP( "subtst_notifications_2pw_0un.html", - async function (fieldValues) { + async fieldValues => { Assert.equal(fieldValues.username, "null", "Checking submitted username"); Assert.equal( fieldValues.password, @@ -948,7 +948,7 @@ add_task(async function test_change2pw0unExistingDifferentUP() { await testSubmittingLoginFormHTTP( "subtst_notifications_2pw_0un.html", - async function (fieldValues) { + async fieldValues => { Assert.equal(fieldValues.username, "null", "Checking submitted username"); Assert.equal( fieldValues.password, @@ -982,7 +982,7 @@ add_task(async function test_change2pw0unExistingDifferentP() { await testSubmittingLoginFormHTTP( "subtst_notifications_2pw_0un.html", - async function (fieldValues) { + async fieldValues => { Assert.equal(fieldValues.username, "null", "Checking submitted username"); Assert.equal( fieldValues.password, @@ -1046,7 +1046,7 @@ add_task(async function test_changeUPLoginOnPUpdateForm() { await testSubmittingLoginFormHTTP( "subtst_notifications_change_p.html", - async function (fieldValues) { + async fieldValues => { Assert.equal(fieldValues.username, "null", "Checking submitted username"); Assert.equal( fieldValues.password, @@ -1094,7 +1094,7 @@ add_task(async function test_recipeCaptureFields_NewLogin() { await testSubmittingLoginFormHTTP( "subtst_notifications_2pw_1un_1text.html", - async function (fieldValues) { + async fieldValues => { Assert.equal( fieldValues.username, "notifyu1", @@ -1175,7 +1175,7 @@ add_task(async function test_saveUsingEnter() { info("Waiting for form submit and doorhanger interaction"); await testSubmittingLoginFormHTTP( "subtst_notifications_1.html", - async function (fieldValues) { + async fieldValues => { Assert.equal( fieldValues.username, "notifyu1", @@ -1231,7 +1231,7 @@ add_task(async function test_noShowPasswordOnDismissal() { await testSubmittingLoginFormHTTP( "subtst_notifications_1.html", - async function (fieldValues) { + async function (_fieldValues) { info("Opening popup"); let notif = await getCaptureDoorhangerThatMayOpen("password-save"); Assert.ok(!notif.dismissed, "doorhanger is not dismissed"); @@ -1265,7 +1265,7 @@ add_task(async function test_showPasswordOn1stOpenOfDismissedByDefault() { await testSubmittingLoginFormHTTP( "subtst_notifications_1.html", - async function (fieldValues) { + async function (_fieldValues) { info("Opening popup"); let notif = await getCaptureDoorhangerThatMayOpen("password-save"); Assert.ok(!notif.dismissed, "doorhanger is not dismissed"); diff --git a/toolkit/components/passwordmgr/test/browser/browser_doorhanger_window_open.js b/toolkit/components/passwordmgr/test/browser/browser_doorhanger_window_open.js index ea0437955d..6224f027a4 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_doorhanger_window_open.js +++ b/toolkit/components/passwordmgr/test/browser/browser_doorhanger_window_open.js @@ -27,7 +27,7 @@ let login2 = new nsLoginInfo( ); function withTestTabUntilStorageChange(aPageFile, aTaskFn) { - function storageChangedObserved(subject, data) { + function storageChangedObserved(_subject, data) { // Watch for actions triggered from a doorhanger (not cleanup tasks with removeLogin) if (data == "removeLogin") { return false; @@ -44,7 +44,7 @@ function withTestTabUntilStorageChange(aPageFile, aTaskFn) { gBrowser, url: "http://mochi.test:8888" + DIRECTORY_PATH + aPageFile, }, - async function (browser) { + async function (_browser) { Assert.ok(true, "loaded " + aPageFile); info("running test case task"); await aTaskFn(); diff --git a/toolkit/components/passwordmgr/test/browser/browser_entry_point_telemetry.js b/toolkit/components/passwordmgr/test/browser/browser_entry_point_telemetry.js index e400dc4637..9241f18612 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_entry_point_telemetry.js +++ b/toolkit/components/passwordmgr/test/browser/browser_entry_point_telemetry.js @@ -66,7 +66,7 @@ add_task(async function pageInfo_entryPoint() { gBrowser, url: TEST_ORIGIN, }, - async function (browser) { + async function (_browser) { info("pageInfo_entryPoint, opening pageinfo"); let pageInfo = BrowserPageInfo(TEST_ORIGIN, "securityTab", {}); await BrowserTestUtils.waitForEvent(pageInfo, "page-info-init"); diff --git a/toolkit/components/passwordmgr/test/browser/browser_formless_submit_chrome.js b/toolkit/components/passwordmgr/test/browser/browser_formless_submit_chrome.js index bb7e973db6..8a625fd86f 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_formless_submit_chrome.js +++ b/toolkit/components/passwordmgr/test/browser/browser_formless_submit_chrome.js @@ -50,7 +50,7 @@ add_setup(async function () { }); add_task(async function test_urlbar_new_URL() { - await withTestPage(async function (aBrowser) { + await withTestPage(async aBrowser => { gURLBar.value = ""; let focusPromise = BrowserTestUtils.waitForEvent(gURLBar, "focus"); gURLBar.focus(); @@ -67,7 +67,7 @@ add_task(async function test_urlbar_new_URL() { }); add_task(async function test_urlbar_fragment_enter() { - await withTestPage(function (aBrowser) { + await withTestPage(_browser => { gURLBar.focus(); gURLBar.select(); EventUtils.synthesizeKey("KEY_ArrowRight"); @@ -77,7 +77,7 @@ add_task(async function test_urlbar_fragment_enter() { }); add_task(async function test_backButton_forwardButton() { - await withTestPage(async function (aBrowser) { + await withTestPage(async aBrowser => { info("Loading formless_basic.html?second"); // Load a new page in the tab so we can test going back BrowserTestUtils.startLoadingURIString( @@ -120,7 +120,7 @@ add_task(async function test_backButton_forwardButton() { }); add_task(async function test_reloadButton() { - await withTestPage(async function (aBrowser) { + await withTestPage(async aBrowser => { let reloadButton = document.getElementById("reload-button"); let loadPromise = BrowserTestUtils.browserLoaded( aBrowser, @@ -137,7 +137,7 @@ add_task(async function test_reloadButton() { }); add_task(async function test_back_keyboard_shortcut() { - await withTestPage(async function (aBrowser) { + await withTestPage(async aBrowser => { // Load a new page in the tab so we can test going back BrowserTestUtils.startLoadingURIString( aBrowser, diff --git a/toolkit/components/passwordmgr/test/browser/browser_message_onFormSubmit.js b/toolkit/components/passwordmgr/test/browser/browser_message_onFormSubmit.js index 5e611a7384..eca5f6818a 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_message_onFormSubmit.js +++ b/toolkit/components/passwordmgr/test/browser/browser_message_onFormSubmit.js @@ -5,7 +5,7 @@ async function waitForFormSubmissionDetected() { return new Promise(resolve => { - Services.obs.addObserver(function observer(subject, topic) { + Services.obs.addObserver(function observer(_subject, _topic, _data) { Services.obs.removeObserver( observer, "passwordmgr-form-submission-detected" diff --git a/toolkit/components/passwordmgr/test/browser/browser_preselect_login.js b/toolkit/components/passwordmgr/test/browser/browser_preselect_login.js index 5847e84282..e8a405cbca 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_preselect_login.js +++ b/toolkit/components/passwordmgr/test/browser/browser_preselect_login.js @@ -154,7 +154,7 @@ add_task( gBrowser, url: TEST_URL_PATH, }, - async function (browser) { + async function (_browser) { await waitForAppMenu(); const appMenuPasswordsButton = document.getElementById( diff --git a/toolkit/components/passwordmgr/test/browser/browser_proxyAuth_prompt.js b/toolkit/components/passwordmgr/test/browser/browser_proxyAuth_prompt.js index 478f204581..dfa78ff28e 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_proxyAuth_prompt.js +++ b/toolkit/components/passwordmgr/test/browser/browser_proxyAuth_prompt.js @@ -13,12 +13,12 @@ function initProxy() { let proxyCallback = { QueryInterface: ChromeUtils.generateQI(["nsIProtocolProxyCallback"]), - onProxyAvailable(req, uri, pi, status) { + onProxyAvailable(_req, _uri, _pi, _status) { class ProxyChannelListener { - onStartRequest(request) { + onStartRequest(_request) { resolve(proxyChannel); } - onStopRequest(request, status) {} + onStopRequest(_request, _status) {} } // I'm cheating a bit here... We should probably do some magic foo to get // something implementing nsIProxiedProtocolHandler and then call @@ -81,7 +81,7 @@ function getAuthPromptCallback() { callbackResolver = resolve; }); let callback = { - onAuthAvailable(context, authInfo) { + onAuthAvailable(_context, authInfo) { callbackResolver(authInfo); }, }; diff --git a/toolkit/components/passwordmgr/test/browser/browser_relay_telemetry.js b/toolkit/components/passwordmgr/test/browser/browser_relay_telemetry.js index ea5a25db79..31d294e01d 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_relay_telemetry.js +++ b/toolkit/components/passwordmgr/test/browser/browser_relay_telemetry.js @@ -203,7 +203,7 @@ add_task(async function test_pref_toggle() { gBrowser, url: "about:preferences#privacy", }, - async function (browser) { + async _browser => { const relayIntegrationCheckbox = content.document.querySelector( "checkbox#relayIntegration" ); diff --git a/toolkit/components/passwordmgr/test/browser/browser_username_only_form_telemetry.js b/toolkit/components/passwordmgr/test/browser/browser_username_only_form_telemetry.js index 54304c24ac..0824745bfd 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_username_only_form_telemetry.js +++ b/toolkit/components/passwordmgr/test/browser/browser_username_only_form_telemetry.js @@ -5,7 +5,7 @@ "use strict"; -async function setupForms(numUsernameOnly, numBasic, numOther) { +async function setupForms(numUsernameOnly, numBasic) { const TEST_HOSTNAME = "https://example.com"; let tab = await BrowserTestUtils.openNewForegroundTab( gBrowser, @@ -88,9 +88,7 @@ add_task(async function test_oneUsernameOnlyForm() { const numUsernameOnlyForms = 1; const numBasicForms = 0; - // number of "other" forms doesn't change the outcome, set it to 2 here and - // in the following testcase just to ensure it doesn't affect the result. - let tab = await setupForms(numUsernameOnlyForms, numBasicForms, 2); + let tab = await setupForms(numUsernameOnlyForms, numBasicForms); await checkChildHistogram( "PWMGR_IS_USERNAME_ONLY_FORM", @@ -111,7 +109,7 @@ add_task(async function test_multipleUsernameOnlyForms() { const numUsernameOnlyForms = 3; const numBasicForms = 2; - let tab = await setupForms(numUsernameOnlyForms, numBasicForms, 2); + let tab = await setupForms(numUsernameOnlyForms, numBasicForms); await checkChildHistogram( "PWMGR_IS_USERNAME_ONLY_FORM", @@ -133,7 +131,7 @@ add_task(async function test_multipleDocument() { let numUsernameOnlyForms1 = 2; let numBasicForms1 = 2; - let tab1 = await setupForms(numUsernameOnlyForms1, numBasicForms1, 2); + let tab1 = await setupForms(numUsernameOnlyForms1, numBasicForms1); await checkChildHistogram( "PWMGR_IS_USERNAME_ONLY_FORM", @@ -150,7 +148,7 @@ add_task(async function test_multipleDocument() { let numUsernameOnlyForms2 = 15; let numBasicForms2 = 3; - let tab2 = await setupForms(numUsernameOnlyForms2, numBasicForms2, 2); + let tab2 = await setupForms(numUsernameOnlyForms2, numBasicForms2); await checkChildHistogram( "PWMGR_IS_USERNAME_ONLY_FORM", @@ -180,7 +178,7 @@ add_task(async function test_tooManyUsernameOnlyForms() { const numUsernameOnlyForms = 25; const numBasicForms = 2; - let tab = await setupForms(numUsernameOnlyForms, numBasicForms, 2); + let tab = await setupForms(numUsernameOnlyForms, numBasicForms); await checkChildHistogram( "PWMGR_IS_USERNAME_ONLY_FORM", diff --git a/toolkit/components/passwordmgr/test/mochitest/pwmgr_common.js b/toolkit/components/passwordmgr/test/mochitest/pwmgr_common.js index 8b125897a5..1494c60bbd 100644 --- a/toolkit/components/passwordmgr/test/mochitest/pwmgr_common.js +++ b/toolkit/components/passwordmgr/test/mochitest/pwmgr_common.js @@ -30,15 +30,6 @@ let authPromptModalType = SpecialPowers.Services.prefs.getIntPref( "prompts.modalType.httpAuth" ); -// Whether the auth prompt is a commonDialog.xhtml or a TabModalPrompt -let authPromptIsCommonDialog = - authPromptModalType === SpecialPowers.Services.prompt.MODAL_TYPE_WINDOW || - (authPromptModalType === SpecialPowers.Services.prompt.MODAL_TYPE_TAB && - SpecialPowers.Services.prefs.getBoolPref( - "prompts.tabChromePromptSubDialog", - false - )); - /** * Recreate a DOM tree using the outerHTML to ensure that any event listeners * and internal state for the elements are removed. @@ -145,7 +136,7 @@ function setUserInputValues(parentNode, selectorValues, userInput = true) { */ function getSubmitMessage(aFilterFn = undefined) { info("getSubmitMessage"); - return new Promise((resolve, reject) => { + return new Promise(resolve => { PWMGR_COMMON_PARENT.addMessageListener( "formSubmissionProcessed", function processed(...args) { @@ -170,7 +161,7 @@ function getSubmitMessage(aFilterFn = undefined) { */ function getPasswordEditedMessage() { info("getPasswordEditedMessage"); - return new Promise((resolve, reject) => { + return new Promise(resolve => { PWMGR_COMMON_PARENT.addMessageListener( "passwordEditedOrGenerated", function listener(...args) { @@ -643,8 +634,8 @@ function registerRunTests(existingPasswordFieldsCount = 0, callback) { let foundForcer = false; var observer = SpecialPowers.wrapCallback(function ( - subject, - topic, + _subject, + _topic, data ) { if (data === "observerforcer") { @@ -714,8 +705,8 @@ function logoutPrimaryPassword() { */ function promiseFormsProcessedInSameProcess(expectedCount = 1) { var processedCount = 0; - return new Promise((resolve, reject) => { - function onProcessedForm(subject, topic, data) { + return new Promise(resolve => { + function onProcessedForm(subject, _topic, data) { processedCount++; if (processedCount == expectedCount) { info(`${processedCount} form(s) processed`); @@ -1068,7 +1059,7 @@ SimpleTest.registerCleanupFunction(() => { this.LoginManager = new Proxy( {}, { - get(target, prop, receiver) { + get(_target, prop, _receiver) { return (...args) => { let loginInfoIndices = []; let cloneableArgs = args.map((val, index) => { @@ -1159,7 +1150,7 @@ async function formAutofillResult(formId) { delete gPwmgrCommonCapturedAutofillResults[formId]; return autofillResult; } - return new Promise((resolve, reject) => { + return new Promise(resolve => { PWMGR_COMMON_PARENT.addMessageListener( "formProcessed", ({ formId: id, autofillResult }) => { diff --git a/toolkit/components/passwordmgr/test/mochitest/pwmgr_common_parent.js b/toolkit/components/passwordmgr/test/mochitest/pwmgr_common_parent.js index 09ad80f467..e530fddf1c 100644 --- a/toolkit/components/passwordmgr/test/mochitest/pwmgr_common_parent.js +++ b/toolkit/components/passwordmgr/test/mochitest/pwmgr_common_parent.js @@ -109,8 +109,8 @@ function dumpLogin(label, login) { } addMessageListener("storageChanged", async function ({ expectedChangeTypes }) { - return new Promise((resolve, reject) => { - function storageChanged(subject, topic, data) { + return new Promise(resolve => { + function storageChanged(_subject, _topic, data) { let changeType = expectedChangeTypes.shift(); if (data != changeType) { resolve("Unexpected change type " + data + ", expected " + changeType); @@ -129,7 +129,7 @@ addMessageListener("storageChanged", async function ({ expectedChangeTypes }) { addMessageListener("promptShown", async function () { return new Promise(resolve => { - function promptShown(subject, topic, data) { + function promptShown(_subject, topic, _data) { Services.obs.removeObserver(promptShown, "passwordmgr-prompt-change"); Services.obs.removeObserver(promptShown, "passwordmgr-prompt-save"); resolve(topic); diff --git a/toolkit/components/passwordmgr/test/mochitest/test_autofill_https_downgrade.html b/toolkit/components/passwordmgr/test/mochitest/test_autofill_https_downgrade.html index 091f9c8ad6..5d74cef106 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_autofill_https_downgrade.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_autofill_https_downgrade.html @@ -30,7 +30,7 @@ let nsLoginInfo = SpecialPowers.wrap(SpecialPowers.Components).Constructor("@moz let win = window.open("about:blank"); SimpleTest.registerCleanupFunction(() => win.close()); -async function prepareAndProcessForm(url, login) { +async function prepareAndProcessForm(url) { let processedPromise = promiseFormsProcessed(); win.location = url; info("prepareAndProcessForm, assigned window location: " + url); diff --git a/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html b/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html index 429ec2269c..50d94dfbae 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html @@ -56,7 +56,7 @@ function runNextTest() { is(gExpectedDialogs, 0, "received expected number of auth dialogs"); mm.sendAsyncMessage("prepareForNextTest"); - mm.addMessageListener("prepareForNextTestDone", function prepared(msg) { + mm.addMessageListener("prepareForNextTestDone", function prepared(_msg) { mm.removeMessageListener("prepareForNextTestDone", prepared); if (pendingTests.length) { ({expectedDialogs: gExpectedDialogs, @@ -92,7 +92,7 @@ const pps = parentCc["@mozilla.org/network/protocol-proxy-service;1"]. getService(parentCi.nsIProtocolProxyService); pps.asyncResolve(channel, 0, { - async onProxyAvailable(req, uri, pi, status) { + async onProxyAvailable(req, uri, pi, _status) { const mozproxy = "moz-proxy://" + pi.host + ":" + pi.port; const login1 = parentCc["@mozilla.org/login-manager/loginInfo;1"]. createInstance(parentCi.nsILoginInfo); @@ -110,54 +110,32 @@ QueryInterface: ChromeUtils.generateQI([parentCi.nsIProtocolProxyCallback]), }); - addMessageListener("prepareForNextTest", message => { + addMessageListener("prepareForNextTest", _message => { parentCc["@mozilla.org/network/http-auth-manager;1"]. getService(parentCi.nsIHttpAuthManager). clearAll(); sendAsyncMessage("prepareForNextTestDone"); }); - const modalType = Services.prefs.getIntPref( - "prompts.modalType.httpAuth" - ); - const authPromptIsCommonDialog = - modalType === Services.prompt.MODAL_TYPE_WINDOW - || (modalType === Services.prompt.MODAL_TYPE_TAB - && Services.prefs.getBoolPref( - "prompts.tabChromePromptSubDialog", - false - )); - - const dialogObserverTopic = authPromptIsCommonDialog - ? "common-dialog-loaded" : "tabmodal-dialog-loaded"; - - function dialogObserver(subj, topic, data) { - if (authPromptIsCommonDialog) { - subj.Dialog.ui.prompt.document - .getElementById("commonDialog") - .acceptDialog(); - } else { - const prompt = subj.ownerGlobal.gBrowser.selectedBrowser - .tabModalPromptBox.getPrompt(subj); - prompt.Dialog.ui.button0.click(); // Accept button - } + const dialogObserverTopic = "common-dialog-loaded"; + + function dialogObserver(subj, _topic, _data) { + subj.Dialog.ui.prompt.document + .getElementById("commonDialog") + .acceptDialog(); sendAsyncMessage("promptAccepted"); } Services.obs.addObserver(dialogObserver, dialogObserverTopic); - addMessageListener("cleanup", message => { + addMessageListener("cleanup", _message => { Services.obs.removeObserver(dialogObserver, dialogObserverTopic); sendAsyncMessage("cleanupDone"); }); }); - mm.addMessageListener("promptAccepted", msg => { - gExpectedDialogs--; - }); - mm.addMessageListener("setupDone", msg => { - runNextTest(); - }); + mm.addMessageListener("promptAccepted", _message => gExpectedDialogs--); + mm.addMessageListener("setupDone", _message => runNextTest()); </script> </body> </html> diff --git a/toolkit/components/passwordmgr/test/mochitest/test_dismissed_doorhanger_in_shadow_DOM.html b/toolkit/components/passwordmgr/test/mochitest/test_dismissed_doorhanger_in_shadow_DOM.html index 87638b1132..5d014124a1 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_dismissed_doorhanger_in_shadow_DOM.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_dismissed_doorhanger_in_shadow_DOM.html @@ -67,13 +67,7 @@ async function editPasswordFieldInShadowDOM() { async function testForm(testcase) { const iframeLoaded = new Promise(resolve => { - IFRAME.addEventListener( - "load", - function(e) { - resolve(true); - }, - { once: true } - ); + IFRAME.addEventListener("load", _e => resolve(true), { once: true }); }); // This could complete before the page finishes loading. diff --git a/toolkit/components/passwordmgr/test/mochitest/test_formLike_rootElement_with_Shadow_DOM.html b/toolkit/components/passwordmgr/test/mochitest/test_formLike_rootElement_with_Shadow_DOM.html index 06458893ea..722a86efc9 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_formLike_rootElement_with_Shadow_DOM.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_formLike_rootElement_with_Shadow_DOM.html @@ -94,13 +94,7 @@ const TESTCASES = [ async function testForm(testcase) { const iframeLoaded = new Promise(resolve => { - IFRAME.addEventListener( - "load", - function(e) { - resolve(true); - }, - { once: true } - ); + IFRAME.addEventListener("load", _e => resolve(true), { once: true }); }); // This could complete before the page finishes loading. diff --git a/toolkit/components/passwordmgr/test/mochitest/test_formless_autofill.html b/toolkit/components/passwordmgr/test/mochitest/test_formless_autofill.html index 4d1b7582a9..05be33e4dd 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_formless_autofill.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_formless_autofill.html @@ -12,7 +12,7 @@ gTestDependsOnDeprecatedLogin = true; let doneSetupPromise = new Promise(resolve => { document.addEventListener("DOMContentLoaded", () => { - document.getElementById("loginFrame").addEventListener("load", async evt => { + document.getElementById("loginFrame").addEventListener("load", async _e => { // Tell the parent to setup test logins. await runChecksAfterCommonInit(); resolve(); diff --git a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_form_removal.html b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_form_removal.html index 5512c57db2..b2ff2d8845 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_form_removal.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_form_removal.html @@ -10,10 +10,8 @@ <body> <script type="application/javascript"> let loadPromise = new Promise(resolve => { - document.addEventListener("DOMContentLoaded", () => { - document.getElementById("loginFrame").addEventListener("load", (evt) => { - resolve(); - }); + document.addEventListener("DOMContentLoaded", _event => { + document.getElementById("loginFrame").addEventListener("load", _e => resolve()); }); }); @@ -187,16 +185,14 @@ const TESTCASES = [ },*/ ]; -function filterFormSubmissions({ origin, data }) { +function filterFormSubmissions({ data }) { return data.newPasswordField.value != "ignore-form-submission"; } async function testFormlesSubmitFormRemoval(tc, testDoc, scriptName) { let loginFrame = document.getElementById("loginFrame"); - let loadedPromise = new Promise((resolve) => { - loginFrame.addEventListener("load", function() { - resolve(); - }, {once: true}); + let loadedPromise = new Promise(resolve => { + loginFrame.addEventListener("load", _e => resolve(), {once: true}); }); loginFrame.src = DEFAULT_ORIGIN + "/tests/toolkit/components/passwordmgr/test/mochitest/blank.html"; await loadedPromise; diff --git a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_form_removal_negative.html b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_form_removal_negative.html index dfd7670a12..845706e9a4 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_form_removal_negative.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_form_removal_negative.html @@ -13,9 +13,7 @@ SimpleTest.requestFlakyTimeout("Testing that a message doesn't arrive"); let loadPromise = new Promise(resolve => { document.addEventListener("DOMContentLoaded", () => { - document.getElementById("loginFrame").addEventListener("load", (evt) => { - resolve(); - }); + document.getElementById("loginFrame").addEventListener("load", _e => resolve()); }); }); diff --git a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation.html b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation.html index 348669a85c..78ddb18e4b 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation.html @@ -11,9 +11,7 @@ <script type="application/javascript"> let loadPromise = new Promise(resolve => { document.addEventListener("DOMContentLoaded", () => { - document.getElementById("loginFrame").addEventListener("load", (evt) => { - resolve(); - }); + document.getElementById("loginFrame").addEventListener("load", _e => resolve()); }); }); @@ -179,7 +177,7 @@ const TESTCASES = [ }, ]; -function filterFormSubmissions({ origin, data }) { +function filterFormSubmissions({ _origin, data }) { return data.newPasswordField.value != "ignore-form-submission"; } diff --git a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation_negative.html b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation_negative.html index 338cd5d2c1..f5bb29c14d 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation_negative.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation_negative.html @@ -12,10 +12,8 @@ SimpleTest.requestFlakyTimeout("Testing that a message doesn't arrive"); let loadPromise = new Promise(resolve => { - document.addEventListener("DOMContentLoaded", () => { - document.getElementById("loginFrame").addEventListener("load", (evt) => { - resolve(); - }); + document.addEventListener("DOMContentLoaded", _event => { + document.getElementById("loginFrame").addEventListener("load", _e => resolve()); }); }); @@ -97,9 +95,7 @@ async function testFormlesSubmitNavigationNegative(tc, scriptName) { } let loadedPromise = new Promise((resolve) => { - loginFrame.addEventListener("load", function() { - resolve(); - }, {once: true}); + loginFrame.addEventListener("load", _e => resolve(), {once: true}); }); loginFrame.src = DEFAULT_ORIGIN + "/tests/toolkit/components/passwordmgr/test/mochitest/blank.html"; await loadedPromise; diff --git a/toolkit/components/passwordmgr/test/mochitest/test_munged_values.html b/toolkit/components/passwordmgr/test/mochitest/test_munged_values.html index d2fdf91d4a..8b0c243c4d 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_munged_values.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_munged_values.html @@ -113,7 +113,7 @@ add_task(async function test_new_logins() { <button type="submit" id="submitBtn">Submit</button> </form>`; await loadFormIntoWindow(DEFAULT_ORIGIN, html, win); - await SpecialPowers.spawn(win, [html], function(contentHtml) { + await SpecialPowers.spawn(win, [], function() { const doc = this.content.document; for (const field of doc.querySelectorAll("input")) { const actualValue = field.value; @@ -189,7 +189,7 @@ add_task(async function test_no_save_dialog_when_password_is_fully_munged() { <button type="submit" id="submitBtn">Submit</button> </form>`; await loadFormIntoWindow(DEFAULT_ORIGIN, html, win); - await SpecialPowers.spawn(win, [html], function(contentHtml) { + await SpecialPowers.spawn(win, [], function() { const doc = this.content.document; for (const field of doc.querySelectorAll("input")) { const actualValue = field.value; @@ -248,7 +248,7 @@ add_task(async function test_no_autofill_munged_username_matching_password() { <button type="submit" id="submitBtn">Submit</button> </form>`; await loadFormIntoWindow(DEFAULT_ORIGIN, html, win); - await SpecialPowers.spawn(win, [html], function(contentHtml) { + await SpecialPowers.spawn(win, [], function() { const doc = this.content.document; for (const field of doc.querySelectorAll("input")) { const actualValue = field.value; @@ -312,7 +312,7 @@ add_task(async function test_autofill_munged_username_matching_password() { <button type="submit" id="submitBtn">Submit</button> </form>`; await loadFormIntoWindow(DEFAULT_ORIGIN, html, win); - await SpecialPowers.spawn(win, [html], function(contentHtml) { + await SpecialPowers.spawn(win, [], function() { const doc = this.content.document; for (const field of doc.querySelectorAll("input")) { const actualValue = field.value; diff --git a/toolkit/components/passwordmgr/test/mochitest/test_one_doorhanger_per_un_pw.html b/toolkit/components/passwordmgr/test/mochitest/test_one_doorhanger_per_un_pw.html index 4d8dfd1fee..47e216ce4a 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_one_doorhanger_per_un_pw.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_one_doorhanger_per_un_pw.html @@ -47,9 +47,8 @@ is(password.value, "pass", "Checking for filled password"); let promptShown = false; - promptShownPromise = promisePromptShown("passwordmgr-prompt-save").then(value => { - promptShown = true; - }); + promptShownPromise = promisePromptShown("passwordmgr-prompt-save") + .then(_value => promptShown = true); submitButton.click(); await new Promise(resolve => setTimeout(resolve, 1000)); ok(!promptShown, "Prompt is not shown for the same login values a second time"); diff --git a/toolkit/components/passwordmgr/test/mochitest/test_password_length.html b/toolkit/components/passwordmgr/test/mochitest/test_password_length.html index 724caf236f..10a79f2839 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_password_length.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_password_length.html @@ -12,19 +12,15 @@ let readyPromise = registerRunTests(); let loadPromise = new Promise(resolve => { - document.addEventListener("DOMContentLoaded", () => { - document.getElementById("loginFrame").addEventListener("load", (evt) => { - resolve(); - }); + document.addEventListener("DOMContentLoaded", _event => { + document.getElementById("loginFrame").addEventListener("load", _e => resolve()); }); }); async function loadFormIntoIframe(origin, html) { let loginFrame = document.getElementById("loginFrame"); let loadedPromise = new Promise((resolve) => { - loginFrame.addEventListener("load", function() { - resolve(); - }, {once: true}); + loginFrame.addEventListener("load", _e => resolve(), {once: true}); }); let processedPromise = promiseFormsProcessed(); loginFrame.src = origin + "/tests/toolkit/components/passwordmgr/test/mochitest/blank.html"; @@ -80,7 +76,7 @@ const TESTCASES = [ * @return {Promise} resolving when form submission was processed. */ function getSubmitMessage() { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { PWMGR_COMMON_PARENT.addMessageListener("formSubmissionProcessed", function processed(...args) { info("got formSubmissionProcessed"); PWMGR_COMMON_PARENT.removeMessageListener("formSubmissionProcessed", processed); diff --git a/toolkit/components/passwordmgr/test/mochitest/test_prompt_async.html b/toolkit/components/passwordmgr/test/mochitest/test_prompt_async.html index 41a58cb416..1edbf8cf18 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_prompt_async.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_prompt_async.html @@ -58,9 +58,7 @@ function promiseLoadedContentDoc(frame) { return new Promise(resolve => { - frame.addEventListener("load", function onLoad(evt) { - resolve(SpecialPowers.wrap(frame).contentDocument); - }, { once: true }); + frame.addEventListener("load", _e => resolve(SpecialPowers.wrap(frame).contentDocument), { once: true }); }); } @@ -98,7 +96,7 @@ return this; }, - onProxyAvailable(req, uri, pi, status) { + onProxyAvailable(req, uri, pi, _status) { // Add logins using the proxy host and port used by the mochitest harness. mozproxyOrigin = "moz-proxy://" + SpecialPowers.wrap(pi).host + ":" + SpecialPowers.wrap(pi).port; diff --git a/toolkit/components/passwordmgr/test/mochitest/test_prompt_promptAuth_proxy.html b/toolkit/components/passwordmgr/test/mochitest/test_prompt_promptAuth_proxy.html index 6f78d62f1b..75342cd4cb 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_prompt_promptAuth_proxy.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_prompt_promptAuth_proxy.html @@ -86,10 +86,10 @@ let chromeScript = runInParent(() => { } class ProxyChannelListener { - onStartRequest(request) { + onStartRequest(_request) { sendAsyncMessage("initDone"); } - onStopRequest(request, status) {} + onStopRequest(_request, _status) {} } async function initLogins(pi) { @@ -126,7 +126,7 @@ let chromeScript = runInParent(() => { return this; }, - async onProxyAvailable(req, uri, pi, status) { + async onProxyAvailable(req, uri, pi, _status) { await initLogins(pi); // I'm cheating a bit here... We should probably do some magic foo to get diff --git a/toolkit/components/passwordmgr/test/mochitest/test_submit_without_field_modifications.html b/toolkit/components/passwordmgr/test/mochitest/test_submit_without_field_modifications.html index c31efe6a98..72740d3289 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_submit_without_field_modifications.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_submit_without_field_modifications.html @@ -139,9 +139,7 @@ add_task(async function test_no_message_on_navigation() { await setup(PREFILLED_FORM_URL); let submitMessageSent = false; - getSubmitMessage().then(value => { - submitMessageSent = true; - }); + getSubmitMessage().then(_value => submitMessageSent = true); await navigateWithoutUserInteraction(); // allow time to pass before concluding no onFormSubmit message was sent @@ -197,9 +195,7 @@ add_task(async function test_no_message_on_autofill_without_user_interaction() { ); ok(!(await checkDocumentUserHasInteracted()), "document.userHasInteracted should be initially false"); let submitMessageSent = false; - getSubmitMessage().then(value => { - submitMessageSent = true; - }); + getSubmitMessage().then(_value => submitMessageSent = true); info("Navigating the page") await navigateWithoutUserInteraction(); diff --git a/toolkit/components/passwordmgr/test/mochitest/test_xhr.html b/toolkit/components/passwordmgr/test/mochitest/test_xhr.html index 811a2e7759..4461195359 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_xhr.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_xhr.html @@ -21,7 +21,7 @@ Login Manager test: XHR prompt /** Test for Login Manager: XHR prompts. **/ function makeRequest(uri) { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { let request = new XMLHttpRequest(); request.open("GET", uri, true); request.addEventListener("loadend", function onLoadEnd() { diff --git a/toolkit/components/passwordmgr/test/unit/test_LoginManagerParent_onPasswordEditedOrGenerated.js b/toolkit/components/passwordmgr/test/unit/test_LoginManagerParent_onPasswordEditedOrGenerated.js index bf665faaed..4001029c55 100644 --- a/toolkit/components/passwordmgr/test/unit/test_LoginManagerParent_onPasswordEditedOrGenerated.js +++ b/toolkit/components/passwordmgr/test/unit/test_LoginManagerParent_onPasswordEditedOrGenerated.js @@ -147,13 +147,10 @@ function checkEditTelemetryRecorded(expectedCount, msg) { object: "generatedpassword", }); const results = snapshot.parent.filter( - ([time, category, method, object]) => { - return ( - category === telemetryProps.category && - method === telemetryProps.method && - object === telemetryProps.object - ); - } + ([_time, category, method, object]) => + category === telemetryProps.category && + method === telemetryProps.method && + object === telemetryProps.object ); resultsCount = results.length; } diff --git a/toolkit/components/passwordmgr/test/unit/test_logins_change.js b/toolkit/components/passwordmgr/test/unit/test_logins_change.js index cc82d6cc0b..96ee38891f 100644 --- a/toolkit/components/passwordmgr/test/unit/test_logins_change.js +++ b/toolkit/components/passwordmgr/test/unit/test_logins_change.js @@ -157,7 +157,7 @@ add_task(async function event_data_includes_plaintext_username_and_password() { "nsIObserver", "nsISupportsWeakReference", ]), - observe(subject, topic, data) { + observe(subject, _topic, _data) { Assert.ok(subject instanceof Ci.nsILoginInfo); Assert.ok(subject instanceof Ci.nsILoginMetaInfo); Assert.equal( |