Bug 1857834 - auto-formatting with Prettier v3 r=linter-reviewers,webdriver-reviewers,perftest-reviewers,search-reviewers,devtools-reviewers,sync-reviewers,reusable-components-reviewers,profiler-reviewers,dom-storage-reviewers,android-reviewers,firefox-ai-ml-reviewers,hjones,mcheang,mstange,sparky,janv,nchevobbe,tarek,Standard8,markh

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D230598
This commit is contained in:
Logan Rosen
2024-11-29 15:18:25 +00:00
parent 73b151f5c9
commit d24c9d9ff4
564 changed files with 2511 additions and 2799 deletions

View File

@@ -252,9 +252,8 @@ addAccessibleTask(
info("mutate: Adding new table"); info("mutate: Adding new table");
let shown = waitForEvent(EVENT_SHOW, "newTable"); let shown = waitForEvent(EVENT_SHOW, "newTable");
await invokeContentTask(browser, [], () => { await invokeContentTask(browser, [], () => {
content.document.getElementById( content.document.getElementById("newTableContainer").innerHTML =
"newTableContainer" `<table id="newTable"><tr><th>a</th></tr></table>`;
).innerHTML = `<table id="newTable"><tr><th>a</th></tr></table>`;
}); });
let newTable = (await shown).accessible; let newTable = (await shown).accessible;
testAbsentAttrs(newTable, { "layout-guess": "true" }); testAbsentAttrs(newTable, { "layout-guess": "true" });

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this - License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this - License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this - License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@@ -207,10 +207,14 @@ async function waitForBookmarksToolbarVisibility({
visible, visible,
message, message,
}) { }) {
let result = await TestUtils.waitForCondition(() => { let result = await TestUtils.waitForCondition(
() => {
let toolbar = win.document.getElementById("PersonalToolbar"); let toolbar = win.document.getElementById("PersonalToolbar");
return toolbar && (visible ? !toolbar.collapsed : toolbar.collapsed); return toolbar && (visible ? !toolbar.collapsed : toolbar.collapsed);
}, message || "waiting for toolbar to become " + (visible ? "visible" : "hidden")); },
message ||
"waiting for toolbar to become " + (visible ? "visible" : "hidden")
);
ok(result, message); ok(result, message);
return result; return result;
} }

View File

