From da4c7e7ed675c3bf405668739c3012d140856109 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:34:42 +0200 Subject: Adding upstream version 126.0. Signed-off-by: Daniel Baumann --- browser/components/ion/content/ion.js | 12 ++++---- .../components/ion/test/browser/browser_ion_ui.js | 35 ++++++++++------------ 2 files changed, 22 insertions(+), 25 deletions(-) (limited to 'browser/components/ion') diff --git a/browser/components/ion/content/ion.js b/browser/components/ion/content/ion.js index 3c34328d58..ef3217d239 100644 --- a/browser/components/ion/content/ion.js +++ b/browser/components/ion/content/ion.js @@ -444,7 +444,7 @@ async function setup(cachedAddons) { document .getElementById("join-ion-accept-dialog-button") - .addEventListener("click", async event => { + .addEventListener("click", async () => { const ionId = Services.prefs.getStringPref(PREF_ION_ID, null); if (!ionId) { @@ -501,7 +501,7 @@ async function setup(cachedAddons) { document .getElementById("leave-ion-accept-dialog-button") - .addEventListener("click", async event => { + .addEventListener("click", async () => { const completedStudies = Services.prefs.getStringPref( PREF_ION_COMPLETED_STUDIES, "{}" @@ -567,7 +567,7 @@ async function setup(cachedAddons) { document .getElementById("join-study-accept-dialog-button") - .addEventListener("click", async event => { + .addEventListener("click", async () => { const dialog = document.getElementById("join-study-consent-dialog"); const studyAddonId = dialog.getAttribute("addon-id"); toggleEnrolled(studyAddonId, cachedAddons).then(dialog.close()); @@ -575,7 +575,7 @@ async function setup(cachedAddons) { document .getElementById("leave-study-accept-dialog-button") - .addEventListener("click", async event => { + .addEventListener("click", async () => { const dialog = document.getElementById("leave-study-consent-dialog"); const studyAddonId = dialog.getAttribute("addon-id"); await toggleEnrolled(studyAddonId, cachedAddons).then(dialog.close()); @@ -597,7 +597,7 @@ async function setup(cachedAddons) { }; AddonManager.addAddonListener(addonsListener); - window.addEventListener("unload", event => { + window.addEventListener("unload", () => { AddonManager.removeAddonListener(addonsListener); }); } @@ -639,7 +639,7 @@ function updateContents(contents) { } } -document.addEventListener("DOMContentLoaded", async domEvent => { +document.addEventListener("DOMContentLoaded", async () => { toggleContentBasedOnLocale(); showEnrollmentStatus(); diff --git a/browser/components/ion/test/browser/browser_ion_ui.js b/browser/components/ion/test/browser/browser_ion_ui.js index e956cefa25..3cf3c47f96 100644 --- a/browser/components/ion/test/browser/browser_ion_ui.js +++ b/browser/components/ion/test/browser/browser_ion_ui.js @@ -321,7 +321,7 @@ add_task(async function testBadDefaultAddon() { url: "about:ion", gBrowser, }, - async function taskFn(browser) { + async function taskFn() { const beforePref = Services.prefs.getStringPref(PREF_ION_ID, null); Assert.strictEqual( beforePref, @@ -402,7 +402,7 @@ add_task(async function testAboutPage() { url: "about:ion", gBrowser, }, - async function taskFn(browser) { + async function taskFn() { const beforePref = Services.prefs.getStringPref(PREF_ION_ID, null); Assert.strictEqual( beforePref, @@ -694,19 +694,16 @@ add_task(async function testAboutPage() { // Wait for deletion ping, uninstalls, and UI updates... const ionUnenrolled = await new Promise((resolve, reject) => { - Services.prefs.addObserver( - PREF_ION_ID, - function observer(subject, topic, data) { - try { - const prefValue = Services.prefs.getStringPref(PREF_ION_ID, null); - Services.prefs.removeObserver(PREF_ION_ID, observer); - resolve(prefValue); - } catch (ex) { - Services.prefs.removeObserver(PREF_ION_ID, observer); - reject(ex); - } + Services.prefs.addObserver(PREF_ION_ID, function observer() { + try { + const prefValue = Services.prefs.getStringPref(PREF_ION_ID, null); + Services.prefs.removeObserver(PREF_ION_ID, observer); + resolve(prefValue); + } catch (ex) { + Services.prefs.removeObserver(PREF_ION_ID, observer); + reject(ex); } - ); + }); }); ok(!ionUnenrolled, "after accepting unenrollment, Ion pref is null."); @@ -795,7 +792,7 @@ add_task(async function testEnrollmentPings() { url: "about:ion", gBrowser, }, - async function taskFn(browser) { + async function taskFn() { const beforePref = Services.prefs.getStringPref(PREF_ION_ID, null); Assert.strictEqual( beforePref, @@ -984,7 +981,7 @@ add_task(async function testContentReplacement() { url: "about:ion", gBrowser, }, - async function taskFn(browser) { + async function taskFn() { // Check that text was updated from Remote Settings. console.log("debug:", content.document.getElementById("title").innerHTML); Assert.equal( @@ -1042,7 +1039,7 @@ add_task(async function testBadContentReplacement() { url: "about:ion", gBrowser, }, - async function taskFn(browser) { + async function taskFn() { // Check that text was updated from Remote Settings. Assert.equal( content.document.getElementById("join-ion-consent").innerHTML, @@ -1081,7 +1078,7 @@ add_task(async function testLocaleGating() { url: "about:ion", gBrowser, }, - async function taskFn(browser) { + async function taskFn() { const localeNotificationBar = content.document.getElementById( "locale-notification" ); @@ -1107,7 +1104,7 @@ add_task(async function testLocaleGating() { url: "about:ion", gBrowser, }, - async function taskFn(browser) { + async function taskFn() { const localeNotificationBar = content.document.getElementById( "locale-notification" ); -- cgit v1.2.3