@@ -142,9 +142,8 @@ async function openInNewTabAndReturnContent(selector) {
} }
add_task(async function test_rightclick_open_bloburl_in_new_tab() { add_task(async function test_rightclick_open_bloburl_in_new_tab() {
let blobDataFromLoadedPage = await rightClickOpenInNewTabAndReturnContent( let blobDataFromLoadedPage =
"blob-url-link" await rightClickOpenInNewTabAndReturnContent("blob-url-link");
);
is( is(
blobDataFromLoadedPage, blobDataFromLoadedPage,
blobDataAsString, blobDataAsString,
@@ -164,9 +163,8 @@ add_task(async function test_rightclick_open_bloburl_referrer_in_new_tab() {
}); });
add_task(async function test_open_bloburl_in_new_tab() { add_task(async function test_open_bloburl_in_new_tab() {
let blobDataFromLoadedPage = await openInNewTabAndReturnContent( let blobDataFromLoadedPage =
"blob-url-link" await openInNewTabAndReturnContent("blob-url-link");
);
is( is(
blobDataFromLoadedPage, blobDataFromLoadedPage,
blobDataAsString, blobDataAsString,

View File

@@ -102,9 +102,12 @@ function getBackgroundColor(browser, expectedActive) {
await ContentTaskUtils.waitForCondition(() => { await ContentTaskUtils.waitForCondition(() => {
return area; return area;
}, "Page has loaded"); }, "Page has loaded");
await ContentTaskUtils.waitForCondition(() => { await ContentTaskUtils.waitForCondition(
() => {
return area.matches(":-moz-window-inactive") == hasPseudoClass; return area.matches(":-moz-window-inactive") == hasPseudoClass;
}, `Window is considered ${hasPseudoClass ? "inactive" : "active"}`); },
`Window is considered ${hasPseudoClass ? "inactive" : "active"}`
);
return content.getComputedStyle(area).backgroundColor; return content.getComputedStyle(area).backgroundColor;
} }

View File

@@ -136,9 +136,12 @@ let detectedStateFlags = [
]; ];
async function waitForClass(item, className, shouldBePresent = true) { async function waitForClass(item, className, shouldBePresent = true) {
await TestUtils.waitForCondition(() => { await TestUtils.waitForCondition(
() => {
return item.classList.contains(className) == shouldBePresent; return item.classList.contains(className) == shouldBePresent;
}, `Target class ${className} should be ${shouldBePresent ? "present" : "not present"} on item ${item.id}`); },
`Target class ${className} should be ${shouldBePresent ? "present" : "not present"} on item ${item.id}`
);
Assert.equal( Assert.equal(
item.classList.contains(className), item.classList.contains(className),

View File

@@ -330,9 +330,8 @@ function openBrowserWindow(
win.document.documentElement.removeAttribute("windowtype"); win.document.documentElement.removeAttribute("windowtype");
if (forcePrivate) { if (forcePrivate) {
win.docShell.QueryInterface( win.docShell.QueryInterface(Ci.nsILoadContext).usePrivateBrowsing =
Ci.nsILoadContext true;
).usePrivateBrowsing = true;
if ( if (
AppConstants.platform == "win" && AppConstants.platform == "win" &&
@@ -654,9 +653,8 @@ nsBrowserContentHandler.prototype = {
if (cmdLine.state == Ci.nsICommandLine.STATE_INITIAL_LAUNCH) { if (cmdLine.state == Ci.nsICommandLine.STATE_INITIAL_LAUNCH) {
let win = Services.wm.getMostRecentWindow("navigator:blank"); let win = Services.wm.getMostRecentWindow("navigator:blank");
if (win) { if (win) {
win.docShell.QueryInterface( win.docShell.QueryInterface(Ci.nsILoadContext).usePrivateBrowsing =
Ci.nsILoadContext true;
).usePrivateBrowsing = true;
} }
} }
} }

View File

@@ -5338,14 +5338,12 @@ var ContentBlockingCategoriesPrefs = {
for (let item of rulesArray) { for (let item of rulesArray) {
switch (item) { switch (item) {
case "tp": case "tp":
this.CATEGORY_PREFS[type][ this.CATEGORY_PREFS[type]["privacy.trackingprotection.enabled"] =
"privacy.trackingprotection.enabled" true;
] = true;
break; break;
case "-tp": case "-tp":
this.CATEGORY_PREFS[type][ this.CATEGORY_PREFS[type]["privacy.trackingprotection.enabled"] =
"privacy.trackingprotection.enabled" false;
] = false;
break; break;
case "tpPrivate": case "tpPrivate":
this.CATEGORY_PREFS[type][ this.CATEGORY_PREFS[type][
@@ -5454,14 +5452,12 @@ var ContentBlockingCategoriesPrefs = {
this.CATEGORY_PREFS[type]["privacy.query_stripping.enabled"] = false; this.CATEGORY_PREFS[type]["privacy.query_stripping.enabled"] = false;
break; break;
case "qpsPBM": case "qpsPBM":
this.CATEGORY_PREFS[type][ this.CATEGORY_PREFS[type]["privacy.query_stripping.enabled.pbmode"] =
"privacy.query_stripping.enabled.pbmode" true;
] = true;
break; break;
case "-qpsPBM": case "-qpsPBM":
this.CATEGORY_PREFS[type][ this.CATEGORY_PREFS[type]["privacy.query_stripping.enabled.pbmode"] =
"privacy.query_stripping.enabled.pbmode" false;
] = false;
break; break;
case "fpp": case "fpp":
this.CATEGORY_PREFS[type]["privacy.fingerprintingProtection"] = true; this.CATEGORY_PREFS[type]["privacy.fingerprintingProtection"] = true;
@@ -5470,14 +5466,12 @@ var ContentBlockingCategoriesPrefs = {
this.CATEGORY_PREFS[type]["privacy.fingerprintingProtection"] = false; this.CATEGORY_PREFS[type]["privacy.fingerprintingProtection"] = false;
break; break;
case "fppPrivate": case "fppPrivate":
this.CATEGORY_PREFS[type][ this.CATEGORY_PREFS[type]["privacy.fingerprintingProtection.pbmode"] =
"privacy.fingerprintingProtection.pbmode" true;
] = true;
break; break;
case "-fppPrivate": case "-fppPrivate":
this.CATEGORY_PREFS[type][ this.CATEGORY_PREFS[type]["privacy.fingerprintingProtection.pbmode"] =
"privacy.fingerprintingProtection.pbmode" false;
] = false;
break; break;
case "cookieBehavior0": case "cookieBehavior0":
this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] = this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] =

View File

@@ -824,9 +824,8 @@ class AboutLoginsInternal {
// by other more Sync-specific pages. // by other more Sync-specific pages.
const loggedIn = state.status != lazy.UIState.STATUS_NOT_CONFIGURED; const loggedIn = state.status != lazy.UIState.STATUS_NOT_CONFIGURED;
const passwordSyncEnabled = state.syncEnabled && lazy.PASSWORD_SYNC_ENABLED; const passwordSyncEnabled = state.syncEnabled && lazy.PASSWORD_SYNC_ENABLED;
const accountURL = await lazy.FxAccounts.config.promiseManageURI( const accountURL =
"password-manager" await lazy.FxAccounts.config.promiseManageURI("password-manager");
);
return { return {
loggedIn, loggedIn,

View File

@@ -2,7 +2,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this - License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -4,8 +4,7 @@
import { html, ifDefined } from "chrome://global/content/vendor/lit.all.mjs"; import { html, ifDefined } from "chrome://global/content/vendor/lit.all.mjs";
export const stylesTemplate = () => export const stylesTemplate = () => html`
html`
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css" /> <link rel="stylesheet" href="chrome://global/skin/in-content/common.css" />
<link <link
rel="stylesheet" rel="stylesheet"
@@ -22,8 +21,7 @@ export const editableFieldTemplate = ({
onBlur, onBlur,
labelL10nId, labelL10nId,
noteL10nId, noteL10nId,
}) => }) => html`
html`
<label <label
for="input" for="input"
class="field-label" class="field-label"

View File

@@ -47,8 +47,7 @@ BasicLoginAlert.argTypes = {
}, },
}; };
export const VulnerablePasswordAlert = ({ hostname }) => export const VulnerablePasswordAlert = ({ hostname }) => html`
html`
<login-vulnerable-password-alert <login-vulnerable-password-alert
.hostname=${hostname} .hostname=${hostname}
></login-vulnerable-password-alert> ></login-vulnerable-password-alert>
@@ -58,12 +57,8 @@ VulnerablePasswordAlert.args = {
hostname: "https://www.example.com", hostname: "https://www.example.com",
}; };
export const LoginBreachAlert = ({ date, hostname }) => export const LoginBreachAlert = ({ date, hostname }) => html`
html` <login-breach-alert .date=${date} .hostname=${hostname}></login-breach-alert>
<login-breach-alert
.date=${date}
.hostname=${hostname}
></login-breach-alert>
`; `;
LoginBreachAlert.argTypes = { LoginBreachAlert.argTypes = {

View File

@@ -15,7 +15,8 @@ import {
} from "chrome://global/content/vendor/lit.all.mjs"; } from "chrome://global/content/vendor/lit.all.mjs";
import { MozLitElement } from "chrome://global/content/lit-utils.mjs"; import { MozLitElement } from "chrome://global/content/lit-utils.mjs";
export const stylesTemplate = () => html`<link export const stylesTemplate = () =>
html`<link
rel="stylesheet" rel="stylesheet"
href="chrome://global/skin/in-content/common.css" href="chrome://global/skin/in-content/common.css"
/> />
@@ -31,7 +32,8 @@ export const LoginCommandButton = ({
variant, variant,
disabled, disabled,
buttonText, buttonText,
}) => html`<button }) =>
html`<button
class=${variant} class=${variant}
data-l10n-id=${ifDefined(l10nId)} data-l10n-id=${ifDefined(l10nId)}
?disabled=${disabled} ?disabled=${disabled}

View File

@@ -121,10 +121,12 @@ export class LoginListItem extends MozLitElement {
<span class="title" dir="auto">${this.title}</span> <span class="title" dir="auto">${this.title}</span>
${when( ${when(
this.username, this.username,
() => html` <span class="subtitle" dir="auto"> () =>
html` <span class="subtitle" dir="auto">
${this.username} ${this.username}
</span>`, </span>`,
() => html`<span () =>
html`<span
class="subtitle" class="subtitle"
dir="auto" dir="auto"
data-l10n-id="login-list-item-subtitle-missing-username" data-l10n-id="login-list-item-subtitle-missing-username"

View File

@@ -5,7 +5,8 @@
import { html, ifDefined } from "chrome://global/content/vendor/lit.all.mjs"; import { html, ifDefined } from "chrome://global/content/vendor/lit.all.mjs";
import { MozLitElement } from "chrome://global/content/lit-utils.mjs"; import { MozLitElement } from "chrome://global/content/lit-utils.mjs";
const stylesTemplate = () => html` <link const stylesTemplate = () =>
html` <link
rel="stylesheet" rel="stylesheet"
href="chrome://browser/content/aboutlogins/components/login-message-popup.css" href="chrome://browser/content/aboutlogins/components/login-message-popup.css"
/>`; />`;

View File

@@ -264,9 +264,8 @@ add_task(async function test_open_import_one_item_from_csv() {
]); ]);
await CsvImportHelper.waitForImportToComplete(); await CsvImportHelper.waitForImportToComplete();
let summary = await CsvImportHelper.getCsvImportSuccessDialogData( let summary =
browser await CsvImportHelper.getCsvImportSuccessDialogData(browser);
);
Assert.equal(summary.added, "1", "It should have one item as added"); Assert.equal(summary.added, "1", "It should have one item as added");
Assert.equal( Assert.equal(
summary.l10nFocused, summary.l10nFocused,
@@ -304,9 +303,8 @@ add_task(async function test_open_import_all_four_categories() {
await CsvImportHelper.clickImportFromCsvMenu(browser, updatedCsvData); await CsvImportHelper.clickImportFromCsvMenu(browser, updatedCsvData);
await CsvImportHelper.waitForImportToComplete(); await CsvImportHelper.waitForImportToComplete();
let summary = await CsvImportHelper.getCsvImportSuccessDialogData( let summary =
browser await CsvImportHelper.getCsvImportSuccessDialogData(browser);
);
Assert.equal(summary.added, "1", "It should have one item as added"); Assert.equal(summary.added, "1", "It should have one item as added");
Assert.equal( Assert.equal(
summary.modified, summary.modified,
@@ -380,9 +378,8 @@ add_task(async function test_open_import_from_csv_with_invalid_file() {
]); ]);
info("Waiting for the import error dialog"); info("Waiting for the import error dialog");
const errorDialog = await CsvImportHelper.getCsvImportErrorDialogData( const errorDialog =
browser await CsvImportHelper.getCsvImportErrorDialogData(browser);
);
Assert.equal(errorDialog.hidden, false, "Dialog should not be hidden"); Assert.equal(errorDialog.hidden, false, "Dialog should not be hidden");
Assert.equal( Assert.equal(
errorDialog.l10nTitle, errorDialog.l10nTitle,

View File

@@ -2,7 +2,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this file, - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. --> - You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -43,9 +43,8 @@ describe("AWScreenUtils", () => {
result: false, result: false,
}, },
}); });
const result = await AWScreenUtils.evaluateScreenTargeting( const result =
"test expression" await AWScreenUtils.evaluateScreenTargeting("test expression");
);
assert.calledOnce(evalStub); assert.calledOnce(evalStub);
assert.equal(result, false); assert.equal(result, false);
}); });
@@ -56,9 +55,8 @@ describe("AWScreenUtils", () => {
result: false, result: false,
}, },
}); });
const result = await AWScreenUtils.evaluateScreenTargeting( const result =
"test expression" await AWScreenUtils.evaluateScreenTargeting("test expression");
);
assert.calledOnce(evalStub); assert.calledOnce(evalStub);
assert.equal(result, true); assert.equal(result, true);
}); });

View File

@@ -570,9 +570,8 @@ describe("MultiStageAboutWelcomeProton module", () => {
}; };
it("should not set url for default qrcode svg", async () => { it("should not set url for default qrcode svg", async () => {
sandbox.stub(global.AppConstants, "isChinaRepack").returns(false); sandbox.stub(global.AppConstants, "isChinaRepack").returns(false);
const data = await AboutWelcomeDefaults.prepareContentForReact( const data =
TEST_CONTENT await AboutWelcomeDefaults.prepareContentForReact(TEST_CONTENT);
);
assert.propertyVal( assert.propertyVal(
data.screens[0].content.hero_image, data.screens[0].content.hero_image,
"url", "url",
@@ -581,9 +580,8 @@ describe("MultiStageAboutWelcomeProton module", () => {
}); });
it("should set url for cn qrcode svg", async () => { it("should set url for cn qrcode svg", async () => {
sandbox.stub(global.AppConstants, "isChinaRepack").returns(true); sandbox.stub(global.AppConstants, "isChinaRepack").returns(true);
const data = await AboutWelcomeDefaults.prepareContentForReact( const data =
TEST_CONTENT await AboutWelcomeDefaults.prepareContentForReact(TEST_CONTENT);
);
assert.propertyVal( assert.propertyVal(
data.screens[0].content.hero_image, data.screens[0].content.hero_image,
"url", "url",
@@ -617,9 +615,8 @@ describe("MultiStageAboutWelcomeProton module", () => {
}, },
], ],
}; };
const data = await AboutWelcomeDefaults.prepareContentForReact( const data =
TEST_CONTENT await AboutWelcomeDefaults.prepareContentForReact(TEST_CONTENT);
);
assert.propertyVal(data, "ua", "test"); assert.propertyVal(data, "ua", "test");
assert.propertyVal( assert.propertyVal(
data.screens[0].content.primary_button.action.data, data.screens[0].content.primary_button.action.data,
@@ -644,9 +641,8 @@ describe("MultiStageAboutWelcomeProton module", () => {
}, },
], ],
}; };
const data = await AboutWelcomeDefaults.prepareContentForReact( const data =
TEST_CONTENT await AboutWelcomeDefaults.prepareContentForReact(TEST_CONTENT);
);
assert.propertyVal(data, "ua", "test"); assert.propertyVal(data, "ua", "test");
assert.notPropertyVal( assert.notPropertyVal(
data.screens[0].content.primary_button.action.data, data.screens[0].content.primary_button.action.data,

View File

@@ -2,7 +2,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this file, - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. --> - You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -263,9 +263,8 @@ export class FeatureCallout {
this._removePanelConflictListeners(); this._removePanelConflictListeners();
this.doc.querySelector(`[src="${BUNDLE_SRC}"]`)?.remove(); this.doc.querySelector(`[src="${BUNDLE_SRC}"]`)?.remove();
if (nextMessage) { if (nextMessage) {
const isMessageUnblocked = await lazy.ASRouter.isUnblockedMessage( const isMessageUnblocked =
nextMessage await lazy.ASRouter.isUnblockedMessage(nextMessage);
);
if (!isMessageUnblocked) { if (!isMessageUnblocked) {
this.endTour(); this.endTour();
return; return;

View File

@@ -535,8 +535,8 @@ add_task(async function checkAddonsInfo() {
"service", "service",
]); ]);
const { addons: asRouterAddons, isFullData } = await ASRouterTargeting const { addons: asRouterAddons, isFullData } =
.Environment.addonsInfo; await ASRouterTargeting.Environment.addonsInfo;
ok( ok(
addons.every(({ id }) => asRouterAddons[id]), addons.every(({ id }) => asRouterAddons[id]),

View File

@@ -1277,18 +1277,16 @@ export class BackupService extends EventTarget {
await IOUtils.writeJSON(manifestPath, manifest); await IOUtils.writeJSON(manifestPath, manifest);
currentStep = STEPS.CREATE_BACKUP_FINALIZE_STAGING; currentStep = STEPS.CREATE_BACKUP_FINALIZE_STAGING;
let renamedStagingPath = await this.#finalizeStagingFolder( let renamedStagingPath =
stagingPath await this.#finalizeStagingFolder(stagingPath);
);
lazy.logConsole.log( lazy.logConsole.log(
"Wrote backup to staging directory at ", "Wrote backup to staging directory at ",
renamedStagingPath renamedStagingPath
); );
// Record the total size of the backup staging directory // Record the total size of the backup staging directory
let totalSizeKilobytes = await BackupResource.getDirectorySize( let totalSizeKilobytes =
renamedStagingPath await BackupResource.getDirectorySize(renamedStagingPath);
);
let totalSizeBytesNearestMebibyte = MeasurementUtils.fuzzByteSize( let totalSizeBytesNearestMebibyte = MeasurementUtils.fuzzByteSize(
totalSizeKilobytes * BYTES_IN_KILOBYTE, totalSizeKilobytes * BYTES_IN_KILOBYTE,
1 * BYTES_IN_MEBIBYTE 1 * BYTES_IN_MEBIBYTE
@@ -1330,9 +1328,8 @@ export class BackupService extends EventTarget {
}); });
// Record the size of the complete single-file archive // Record the size of the complete single-file archive
let archiveSizeKilobytes = await BackupResource.getFileSize( let archiveSizeKilobytes =
archiveTmpPath await BackupResource.getFileSize(archiveTmpPath);
);
let archiveSizeBytesNearestMebibyte = MeasurementUtils.fuzzByteSize( let archiveSizeBytesNearestMebibyte = MeasurementUtils.fuzzByteSize(
archiveSizeKilobytes * BYTES_IN_KILOBYTE, archiveSizeKilobytes * BYTES_IN_KILOBYTE,
1 * BYTES_IN_MEBIBYTE 1 * BYTES_IN_MEBIBYTE
@@ -2466,9 +2463,8 @@ export class BackupService extends EventTarget {
// that the backup was encrypted, and the recovery code was the correct // that the backup was encrypted, and the recovery code was the correct
// one to decrypt it. We now generate a new ArchiveEncryptionState with // one to decrypt it. We now generate a new ArchiveEncryptionState with
// that recovery code to write into the recovered profile. // that recovery code to write into the recovered profile.
({ instance: encState } = await lazy.ArchiveEncryptionState.initialize( ({ instance: encState } =
recoveryCode await lazy.ArchiveEncryptionState.initialize(recoveryCode));
));
} }
const RECOVERY_FOLDER_DEST_PATH = PathUtils.join( const RECOVERY_FOLDER_DEST_PATH = PathUtils.join(
@@ -3058,9 +3054,8 @@ export class BackupService extends EventTarget {
// TODO: Enforce other password rules here, such as ensuring that the // TODO: Enforce other password rules here, such as ensuring that the
// password is not considered common. // password is not considered common.
({ instance: encState } = await lazy.ArchiveEncryptionState.initialize( ({ instance: encState } =
password await lazy.ArchiveEncryptionState.initialize(password));
));
if (!encState) { if (!encState) {
throw new BackupError( throw new BackupError(
"Failed to construct ArchiveEncryptionState", "Failed to construct ArchiveEncryptionState",

View File

@@ -1,7 +1,7 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this - License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />

View File

@@ -143,9 +143,8 @@ export class BackupResource {
let size = 0; let size = 0;
for (const childFilePath of children) { for (const childFilePath of children) {
let { size: childSize, type: childType } = await IOUtils.stat( let { size: childSize, type: childType } =
childFilePath await IOUtils.stat(childFilePath);
);
if (shouldExclude(childFilePath, childType, directoryPath)) { if (shouldExclude(childFilePath, childType, directoryPath)) {
continue; continue;

View File

@@ -176,9 +176,8 @@ export class PreferencesBackupResource extends BackupResource {
} }
const chromeDirectoryPath = PathUtils.join(profilePath, "chrome"); const chromeDirectoryPath = PathUtils.join(profilePath, "chrome");
let chromeDirectorySize = await BackupResource.getDirectorySize( let chromeDirectorySize =
chromeDirectoryPath await BackupResource.getDirectorySize(chromeDirectoryPath);
);
if (Number.isInteger(chromeDirectorySize)) { if (Number.isInteger(chromeDirectorySize)) {
fullSize += chromeDirectorySize; fullSize += chromeDirectorySize;
} }

View File

@@ -35,9 +35,8 @@ add_setup(async () => {
* of an ArchiveEncryptionState. * of an ArchiveEncryptionState.
*/ */
add_task(async function test_ArchiveEncryptor_initializer() { add_task(async function test_ArchiveEncryptor_initializer() {
let { instance: encState } = await ArchiveEncryptionState.initialize( let { instance: encState } =
TEST_RECOVERY_CODE await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
);
let encryptor = await ArchiveEncryptor.initialize( let encryptor = await ArchiveEncryptor.initialize(
encState.publicKey, encState.publicKey,
encState.backupAuthKey encState.backupAuthKey
@@ -49,9 +48,8 @@ add_task(async function test_ArchiveEncryptor_initializer() {
* Tests that we can encrypt a single chunk of bytes. * Tests that we can encrypt a single chunk of bytes.
*/ */
add_task(async function test_ArchiveEncryption_single_chunk() { add_task(async function test_ArchiveEncryption_single_chunk() {
let { instance: encState } = await ArchiveEncryptionState.initialize( let { instance: encState } =
TEST_RECOVERY_CODE await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
);
let encryptor = await ArchiveEncryptor.initialize( let encryptor = await ArchiveEncryptor.initialize(
encState.publicKey, encState.publicKey,
encState.backupAuthKey encState.backupAuthKey
@@ -111,9 +109,8 @@ add_task(async function test_ArchiveEncryption_single_chunk() {
* Tests that we can encrypt an unevenly sized set of chunks. * Tests that we can encrypt an unevenly sized set of chunks.
*/ */
add_task(async function test_ArchiveEncryption_uneven_chunks() { add_task(async function test_ArchiveEncryption_uneven_chunks() {
let { instance: encState } = await ArchiveEncryptionState.initialize( let { instance: encState } =
TEST_RECOVERY_CODE await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
);
let encryptor = await ArchiveEncryptor.initialize( let encryptor = await ArchiveEncryptor.initialize(
encState.publicKey, encState.publicKey,
encState.backupAuthKey encState.backupAuthKey
@@ -209,9 +206,8 @@ add_task(async function test_ArchiveEncryption_uneven_chunks() {
* Tests that we can encrypt an even sized set of chunks. * Tests that we can encrypt an even sized set of chunks.
*/ */
add_task(async function test_ArchiveEncryption_even_chunks() { add_task(async function test_ArchiveEncryption_even_chunks() {
let { instance: encState } = await ArchiveEncryptionState.initialize( let { instance: encState } =
TEST_RECOVERY_CODE await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
);
let encryptor = await ArchiveEncryptor.initialize( let encryptor = await ArchiveEncryptor.initialize(
encState.publicKey, encState.publicKey,
encState.backupAuthKey encState.backupAuthKey
@@ -300,9 +296,8 @@ add_task(async function test_ArchiveEncryption_even_chunks() {
* Tests that we cannot decrypt with the wrong recovery code. * Tests that we cannot decrypt with the wrong recovery code.
*/ */
add_task(async function test_ArchiveEncryption_wrong_recoveryCode() { add_task(async function test_ArchiveEncryption_wrong_recoveryCode() {
let { instance: encState } = await ArchiveEncryptionState.initialize( let { instance: encState } =
TEST_RECOVERY_CODE await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
);
let encryptor = await ArchiveEncryptor.initialize( let encryptor = await ArchiveEncryptor.initialize(
encState.publicKey, encState.publicKey,
encState.backupAuthKey encState.backupAuthKey

View File

@@ -31,9 +31,8 @@ add_task(async function test_ArchiveEncryptionState_enable() {
*/ */
add_task( add_task(
async function test_ArchiveEncryptionState_serialization_deserialization() { async function test_ArchiveEncryptionState_serialization_deserialization() {
let { instance: encState } = await ArchiveEncryptionState.initialize( let { instance: encState } =
TEST_RECOVERY_CODE await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
);
let serialization = await encState.serialize(); let serialization = await encState.serialize();
// We'll pretend to write this serialization to disk by stringifying it, // We'll pretend to write this serialization to disk by stringifying it,
@@ -46,9 +45,8 @@ add_task(
"The ArchiveEncryptionState version was included in the serialization." "The ArchiveEncryptionState version was included in the serialization."
); );
let { instance: recoveredState } = await ArchiveEncryptionState.initialize( let { instance: recoveredState } =
serialization await ArchiveEncryptionState.initialize(serialization);
);
Assert.deepEqual( Assert.deepEqual(
encState.publicKey, encState.publicKey,
@@ -75,9 +73,8 @@ add_task(
* a serialized state from a newer version of ArchiveEncryptionState. * a serialized state from a newer version of ArchiveEncryptionState.
*/ */
add_task(async function test_ArchiveEncryptionState_deserialize_newer() { add_task(async function test_ArchiveEncryptionState_deserialize_newer() {
let { instance: encState } = await ArchiveEncryptionState.initialize( let { instance: encState } =
TEST_RECOVERY_CODE await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
);
let serialization = await encState.serialize(); let serialization = await encState.serialize();
// We'll pretend to write this serialization to disk by stringifying it, // We'll pretend to write this serialization to disk by stringifying it,

View File

@@ -127,9 +127,8 @@ add_task(async function test_createArchive_encrypted() {
const TEST_RECOVERY_CODE = "This is some recovery code."; const TEST_RECOVERY_CODE = "This is some recovery code.";
let bs = new BackupService(); let bs = new BackupService();
let { instance: encState } = await ArchiveEncryptionState.initialize( let { instance: encState } =
TEST_RECOVERY_CODE await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
);
const FAKE_ARCHIVE_PATH = PathUtils.join( const FAKE_ARCHIVE_PATH = PathUtils.join(
testProfilePath, testProfilePath,
@@ -245,9 +244,8 @@ add_task(async function test_createArchive_encrypted_truncated() {
const TEST_RECOVERY_CODE = "This is some recovery code."; const TEST_RECOVERY_CODE = "This is some recovery code.";
let bs = new BackupService(); let bs = new BackupService();
let { instance: encState } = await ArchiveEncryptionState.initialize( let { instance: encState } =
TEST_RECOVERY_CODE await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
);
const FAKE_ARCHIVE_PATH = PathUtils.join( const FAKE_ARCHIVE_PATH = PathUtils.join(
testProfilePath, testProfilePath,
@@ -327,9 +325,8 @@ add_task(async function test_createArchive_early_binary_stream_close() {
const TEST_RECOVERY_CODE = "This is some recovery code."; const TEST_RECOVERY_CODE = "This is some recovery code.";
let bs = new BackupService(); let bs = new BackupService();
let { instance: encState } = await ArchiveEncryptionState.initialize( let { instance: encState } =
TEST_RECOVERY_CODE await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
);
const FAKE_ARCHIVE_PATH = PathUtils.join( const FAKE_ARCHIVE_PATH = PathUtils.join(
testProfilePath, testProfilePath,

View File

@@ -3,7 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
--> -->
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>

View File

@@ -66,9 +66,8 @@ async function test_background_update_pref(expectedEnabled, expectedLocked) {
} }
add_task(async function test_background_app_update_policy() { add_task(async function test_background_app_update_policy() {
const origBackgroundUpdateVal = await UpdateUtils.readUpdateConfigSetting( const origBackgroundUpdateVal =
PREF_NAME await UpdateUtils.readUpdateConfigSetting(PREF_NAME);
);
registerCleanupFunction(async () => { registerCleanupFunction(async () => {
await UpdateUtils.writeUpdateConfigSetting( await UpdateUtils.writeUpdateConfigSetting(
PREF_NAME, PREF_NAME,

View File

@@ -49,9 +49,8 @@ async function test_cookie_settings({
uri: firstPartyURI, uri: firstPartyURI,
loadUsingSystemPrincipal: true, loadUsingSystemPrincipal: true,
}); });
channel.QueryInterface( channel.QueryInterface(Ci.nsIHttpChannelInternal).forceAllowThirdPartyCookie =
Ci.nsIHttpChannelInternal true;
).forceAllowThirdPartyCookie = true;
Services.cookies.removeAll(); Services.cookies.removeAll();
Services.cookies.setCookieStringFromHttp( Services.cookies.setCookieStringFromHttp(
firstPartyURI, firstPartyURI,

View File

@@ -136,9 +136,8 @@ async function handleHomepageUrl(extension, homepageUrl) {
// eslint-disable-next-line mozilla/balanced-listeners // eslint-disable-next-line mozilla/balanced-listeners
extension.on("add-permissions", async (ignoreEvent, permissions) => { extension.on("add-permissions", async (ignoreEvent, permissions) => {
if (permissions.permissions.includes("internal:privateBrowsingAllowed")) { if (permissions.permissions.includes("internal:privateBrowsingAllowed")) {
let item = await ExtensionPreferencesManager.getSetting( let item =
"homepage_override" await ExtensionPreferencesManager.getSetting("homepage_override");
);
if (item && item.id == extension.id) { if (item && item.id == extension.id) {
Services.prefs.setBoolPref(HOMEPAGE_PRIVATE_ALLOWED, true); Services.prefs.setBoolPref(HOMEPAGE_PRIVATE_ALLOWED, true);
} }
@@ -147,9 +146,8 @@ async function handleHomepageUrl(extension, homepageUrl) {
// eslint-disable-next-line mozilla/balanced-listeners // eslint-disable-next-line mozilla/balanced-listeners
extension.on("remove-permissions", async (ignoreEvent, permissions) => { extension.on("remove-permissions", async (ignoreEvent, permissions) => {
if (permissions.permissions.includes("internal:privateBrowsingAllowed")) { if (permissions.permissions.includes("internal:privateBrowsingAllowed")) {
let item = await ExtensionPreferencesManager.getSetting( let item =
"homepage_override" await ExtensionPreferencesManager.getSetting("homepage_override");
);
if (item && item.id == extension.id) { if (item && item.id == extension.id) {
Services.prefs.setBoolPref(HOMEPAGE_PRIVATE_ALLOWED, false); Services.prefs.setBoolPref(HOMEPAGE_PRIVATE_ALLOWED, false);
} }

View File

@@ -29,9 +29,8 @@ async function runTests(options) {
"expected value from getBadge" "expected value from getBadge"
); );
let badgeBackgroundColor = await browser[action].getBadgeBackgroundColor( let badgeBackgroundColor =
details await browser[action].getBadgeBackgroundColor(details);
);
browser.test.assertEq( browser.test.assertEq(
String(expecting.badgeBackgroundColor), String(expecting.badgeBackgroundColor),
String(badgeBackgroundColor), String(badgeBackgroundColor),

View File

@@ -139,9 +139,8 @@ add_task(async function test_devtools_inspectedWindow_tabId() {
await extension.startup(); await extension.startup();
let backgroundPageCurrentTabId = await extension.awaitMessage( let backgroundPageCurrentTabId =
"current-tab-id" await extension.awaitMessage("current-tab-id");
);
await openToolboxForTab(tab); await openToolboxForTab(tab);

View File

@@ -72,16 +72,20 @@ add_task(async function test_devtools_panels_elements_sidebar() {
); );
async function devtools_page() { async function devtools_page() {
const sidebar1 = await browser.devtools.panels.elements.createSidebarPane( const sidebar1 =
await browser.devtools.panels.elements.createSidebarPane(
"Test Sidebar 1" "Test Sidebar 1"
); );
const sidebar2 = await browser.devtools.panels.elements.createSidebarPane( const sidebar2 =
await browser.devtools.panels.elements.createSidebarPane(
"Test Sidebar 2" "Test Sidebar 2"
); );
const sidebar3 = await browser.devtools.panels.elements.createSidebarPane( const sidebar3 =
await browser.devtools.panels.elements.createSidebarPane(
"Test Sidebar 3" "Test Sidebar 3"
); );
const sidebar4 = await browser.devtools.panels.elements.createSidebarPane( const sidebar4 =
await browser.devtools.panels.elements.createSidebarPane(
"Test Sidebar 4" "Test Sidebar 4"
); );

View File

@@ -38,11 +38,8 @@ add_task(async function testFind() {
async function background() { async function background() {
function awaitLoad(tabId, url) { function awaitLoad(tabId, url) {
return new Promise(resolve => { return new Promise(resolve => {
browser.tabs.onUpdated.addListener(function listener( browser.tabs.onUpdated.addListener(
tabId_, function listener(tabId_, changed, tab) {
changed,
tab
) {
if ( if (
tabId == tabId_ && tabId == tabId_ &&
changed.status == "complete" && changed.status == "complete" &&
@@ -51,7 +48,8 @@ add_task(async function testFind() {
browser.tabs.onUpdated.removeListener(listener); browser.tabs.onUpdated.removeListener(listener);
resolve(); resolve();
} }
}); }
);
}); });
} }
@@ -297,11 +295,8 @@ add_task(async function testRemoveHighlighting() {
async function background() { async function background() {
function awaitLoad(tabId, url) { function awaitLoad(tabId, url) {
return new Promise(resolve => { return new Promise(resolve => {
browser.tabs.onUpdated.addListener(function listener( browser.tabs.onUpdated.addListener(
tabId_, function listener(tabId_, changed, tab) {
changed,
tab
) {
if ( if (
tabId == tabId_ && tabId == tabId_ &&
changed.status == "complete" && changed.status == "complete" &&
@@ -310,7 +305,8 @@ add_task(async function testRemoveHighlighting() {
browser.tabs.onUpdated.removeListener(listener); browser.tabs.onUpdated.removeListener(listener);
resolve(); resolve();
} }
}); }
);
}); });
} }

View File

@@ -71,16 +71,14 @@ add_task(async function testIncognitoPopup() {
const testPrivateWindow = async () => { const testPrivateWindow = async () => {
const URL = "https://example.com/incognito"; const URL = "https://example.com/incognito";
const windowReady = new Promise(resolve => { const windowReady = new Promise(resolve => {
browser.tabs.onUpdated.addListener(function listener( browser.tabs.onUpdated.addListener(
tabId, function listener(tabId, changed, tab) {
changed,
tab
) {
if (changed.status == "complete" && tab.url == URL) { if (changed.status == "complete" && tab.url == URL) {
browser.tabs.onUpdated.removeListener(listener); browser.tabs.onUpdated.removeListener(listener);
resolve(); resolve();
} }
}); }
);
}); });
const window = await browser.windows.create({ const window = await browser.windows.create({

View File

@@ -101,9 +101,8 @@ add_task(async function test_tab_options_popups() {
const optionsBrowser = getInlineOptionsBrowser(gBrowser.selectedBrowser); const optionsBrowser = getInlineOptionsBrowser(gBrowser.selectedBrowser);
const contentAreaContextMenu = await openContextMenuInOptionsPage( const contentAreaContextMenu =
optionsBrowser await openContextMenuInOptionsPage(optionsBrowser);
);
let contextMenuItemIds = [ let contextMenuItemIds = [
"context-openlinkintab", "context-openlinkintab",
@@ -220,9 +219,8 @@ add_task(async function overrideContext_in_options_page() {
await extension.awaitMessage("options-page:loaded"); await extension.awaitMessage("options-page:loaded");
const optionsBrowser = getInlineOptionsBrowser(gBrowser.selectedBrowser); const optionsBrowser = getInlineOptionsBrowser(gBrowser.selectedBrowser);
const contentAreaContextMenu = await openContextMenuInOptionsPage( const contentAreaContextMenu =
optionsBrowser await openContextMenuInOptionsPage(optionsBrowser);
);
await extension.awaitMessage("contextmenu-overridden"); await extension.awaitMessage("contextmenu-overridden");

View File

@@ -168,9 +168,8 @@ add_task(async function test_search_default_engine() {
let tabId = await extensionWithObserver.awaitMessage("ready"); let tabId = await extensionWithObserver.awaitMessage("ready");
extension.sendMessage("search", tabId); extension.sendMessage("search", tabId);
let requestDetails = await extensionWithObserver.awaitMessage( let requestDetails =
"detectedSearch" await extensionWithObserver.awaitMessage("detectedSearch");
);
await extension.unload(); await extension.unload();
await extensionWithObserver.unload(); await extensionWithObserver.unload();

View File

@@ -51,9 +51,8 @@ add_task(async function test_sessions_get_recently_closed() {
await extension.startup(); await extension.startup();
let { recentlyClosed, currentWindowId } = await extension.awaitMessage( let { recentlyClosed, currentWindowId } =
"initialData" await extension.awaitMessage("initialData");
);
recordInitialTimestamps(recentlyClosed.map(item => item.lastModified)); recordInitialTimestamps(recentlyClosed.map(item => item.lastModified));
await openAndCloseWindow(); await openAndCloseWindow();

View File

@@ -4,11 +4,8 @@
add_task(async function test_sidebar_click_isAppTab_behavior() { add_task(async function test_sidebar_click_isAppTab_behavior() {
function sidebarScript() { function sidebarScript() {
browser.tabs.onUpdated.addListener(function onUpdated( browser.tabs.onUpdated.addListener(
tabId, function onUpdated(tabId, changeInfo, tab) {
changeInfo,
tab
) {
if ( if (
changeInfo.status == "complete" && changeInfo.status == "complete" &&
tab.url == "http://mochi.test:8888/" tab.url == "http://mochi.test:8888/"
@@ -16,7 +13,8 @@ add_task(async function test_sidebar_click_isAppTab_behavior() {
browser.tabs.remove(tab.id); browser.tabs.remove(tab.id);
browser.test.notifyPass("sidebar-click"); browser.test.notifyPass("sidebar-click");
} }
}); }
);
window.addEventListener( window.addEventListener(
"load", "load",
() => { () => {

View File

@@ -97,16 +97,17 @@ add_task(async function default_url() {
background() { background() {
function promiseNonBlankTab() { function promiseNonBlankTab() {
return new Promise(resolve => { return new Promise(resolve => {
browser.tabs.onUpdated.addListener(function listener( browser.tabs.onUpdated.addListener(
tabId, function listener(tabId, changeInfo, tab) {
changeInfo, if (
tab changeInfo.status === "complete" &&
tab.url !== "about:blank"
) { ) {
if (changeInfo.status === "complete" && tab.url !== "about:blank") {
browser.tabs.onUpdated.removeListener(listener); browser.tabs.onUpdated.removeListener(listener);
resolve(tab); resolve(tab);
} }
}); }
);
}); });
} }

View File

@@ -27,15 +27,17 @@ add_task(async function () {
} }
resetLoad(); resetLoad();
browser.tabs.onUpdated.addListener(function listener( browser.tabs.onUpdated.addListener(
tabId_, function listener(tabId_, changed, tab) {
changed, if (
tab tabId == tabId_ &&
changed.status == "complete" &&
tab.url == URL
) { ) {
if (tabId == tabId_ && changed.status == "complete" && tab.url == URL) {
resolveLoad(); resolveLoad();
} }
}); }
);
try { try {
let tab = await browser.tabs.create({ url: URL }); let tab = await browser.tabs.create({ url: URL });

View File

@@ -64,9 +64,8 @@ async function runTest(stopLoadFunc) {
stopLoadFunc(slowTab); stopLoadFunc(slowTab);
// Retrieve the requestId from onBeforeRequest // Retrieve the requestId from onBeforeRequest
let requestIdOnBeforeRequest = await extension.awaitMessage( let requestIdOnBeforeRequest =
"onBeforeRequest" await extension.awaitMessage("onBeforeRequest");
);
// Now verify that we got the correct event and request id // Now verify that we got the correct event and request id
let doneMessage = await extension.awaitMessage("done"); let doneMessage = await extension.awaitMessage("done");

View File

@@ -46,9 +46,8 @@ add_task(async function testWindowCreateFocused() {
async background() { async background() {
async function doWaitForWindow(createOpts, resolve) { async function doWaitForWindow(createOpts, resolve) {
let created; let created;
browser.windows.onFocusChanged.addListener(async function listener( browser.windows.onFocusChanged.addListener(
wid async function listener(wid) {
) {
if (wid == browser.windows.WINDOW_ID_NONE) { if (wid == browser.windows.WINDOW_ID_NONE) {
return; return;
} }
@@ -60,7 +59,8 @@ add_task(async function testWindowCreateFocused() {
// update the window object // update the window object
let window = await browser.windows.get(wid); let window = await browser.windows.get(wid);
resolve(window); resolve(window);
}); }
);
created = browser.windows.create(createOpts); created = browser.windows.create(createOpts);
} }
async function awaitNewFocusedWindow(createOpts) { async function awaitNewFocusedWindow(createOpts) {

View File

@@ -32,15 +32,14 @@ add_task(async function testWindowCreate() {
let promiseTabUpdated = expected => { let promiseTabUpdated = expected => {
return new Promise(resolve => { return new Promise(resolve => {
browser.tabs.onUpdated.addListener(function listener( browser.tabs.onUpdated.addListener(
tabId, function listener(tabId, changeInfo) {
changeInfo
) {
if (changeInfo.url === expected) { if (changeInfo.url === expected) {
browser.tabs.onUpdated.removeListener(listener); browser.tabs.onUpdated.removeListener(listener);
resolve(); resolve();
} }
}); }
);
}); });
}; };

View File

@@ -13,12 +13,12 @@ add_task(async function test_window_incognito() {
background() { background() {
let lastFocusedWindowId = null; let lastFocusedWindowId = null;
// Catch focus change events to power the test below. // Catch focus change events to power the test below.
browser.windows.onFocusChanged.addListener(function listener( browser.windows.onFocusChanged.addListener(
eventWindowId function listener(eventWindowId) {
) {
lastFocusedWindowId = eventWindowId; lastFocusedWindowId = eventWindowId;
browser.windows.onFocusChanged.removeListener(listener); browser.windows.onFocusChanged.removeListener(listener);
}); }
);
browser.test.onMessage.addListener(async pbw => { browser.test.onMessage.addListener(async pbw => {
browser.test.assertEq( browser.test.assertEq(

View File

@@ -8,9 +8,8 @@ add_task(async function testWindowRemove() {
async function closeWindow(id) { async function closeWindow(id) {
let window = await browser.windows.get(id); let window = await browser.windows.get(id);
return new Promise(function (resolve) { return new Promise(function (resolve) {
browser.windows.onRemoved.addListener(async function listener( browser.windows.onRemoved.addListener(
windowId async function listener(windowId) {
) {
browser.windows.onRemoved.removeListener(listener); browser.windows.onRemoved.removeListener(listener);
await browser.test.assertEq( await browser.test.assertEq(
windowId, windowId,
@@ -23,7 +22,8 @@ add_task(async function testWindowRemove() {
"The window was really closed." "The window was really closed."
); );
resolve(); resolve();
}); }
);
browser.windows.remove(id); browser.windows.remove(id);
}); });
} }

View File

@@ -201,9 +201,8 @@ add_task(async function test_delete() {
); );
extension.sendMessage("delete-all"); extension.sendMessage("delete-all");
[historyClearedCount, removedUrls] = await extension.awaitMessage( [historyClearedCount, removedUrls] =
"history-cleared" await extension.awaitMessage("history-cleared");
);
equal( equal(
historyClearedCount, historyClearedCount,
2, 2,

View File

@@ -132,7 +132,8 @@ class CardContainer extends MozLitElement {
/> />
${when( ${when(
this.toggleDisabled, this.toggleDisabled,
() => html`<div () =>
html`<div
class=${classMap({ class=${classMap({
"card-container": true, "card-container": true,
inner: this.isInnerCard, inner: this.isInnerCard,
@@ -159,7 +160,8 @@ class CardContainer extends MozLitElement {
<slot name="main"></slot> <slot name="main"></slot>
<slot name="footer" class="card-container-footer"></slot> <slot name="footer" class="card-container-footer"></slot>
</div>`, </div>`,
() => html`<details () =>
html`<details
class=${classMap({ class=${classMap({
"card-container": true, "card-container": true,
inner: this.isInnerCard, inner: this.isInnerCard,

View File

@@ -2,7 +2,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this - License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -113,7 +113,8 @@ class FxviewEmptyState extends MozLitElement {
${repeat( ${repeat(
this.descriptionLabels, this.descriptionLabels,
descLabel => descLabel, descLabel => descLabel,
(descLabel, index) => html`<p (descLabel, index) =>
html`<p
class=${classMap({ class=${classMap({
description: true, description: true,
secondary: index !== 0, secondary: index !== 0,

View File

@@ -697,7 +697,8 @@ export class FxviewTabRowBase extends MozLitElement {
secondaryButtonTemplate() { secondaryButtonTemplate() {
return html`${when( return html`${when(
this.secondaryL10nId && this.secondaryActionHandler, this.secondaryL10nId && this.secondaryActionHandler,
() => html`<moz-button () =>
html`<moz-button
type="icon ghost" type="icon ghost"
class=${classMap({ class=${classMap({
"fxview-tab-row-button": true, "fxview-tab-row-button": true,
@@ -719,7 +720,8 @@ export class FxviewTabRowBase extends MozLitElement {
tertiaryButtonTemplate() { tertiaryButtonTemplate() {
return html`${when( return html`${when(
this.tertiaryL10nId && this.tertiaryActionHandler, this.tertiaryL10nId && this.tertiaryActionHandler,
() => html`<moz-button () =>
html`<moz-button
type="icon ghost" type="icon ghost"
class=${classMap({ class=${classMap({
"fxview-tab-row-button": true, "fxview-tab-row-button": true,
@@ -760,7 +762,8 @@ export class FxviewTabRow extends FxviewTabRowBase {
${this.faviconTemplate()} ${this.titleTemplate()} ${this.faviconTemplate()} ${this.titleTemplate()}
${when( ${when(
!this.compact, !this.compact,
() => html`${this.urlTemplate()} ${this.dateTemplate()} () =>
html`${this.urlTemplate()} ${this.dateTemplate()}
${this.timeTemplate()}` ${this.timeTemplate()}`
)} )}
</a> </a>

View File

@@ -487,7 +487,8 @@ export class OpenTabsTabRow extends FxviewTabRowBase {
return html`${when( return html`${when(
this.indicators?.includes("soundplaying") || this.indicators?.includes("soundplaying") ||
this.indicators?.includes("muted"), this.indicators?.includes("muted"),
() => html`<moz-button () =>
html`<moz-button
type="icon ghost" type="icon ghost"
class="fxview-tab-row-button" class="fxview-tab-row-button"
id="fxview-tab-row-media-button" id="fxview-tab-row-media-button"
@@ -558,7 +559,8 @@ export class OpenTabsTabRow extends FxviewTabRowBase {
${this.#faviconTemplate()} ${this.titleTemplate()} ${this.#faviconTemplate()} ${this.titleTemplate()}
${when( ${when(
!this.compact, !this.compact,
() => html`${this.#containerIndicatorTemplate()} ${this.urlTemplate()} () =>
html`${this.#containerIndicatorTemplate()} ${this.urlTemplate()}
${this.dateTemplate()} ${this.timeTemplate()}` ${this.dateTemplate()} ${this.timeTemplate()}`
)} )}
</a> </a>

View File

@@ -271,8 +271,7 @@ class OpenTabsInView extends ViewPage {
> >
${when( ${when(
currentWindowIndex && currentWindowTabs, currentWindowIndex && currentWindowTabs,
() => () => html`
html`
<view-opentabs-card <view-opentabs-card
class=${cardClasses} class=${cardClasses}
.tabs=${currentWindowTabs} .tabs=${currentWindowTabs}
@@ -542,7 +541,8 @@ class OpenTabsInViewCard extends ViewPageContent {
> >
${when( ${when(
this.recentBrowsing, this.recentBrowsing,
() => html`<h3 () =>
html`<h3
slot="header" slot="header"
data-l10n-id="firefoxview-opentabs-header" data-l10n-id="firefoxview-opentabs-header"
></h3>`, ></h3>`,
@@ -567,7 +567,8 @@ class OpenTabsInViewCard extends ViewPageContent {
</div> </div>
${when( ${when(
this.recentBrowsing, this.recentBrowsing,
() => html` <div () =>
html` <div
@click=${this.enableShowAll} @click=${this.enableShowAll}
@keydown=${this.enableShowAll} @keydown=${this.enableShowAll}
data-l10n-id="firefoxview-show-all" data-l10n-id="firefoxview-show-all"

View File

@@ -163,9 +163,8 @@ class RecentlyClosedTabsInView extends ViewPage {
} }
updateRecentlyClosedTabs() { updateRecentlyClosedTabs() {
let recentlyClosedTabsData = lazy.SessionStore.getClosedTabData( let recentlyClosedTabsData =
getWindow() lazy.SessionStore.getClosedTabData(getWindow());
);
if (Services.prefs.getBoolPref(INCLUDE_CLOSED_TABS_FROM_CLOSED_WINDOWS)) { if (Services.prefs.getBoolPref(INCLUDE_CLOSED_TABS_FROM_CLOSED_WINDOWS)) {
recentlyClosedTabsData.push( recentlyClosedTabsData.push(
...lazy.SessionStore.getClosedTabDataFromClosedWindows() ...lazy.SessionStore.getClosedTabDataFromClosedWindows()
@@ -338,7 +337,8 @@ class RecentlyClosedTabsInView extends ViewPage {
/> />
${when( ${when(
!this.recentBrowsing, !this.recentBrowsing,
() => html`<div () =>
html`<div
class="sticky-container bottom-fade" class="sticky-container bottom-fade"
?hidden=${!this.selectedTab} ?hidden=${!this.selectedTab}
> >
@@ -374,8 +374,7 @@ class RecentlyClosedTabsInView extends ViewPage {
></h3> ></h3>
${when( ${when(
this.recentlyClosedTabs.length, this.recentlyClosedTabs.length,
() => () => html`
html`
<fxview-tab-list <fxview-tab-list
slot="main" slot="main"
.maxTabsLength=${!this.recentBrowsing || this.showAll .maxTabsLength=${!this.recentBrowsing || this.showAll
@@ -397,7 +396,8 @@ class RecentlyClosedTabsInView extends ViewPage {
)} )}
${when( ${when(
this.isShowAllLinkVisible(), this.isShowAllLinkVisible(),
() => html` <div () =>
html` <div
@click=${this.enableShowAll} @click=${this.enableShowAll}
@keydown=${this.enableShowAll} @keydown=${this.enableShowAll}
data-l10n-id="firefoxview-show-all" data-l10n-id="firefoxview-show-all"

View File

@@ -142,7 +142,8 @@ export class SyncedTabsTabRow extends FxviewTabRowBase {
secondaryButtonTemplate() { secondaryButtonTemplate() {
return html`${when( return html`${when(
this.secondaryL10nId && this.secondaryActionHandler, this.secondaryL10nId && this.secondaryActionHandler,
() => html`<moz-button () =>
html`<moz-button
type="icon ghost" type="icon ghost"
class=${classMap({ class=${classMap({
"fxview-tab-row-button": true, "fxview-tab-row-button": true,
@@ -183,7 +184,8 @@ export class SyncedTabsTabRow extends FxviewTabRowBase {
${this.faviconTemplate()} ${this.titleTemplate()} ${this.faviconTemplate()} ${this.titleTemplate()}
${when( ${when(
!this.compact, !this.compact,
() => html`${this.urlTemplate()} ${this.dateTemplate()} () =>
html`${this.urlTemplate()} ${this.dateTemplate()}
${this.timeTemplate()}` ${this.timeTemplate()}`
)} )}
</a> </a>

View File

@@ -306,7 +306,8 @@ class SyncedTabsInView extends ViewPage {
</card-container>`; </card-container>`;
renderArray.push(template); renderArray.push(template);
if (this.isShowAllLinkVisible(tabItems)) { if (this.isShowAllLinkVisible(tabItems)) {
renderArray.push(html` <div class="show-all-link-container"> renderArray.push(
html` <div class="show-all-link-container">
<div <div
class="show-all-link" class="show-all-link"
@click=${this.enableShowAll} @click=${this.enableShowAll}
@@ -315,7 +316,8 @@ class SyncedTabsInView extends ViewPage {
tabindex="0" tabindex="0"
role="link" role="link"
></div> ></div>
</div>`); </div>`
);
} }
} else { } else {
// Check renderInfo[id].tabs.length to determine whether to display an // Check renderInfo[id].tabs.length to determine whether to display an
@@ -370,17 +372,22 @@ class SyncedTabsInView extends ViewPage {
Services.prefs.getBoolPref(UI_OPEN_STATE, true); Services.prefs.getBoolPref(UI_OPEN_STATE, true);
let renderArray = []; let renderArray = [];
renderArray.push(html` <link renderArray.push(
html` <link
rel="stylesheet" rel="stylesheet"
href="chrome://browser/content/firefoxview/view-syncedtabs.css" href="chrome://browser/content/firefoxview/view-syncedtabs.css"
/>`); />`
renderArray.push(html` <link );
renderArray.push(
html` <link
rel="stylesheet" rel="stylesheet"
href="chrome://browser/content/firefoxview/firefoxview.css" href="chrome://browser/content/firefoxview/firefoxview.css"
/>`); />`
);
if (!this.recentBrowsing) { if (!this.recentBrowsing) {
renderArray.push(html`<div class="sticky-container bottom-fade"> renderArray.push(
html`<div class="sticky-container bottom-fade">
<h2 <h2
class="page-header" class="page-header"
data-l10n-id="firefoxview-synced-tabs-header" data-l10n-id="firefoxview-synced-tabs-header"
@@ -392,7 +399,9 @@ class SyncedTabsInView extends ViewPage {
data-l10n-attrs="placeholder" data-l10n-attrs="placeholder"
@fxview-search-textbox-query=${this.onSearchQuery} @fxview-search-textbox-query=${this.onSearchQuery}
.size=${this.searchTextboxSize} .size=${this.searchTextboxSize}
pageName=${this.recentBrowsing ? "recentbrowsing" : "syncedtabs"} pageName=${this.recentBrowsing
? "recentbrowsing"
: "syncedtabs"}
></fxview-search-textbox> ></fxview-search-textbox>
</div> </div>
${when( ${when(
@@ -416,7 +425,8 @@ class SyncedTabsInView extends ViewPage {
` `
)} )}
</div> </div>
</div>`); </div>`
);
} }
if (this.recentBrowsing) { if (this.recentBrowsing) {

View File

@@ -448,9 +448,8 @@ add_task(async function test_cumulative_searches_recently_closed_telemetry() {
EventUtils.synthesizeMouseAtCenter(searchTextbox, {}, content); EventUtils.synthesizeMouseAtCenter(searchTextbox, {}, content);
EventUtils.sendString(URLs[0], content); EventUtils.sendString(URLs[0], content);
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
const [recentlyclosedSlot, tabList] = await waitForRecentlyClosedTabsList( const [recentlyclosedSlot, tabList] =
document await waitForRecentlyClosedTabsList(document);
);
await TestUtils.waitForCondition(() => recentlyclosedSlot?.searchQuery); await TestUtils.waitForCondition(() => recentlyclosedSlot?.searchQuery);
await click_recently_closed_tab_item(tabList[0]); await click_recently_closed_tab_item(tabList[0]);

View File

@@ -217,9 +217,8 @@ add_task(async function test_list_ordering() {
const { document } = browser.contentWindow; const { document } = browser.contentWindow;
await clearAllParentTelemetryEvents(); await clearAllParentTelemetryEvents();
await navigateToViewAndWait(document, "recentlyclosed"); await navigateToViewAndWait(document, "recentlyclosed");
let [cardMainSlotNode, listItems] = await waitForRecentlyClosedTabsList( let [cardMainSlotNode, listItems] =
document await waitForRecentlyClosedTabsList(document);
);
is( is(
cardMainSlotNode.tagName.toLowerCase(), cardMainSlotNode.tagName.toLowerCase(),

View File

@@ -1,7 +1,7 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file, - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. --> - You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" role="document"> <html xmlns="http://www.w3.org/1999/xhtml" role="document">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -3,7 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
--> -->
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>

View File

@@ -85,9 +85,8 @@ export var ChromeMigrationUtils = {
manifestPath = PathUtils.join(manifestPath, extensionId); manifestPath = PathUtils.join(manifestPath, extensionId);
// If there are multiple sub-directories in the extension directory, // If there are multiple sub-directories in the extension directory,
// read the files in the latest directory. // read the files in the latest directory.
let directories = await this._getSortedByVersionSubDirectoryNames( let directories =
manifestPath await this._getSortedByVersionSubDirectoryNames(manifestPath);
);
if (!directories[0]) { if (!directories[0]) {
return null; return null;
} }
@@ -165,9 +164,8 @@ export var ChromeMigrationUtils = {
} }
let localeFilePath = await this.getExtensionPath(profileId); let localeFilePath = await this.getExtensionPath(profileId);
localeFilePath = PathUtils.join(localeFilePath, extensionId); localeFilePath = PathUtils.join(localeFilePath, extensionId);
let directories = await this._getSortedByVersionSubDirectoryNames( let directories =
localeFilePath await this._getSortedByVersionSubDirectoryNames(localeFilePath);
);
// If there are multiple sub-directories in the extension directory, // If there are multiple sub-directories in the extension directory,
// read the files in the latest directory. // read the files in the latest directory.
localeFilePath = PathUtils.join( localeFilePath = PathUtils.join(

View File

@@ -45,9 +45,8 @@ export class ChromeWindowsLoginCrypto {
let keyData; let keyData;
try { try {
// NB: For testing, allow directory service to be faked before getting. // NB: For testing, allow directory service to be faked before getting.
const localState = await ChromeMigrationUtils.getLocalState( const localState =
userDataPathSuffix await ChromeMigrationUtils.getLocalState(userDataPathSuffix);
);
const withHeader = atob(localState.os_crypt.encrypted_key); const withHeader = atob(localState.os_crypt.encrypted_key);
if (!withHeader.startsWith(DPAPI_KEY_PREFIX)) { if (!withHeader.startsWith(DPAPI_KEY_PREFIX)) {
throw new Error("Invalid key format"); throw new Error("Invalid key format");

View File

@@ -373,9 +373,8 @@ Bookmarks.prototype = {
}, },
async _migrateFolder(aSourceFolder, aDestFolderGuid) { async _migrateFolder(aSourceFolder, aDestFolderGuid) {
let { bookmarks, favicons } = await this._getBookmarksInFolder( let { bookmarks, favicons } =
aSourceFolder await this._getBookmarksInFolder(aSourceFolder);
);
if (!bookmarks.length) { if (!bookmarks.length) {
return; return;
} }

View File

@@ -1,7 +1,7 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file, - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. --> - You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -57,7 +57,7 @@ function templateHTML(options) {
- License, v. 2.0. If a copy of the MPL was not distributed with this file, - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. --> - You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -2,7 +2,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this file, - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. --> - You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -2,7 +2,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this file, - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. --> - You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -2,7 +2,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this file, - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. --> - You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -9,9 +9,8 @@ test_newtab({
() => content.document.querySelector(siteSelector), () => content.document.querySelector(siteSelector),
"Topsites have loaded" "Topsites have loaded"
); );
const contextMenuItems = await content.openContextMenuAndGetOptions( const contextMenuItems =
siteSelector await content.openContextMenuAndGetOptions(siteSelector);
);
let icon = contextMenuItems[0].querySelector(".icon"); let icon = contextMenuItems[0].querySelector(".icon");
ok(!icon, "icon was not rendered"); ok(!icon, "icon was not rendered");
}, },

View File

@@ -19,9 +19,8 @@ test_newtab({
"Topsite tippytop icon not found" "Topsite tippytop icon not found"
); );
const contextMenuItems = await content.openContextMenuAndGetOptions( const contextMenuItems =
siteSelector await content.openContextMenuAndGetOptions(siteSelector);
);
Assert.equal(contextMenuItems.length, 5, "Number of options is correct"); Assert.equal(contextMenuItems.length, 5, "Number of options is correct");
@@ -62,9 +61,8 @@ test_newtab({
.querySelectorAll(siteSelector)[1] .querySelectorAll(siteSelector)[1]
.getAttribute("href"); .getAttribute("href");
const contextMenuItems = await content.openContextMenuAndGetOptions( const contextMenuItems =
siteSelector await content.openContextMenuAndGetOptions(siteSelector);
);
await ContentTaskUtils.waitForCondition( await ContentTaskUtils.waitForCondition(
() => contextMenuItems[4].textContent === "Dismiss", () => contextMenuItems[4].textContent === "Dismiss",
"'Dismiss' is the 5th item in the context menu list" "'Dismiss' is the 5th item in the context menu list"
@@ -99,9 +97,8 @@ test_newtab({
"1 search topsites is loaded by default" "1 search topsites is loaded by default"
); );
const contextMenuItems = await content.openContextMenuAndGetOptions( const contextMenuItems =
siteSelector await content.openContextMenuAndGetOptions(siteSelector);
);
is( is(
contextMenuItems.length, contextMenuItems.length,
2, 2,

View File

@@ -931,9 +931,8 @@ add_task(
); );
let sandbox = sinon.createSandbox(); let sandbox = sinon.createSandbox();
let feed = getHighlightsFeedForTest(sandbox); let feed = getHighlightsFeedForTest(sandbox);
feed.store.state.Prefs.values[ feed.store.state.Prefs.values["section.highlights.includeBookmarks"] =
"section.highlights.includeBookmarks" false;
] = false;
let links = [ let links = [
{ {

View File

@@ -3,7 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
--> -->
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>

View File

@@ -34,8 +34,7 @@ function promiseTopicObserved(aTopic) {
) { ) {
Services.obs.removeObserver(observe, aObsTopic); Services.obs.removeObserver(observe, aObsTopic);
resolve([aObsSubject, aObsData]); resolve([aObsSubject, aObsData]);
}, }, aTopic);
aTopic);
}); });
} }

View File

@@ -16,10 +16,13 @@ registerCleanupFunction(async () => {
async function selectAppMenuView(buttonId, viewId) { async function selectAppMenuView(buttonId, viewId) {
let btn; let btn;
await TestUtils.waitForCondition(() => { await TestUtils.waitForCondition(
() => {
btn = document.getElementById(buttonId); btn = document.getElementById(buttonId);
return btn; return btn;
}, "Should have the " + buttonId + " button"); },
"Should have the " + buttonId + " button"
);
btn.click(); btn.click();
let view = document.getElementById(viewId); let view = document.getElementById(viewId);
let viewPromise = BrowserTestUtils.waitForEvent(view, "ViewShown"); let viewPromise = BrowserTestUtils.waitForEvent(view, "ViewShown");

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -30,9 +30,8 @@ let gSyncChooseWhatToSync = {
}); });
} else { } else {
// Hide the 'Disconnect' button if not applicable // Hide the 'Disconnect' button if not applicable
document document.getElementById("syncChooseOptions").getButton("extra2").hidden =
.getElementById("syncChooseOptions") true;
.getButton("extra2").hidden = true;
} }
}, },

View File

@@ -72,9 +72,8 @@ var gFxaPairDeviceDialog = {
FxAccountsPairingFlow.start({ emitter: this._emitter }), FxAccountsPairingFlow.start({ emitter: this._emitter }),
]); ]);
const imgData = QR.encodeToDataURI(uri, "L"); const imgData = QR.encodeToDataURI(uri, "L");
document.getElementById( document.getElementById("qrContainer").style.backgroundImage =
"qrContainer" `url("${imgData.src}")`;
).style.backgroundImage = `url("${imgData.src}")`;
document document
.getElementById("qrWrapper") .getElementById("qrWrapper")
.setAttribute("pairing-status", "ready"); .setAttribute("pairing-status", "ready");
@@ -104,9 +103,8 @@ var gFxaPairDeviceDialog = {
"https://accounts.firefox.com/pair", "https://accounts.firefox.com/pair",
"L" "L"
); );
document.getElementById( document.getElementById("qrContainer").style.backgroundImage =
"qrContainer" `url("${imgData.src}")`;
).style.backgroundImage = `url("${imgData.src}")`;
}, },
onError(err) { onError(err) {

View File

@@ -289,9 +289,16 @@ var gMainPane = {
} }
// approximately a "requestIdleInterval" // approximately a "requestIdleInterval"
window.setTimeout(() => { window.setTimeout(
() => {
window.requestIdleCallback(pollForDefaultBrowser); window.requestIdleCallback(pollForDefaultBrowser);
}, backoffTimes[this._backoffIndex + 1 < backoffTimes.length ? this._backoffIndex++ : backoffTimes.length - 1]); },
backoffTimes[
this._backoffIndex + 1 < backoffTimes.length
? this._backoffIndex++
: backoffTimes.length - 1
]
);
}; };
window.setTimeout(() => { window.setTimeout(() => {
@@ -710,9 +717,8 @@ var gMainPane = {
"updateSettingsContainer" "updateSettingsContainer"
); );
updateContainer.classList.add("updateSettingCrossUserWarningContainer"); updateContainer.classList.add("updateSettingCrossUserWarningContainer");
document.getElementById( document.getElementById("updateSettingCrossUserWarningDesc").hidden =
"updateSettingCrossUserWarningDesc" false;
).hidden = false;
} }
} }
@@ -921,9 +927,8 @@ var gMainPane = {
if (!(await FxAccounts.canConnectAccount())) { if (!(await FxAccounts.canConnectAccount())) {
return; return;
} }
let url = await FxAccounts.config.promiseConnectAccountURI( let url =
"dev-edition-setup" await FxAccounts.config.promiseConnectAccountURI("dev-edition-setup");
);
let accountsTab = win.gBrowser.addWebTab(url); let accountsTab = win.gBrowser.addWebTab(url);
win.gBrowser.selectedTab = accountsTab; win.gBrowser.selectedTab = accountsTab;
}, },
@@ -1063,9 +1068,8 @@ var gMainPane = {
await TranslationsParent.getSupportedLanguages(); await TranslationsParent.getSupportedLanguages();
const languageList = const languageList =
TranslationsParent.getLanguageList(supportedLanguages); TranslationsParent.getLanguageList(supportedLanguages);
const downloadPhases = await TranslationsState.createDownloadPhases( const downloadPhases =
languageList await TranslationsState.createDownloadPhases(languageList);
);
if (supportedLanguages.languagePairs.length === 0) { if (supportedLanguages.languagePairs.length === 0) {
throw new Error( throw new Error(
@@ -2344,12 +2348,10 @@ var gMainPane = {
if (Services.appinfo.fissionAutostart) { if (Services.appinfo.fissionAutostart) {
document.getElementById("limitContentProcess").hidden = true; document.getElementById("limitContentProcess").hidden = true;
document.getElementById("contentProcessCount").hidden = true; document.getElementById("contentProcessCount").hidden = true;
document.getElementById( document.getElementById("contentProcessCountEnabledDescription").hidden =
"contentProcessCountEnabledDescription" true;
).hidden = true; document.getElementById("contentProcessCountDisabledDescription").hidden =
document.getElementById( true;
"contentProcessCountDisabledDescription"
).hidden = true;
return; return;
} }
if (Services.appinfo.browserTabsRemoteAutostart) { if (Services.appinfo.browserTabsRemoteAutostart) {
@@ -2368,21 +2370,17 @@ var gMainPane = {
document.getElementById("limitContentProcess").disabled = false; document.getElementById("limitContentProcess").disabled = false;
document.getElementById("contentProcessCount").disabled = false; document.getElementById("contentProcessCount").disabled = false;
document.getElementById( document.getElementById("contentProcessCountEnabledDescription").hidden =
"contentProcessCountEnabledDescription" false;
).hidden = false; document.getElementById("contentProcessCountDisabledDescription").hidden =
document.getElementById( true;
"contentProcessCountDisabledDescription"
).hidden = true;
} else { } else {
document.getElementById("limitContentProcess").disabled = true; document.getElementById("limitContentProcess").disabled = true;
document.getElementById("contentProcessCount").disabled = true; document.getElementById("contentProcessCount").disabled = true;
document.getElementById( document.getElementById("contentProcessCountEnabledDescription").hidden =
"contentProcessCountEnabledDescription" true;
).hidden = true; document.getElementById("contentProcessCountDisabledDescription").hidden =
document.getElementById( false;
"contentProcessCountDisabledDescription"
).hidden = false;
} }
}, },

View File

@@ -1549,12 +1549,10 @@ var gPrivacyPane = {
// Hide all cookie options first, until we learn which one should be showing. // Hide all cookie options first, until we learn which one should be showing.
document.querySelector(selector + " .all-cookies-option").hidden = true; document.querySelector(selector + " .all-cookies-option").hidden = true;
document.querySelector( document.querySelector(selector + " .unvisited-cookies-option").hidden =
selector + " .unvisited-cookies-option" true;
).hidden = true; document.querySelector(selector + " .cross-site-cookies-option").hidden =
document.querySelector( true;
selector + " .cross-site-cookies-option"
).hidden = true;
document.querySelector( document.querySelector(
selector + " .third-party-tracking-cookies-option" selector + " .third-party-tracking-cookies-option"
).hidden = true; ).hidden = true;
@@ -1570,24 +1568,20 @@ var gPrivacyPane = {
// Note "cookieBehavior0", will result in no UI changes, so is not listed here. // Note "cookieBehavior0", will result in no UI changes, so is not listed here.
switch (item) { switch (item) {
case "tp": case "tp":
document.querySelector( document.querySelector(selector + " .trackers-option").hidden =
selector + " .trackers-option" false;
).hidden = false;
break; break;
case "-tp": case "-tp":
document.querySelector( document.querySelector(selector + " .trackers-option").hidden =
selector + " .trackers-option" true;
).hidden = true;
break; break;
case "tpPrivate": case "tpPrivate":
document.querySelector( document.querySelector(selector + " .pb-trackers-option").hidden =
selector + " .pb-trackers-option" false;
).hidden = false;
break; break;
case "-tpPrivate": case "-tpPrivate":
document.querySelector( document.querySelector(selector + " .pb-trackers-option").hidden =
selector + " .pb-trackers-option" true;
).hidden = true;
break; break;
case "fp": case "fp":
document.querySelector( document.querySelector(
@@ -1600,14 +1594,12 @@ var gPrivacyPane = {
).hidden = true; ).hidden = true;
break; break;
case "cm": case "cm":
document.querySelector( document.querySelector(selector + " .cryptominers-option").hidden =
selector + " .cryptominers-option" false;
).hidden = false;
break; break;
case "-cm": case "-cm":
document.querySelector( document.querySelector(selector + " .cryptominers-option").hidden =
selector + " .cryptominers-option" true;
).hidden = true;
break; break;
case "stp": case "stp":
// Store social tracking cookies pref // Store social tracking cookies pref
@@ -1622,9 +1614,8 @@ var gPrivacyPane = {
break; break;
case "-stp": case "-stp":
// Store social tracking cookies pref // Store social tracking cookies pref
document.querySelector( document.querySelector(selector + " .social-media-option").hidden =
selector + " .social-media-option" true;
).hidden = true;
break; break;
case "cookieBehavior1": case "cookieBehavior1":
document.querySelector( document.querySelector(
@@ -1632,9 +1623,8 @@ var gPrivacyPane = {
).hidden = false; ).hidden = false;
break; break;
case "cookieBehavior2": case "cookieBehavior2":
document.querySelector( document.querySelector(selector + " .all-cookies-option").hidden =
selector + " .all-cookies-option" false;
).hidden = false;
break; break;
case "cookieBehavior3": case "cookieBehavior3":
document.querySelector( document.querySelector(

View File

@@ -1461,7 +1461,8 @@ class DefaultEngineDropDown {
) { ) {
return; return;
} }
let defaultEngine = await Services.search[ let defaultEngine =
await Services.search[
this.#type == "normal" ? "getDefault" : "getDefaultPrivate" this.#type == "normal" ? "getDefault" : "getDefaultPrivate"
](); ]();

View File

@@ -3,7 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
--> -->
<!DOCTYPE html> <!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" class="private"> <html xmlns="http://www.w3.org/1999/xhtml" class="private">
<head> <head>

View File

@@ -1,7 +1,7 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file, - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. --> - You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html <html
xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"
role="document" role="document"

View File

@@ -1,7 +1,7 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file, - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. --> - You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html <html
xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"
role="document" role="document"

View File

@@ -1,7 +1,7 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file, - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. --> - You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html <html
xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"
role="document" role="document"

View File

@@ -1,7 +1,7 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file, - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. --> - You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html <html
xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"
role="document" role="document"

View File

@@ -2,7 +2,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this - License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />

View File

@@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<!-- This Source Code Form is subject to the terms of the Mozilla Public <!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file, - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. --> - You can obtain one at http://mozilla.org/MPL/2.0/. -->

View File

@@ -90,9 +90,8 @@ add_task(async function dragTest1Point5Zoom() {
result.zoom = zoom; result.zoom = zoom;
result.devicePixelRatio = window.devicePixelRatio; result.devicePixelRatio = window.devicePixelRatio;
result.contentDevicePixelRatio = await getContentDevicePixelRatio( result.contentDevicePixelRatio =
browser await getContentDevicePixelRatio(browser);
);
info("result: " + JSON.stringify(result, null, 2)); info("result: " + JSON.stringify(result, null, 2));

View File

@@ -1920,9 +1920,8 @@ class SERPCategorizer {
for (let domain of domains) { for (let domain of domains) {
domainsCount++; domainsCount++;
let categoryCandidates = await SearchSERPDomainToCategoriesMap.get( let categoryCandidates =
domain await SearchSERPDomainToCategoriesMap.get(domain);
);
if (!categoryCandidates.length) { if (!categoryCandidates.length) {
unknownsCount++; unknownsCount++;

View File

@@ -426,9 +426,12 @@ async function waitForTestMsg(browser, type) {
); );
let donePromise = SpecialPowers.spawn(browser, [type], async childType => { let donePromise = SpecialPowers.spawn(browser, [type], async childType => {
await ContentTaskUtils.waitForCondition(() => { await ContentTaskUtils.waitForCondition(
() => {
return !!content.eventDetails; return !!content.eventDetails;
}, "Expected " + childType + " event"); },
"Expected " + childType + " event"
);
return content.eventDetails; return content.eventDetails;
}); });

View File

@@ -136,9 +136,8 @@ add_task(async function test_categorization_simple() {
"test10.com", "test10.com",
]); ]);
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic( let resultsToReport =
domains await SearchSERPCategorization.applyCategorizationLogic(domains);
);
Assert.deepEqual( Assert.deepEqual(
resultsToReport, resultsToReport,
@@ -165,9 +164,8 @@ add_task(async function test_categorization_inconclusive() {
"test20.com", "test20.com",
]); ]);
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic( let resultsToReport =
domains await SearchSERPCategorization.applyCategorizationLogic(domains);
);
Assert.deepEqual( Assert.deepEqual(
resultsToReport, resultsToReport,
@@ -201,9 +199,8 @@ add_task(async function test_categorization_unknown() {
"test30.com", "test30.com",
]); ]);
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic( let resultsToReport =
domains await SearchSERPCategorization.applyCategorizationLogic(domains);
);
Assert.deepEqual( Assert.deepEqual(
resultsToReport, resultsToReport,
@@ -235,9 +232,8 @@ add_task(async function test_categorization_unknown_and_inconclusive() {
"test40.com", "test40.com",
]); ]);
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic( let resultsToReport =
domains await SearchSERPCategorization.applyCategorizationLogic(domains);
);
Assert.deepEqual( Assert.deepEqual(
resultsToReport, resultsToReport,
@@ -272,9 +268,8 @@ add_task(async function test_categorization_all_types() {
"test60.com", "test60.com",
]); ]);
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic( let resultsToReport =
domains await SearchSERPCategorization.applyCategorizationLogic(domains);
);
Assert.deepEqual( Assert.deepEqual(
resultsToReport, resultsToReport,
@@ -306,9 +301,8 @@ add_task(async function test_categorization_tie() {
"test50.com", "test50.com",
]); ]);
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic( let resultsToReport =
domains await SearchSERPCategorization.applyCategorizationLogic(domains);
);
Assert.equal( Assert.equal(
[1, 2].includes(resultsToReport.category), [1, 2].includes(resultsToReport.category),
@@ -345,9 +339,8 @@ add_task(async function test_rank_penalization_equal_scores() {
"test60.com", "test60.com",
]); ]);
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic( let resultsToReport =
domains await SearchSERPCategorization.applyCategorizationLogic(domains);
);
Assert.deepEqual( Assert.deepEqual(
resultsToReport, resultsToReport,
@@ -363,9 +356,8 @@ add_task(async function test_rank_penalization_highest_score_lower_on_page() {
let domains = new Set(["test61.com", "test62.com"]); let domains = new Set(["test61.com", "test62.com"]);
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic( let resultsToReport =
domains await SearchSERPCategorization.applyCategorizationLogic(domains);
);
Assert.deepEqual( Assert.deepEqual(
resultsToReport, resultsToReport,

View File

@@ -71,12 +71,8 @@ add_task(async function test() {
}; };
let promiseRestoringTabs = new Promise(resolve => { let promiseRestoringTabs = new Promise(resolve => {
gProgressListener.setCallback(function ( gProgressListener.setCallback(
aBrowser, function (aBrowser, aNeedRestore, aRestoring, aRestored) {
aNeedRestore,
aRestoring,
aRestored
) {
// get the tab // get the tab
let tab; let tab;
for (let i = 0; i < window.gBrowser.tabs.length; i++) { for (let i = 0; i < window.gBrowser.tabs.length; i++) {
@@ -93,7 +89,8 @@ add_task(async function test() {
gProgressListener.unsetCallback(); gProgressListener.unsetCallback();
resolve(); resolve();
}); }
);
}); });
let backupState = ss.getBrowserState(); let backupState = ss.getBrowserState();

Some files were not shown because too many files have changed in this diff Show More