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:
@@ -252,9 +252,8 @@ addAccessibleTask(
|
||||
info("mutate: Adding new table");
|
||||
let shown = waitForEvent(EVENT_SHOW, "newTable");
|
||||
await invokeContentTask(browser, [], () => {
|
||||
content.document.getElementById(
|
||||
"newTableContainer"
|
||||
).innerHTML = `<table id="newTable"><tr><th>a</th></tr></table>`;
|
||||
content.document.getElementById("newTableContainer").innerHTML =
|
||||
`<table id="newTable"><tr><th>a</th></tr></table>`;
|
||||
});
|
||||
let newTable = (await shown).accessible;
|
||||
testAbsentAttrs(newTable, { "layout-guess": "true" });
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
|
||||
<!-- 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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
|
||||
<!-- 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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
|
||||
<!-- 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
|
||||
|
||||
@@ -207,10 +207,14 @@ async function waitForBookmarksToolbarVisibility({
|
||||
visible,
|
||||
message,
|
||||
}) {
|
||||
let result = await TestUtils.waitForCondition(() => {
|
||||
let result = await TestUtils.waitForCondition(
|
||||
() => {
|
||||
let toolbar = win.document.getElementById("PersonalToolbar");
|
||||
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);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -142,9 +142,8 @@ async function openInNewTabAndReturnContent(selector) {
|
||||
}
|
||||
|
||||
add_task(async function test_rightclick_open_bloburl_in_new_tab() {
|
||||
let blobDataFromLoadedPage = await rightClickOpenInNewTabAndReturnContent(
|
||||
"blob-url-link"
|
||||
);
|
||||
let blobDataFromLoadedPage =
|
||||
await rightClickOpenInNewTabAndReturnContent("blob-url-link");
|
||||
is(
|
||||
blobDataFromLoadedPage,
|
||||
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() {
|
||||
let blobDataFromLoadedPage = await openInNewTabAndReturnContent(
|
||||
"blob-url-link"
|
||||
);
|
||||
let blobDataFromLoadedPage =
|
||||
await openInNewTabAndReturnContent("blob-url-link");
|
||||
is(
|
||||
blobDataFromLoadedPage,
|
||||
blobDataAsString,
|
||||
|
||||
@@ -102,9 +102,12 @@ function getBackgroundColor(browser, expectedActive) {
|
||||
await ContentTaskUtils.waitForCondition(() => {
|
||||
return area;
|
||||
}, "Page has loaded");
|
||||
await ContentTaskUtils.waitForCondition(() => {
|
||||
await ContentTaskUtils.waitForCondition(
|
||||
() => {
|
||||
return area.matches(":-moz-window-inactive") == hasPseudoClass;
|
||||
}, `Window is considered ${hasPseudoClass ? "inactive" : "active"}`);
|
||||
},
|
||||
`Window is considered ${hasPseudoClass ? "inactive" : "active"}`
|
||||
);
|
||||
|
||||
return content.getComputedStyle(area).backgroundColor;
|
||||
}
|
||||
|
||||
@@ -136,9 +136,12 @@ let detectedStateFlags = [
|
||||
];
|
||||
|
||||
async function waitForClass(item, className, shouldBePresent = true) {
|
||||
await TestUtils.waitForCondition(() => {
|
||||
await TestUtils.waitForCondition(
|
||||
() => {
|
||||
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(
|
||||
item.classList.contains(className),
|
||||
|
||||
@@ -330,9 +330,8 @@ function openBrowserWindow(
|
||||
win.document.documentElement.removeAttribute("windowtype");
|
||||
|
||||
if (forcePrivate) {
|
||||
win.docShell.QueryInterface(
|
||||
Ci.nsILoadContext
|
||||
).usePrivateBrowsing = true;
|
||||
win.docShell.QueryInterface(Ci.nsILoadContext).usePrivateBrowsing =
|
||||
true;
|
||||
|
||||
if (
|
||||
AppConstants.platform == "win" &&
|
||||
@@ -654,9 +653,8 @@ nsBrowserContentHandler.prototype = {
|
||||
if (cmdLine.state == Ci.nsICommandLine.STATE_INITIAL_LAUNCH) {
|
||||
let win = Services.wm.getMostRecentWindow("navigator:blank");
|
||||
if (win) {
|
||||
win.docShell.QueryInterface(
|
||||
Ci.nsILoadContext
|
||||
).usePrivateBrowsing = true;
|
||||
win.docShell.QueryInterface(Ci.nsILoadContext).usePrivateBrowsing =
|
||||
true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5338,14 +5338,12 @@ var ContentBlockingCategoriesPrefs = {
|
||||
for (let item of rulesArray) {
|
||||
switch (item) {
|
||||
case "tp":
|
||||
this.CATEGORY_PREFS[type][
|
||||
"privacy.trackingprotection.enabled"
|
||||
] = true;
|
||||
this.CATEGORY_PREFS[type]["privacy.trackingprotection.enabled"] =
|
||||
true;
|
||||
break;
|
||||
case "-tp":
|
||||
this.CATEGORY_PREFS[type][
|
||||
"privacy.trackingprotection.enabled"
|
||||
] = false;
|
||||
this.CATEGORY_PREFS[type]["privacy.trackingprotection.enabled"] =
|
||||
false;
|
||||
break;
|
||||
case "tpPrivate":
|
||||
this.CATEGORY_PREFS[type][
|
||||
@@ -5454,14 +5452,12 @@ var ContentBlockingCategoriesPrefs = {
|
||||
this.CATEGORY_PREFS[type]["privacy.query_stripping.enabled"] = false;
|
||||
break;
|
||||
case "qpsPBM":
|
||||
this.CATEGORY_PREFS[type][
|
||||
"privacy.query_stripping.enabled.pbmode"
|
||||
] = true;
|
||||
this.CATEGORY_PREFS[type]["privacy.query_stripping.enabled.pbmode"] =
|
||||
true;
|
||||
break;
|
||||
case "-qpsPBM":
|
||||
this.CATEGORY_PREFS[type][
|
||||
"privacy.query_stripping.enabled.pbmode"
|
||||
] = false;
|
||||
this.CATEGORY_PREFS[type]["privacy.query_stripping.enabled.pbmode"] =
|
||||
false;
|
||||
break;
|
||||
case "fpp":
|
||||
this.CATEGORY_PREFS[type]["privacy.fingerprintingProtection"] = true;
|
||||
@@ -5470,14 +5466,12 @@ var ContentBlockingCategoriesPrefs = {
|
||||
this.CATEGORY_PREFS[type]["privacy.fingerprintingProtection"] = false;
|
||||
break;
|
||||
case "fppPrivate":
|
||||
this.CATEGORY_PREFS[type][
|
||||
"privacy.fingerprintingProtection.pbmode"
|
||||
] = true;
|
||||
this.CATEGORY_PREFS[type]["privacy.fingerprintingProtection.pbmode"] =
|
||||
true;
|
||||
break;
|
||||
case "-fppPrivate":
|
||||
this.CATEGORY_PREFS[type][
|
||||
"privacy.fingerprintingProtection.pbmode"
|
||||
] = false;
|
||||
this.CATEGORY_PREFS[type]["privacy.fingerprintingProtection.pbmode"] =
|
||||
false;
|
||||
break;
|
||||
case "cookieBehavior0":
|
||||
this.CATEGORY_PREFS[type]["network.cookie.cookieBehavior"] =
|
||||
|
||||
@@ -824,9 +824,8 @@ class AboutLoginsInternal {
|
||||
// by other more Sync-specific pages.
|
||||
const loggedIn = state.status != lazy.UIState.STATUS_NOT_CONFIGURED;
|
||||
const passwordSyncEnabled = state.syncEnabled && lazy.PASSWORD_SYNC_ENABLED;
|
||||
const accountURL = await lazy.FxAccounts.config.promiseManageURI(
|
||||
"password-manager"
|
||||
);
|
||||
const accountURL =
|
||||
await lazy.FxAccounts.config.promiseManageURI("password-manager");
|
||||
|
||||
return {
|
||||
loggedIn,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- 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/. -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -4,14 +4,13 @@
|
||||
|
||||
import { html, ifDefined } from "chrome://global/content/vendor/lit.all.mjs";
|
||||
|
||||
export const stylesTemplate = () =>
|
||||
html`
|
||||
export const stylesTemplate = () => html`
|
||||
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css" />
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="chrome://browser/content/aboutlogins/components/input-field/input-field.css"
|
||||
/>
|
||||
`;
|
||||
`;
|
||||
|
||||
export const editableFieldTemplate = ({
|
||||
type,
|
||||
@@ -22,8 +21,7 @@ export const editableFieldTemplate = ({
|
||||
onBlur,
|
||||
labelL10nId,
|
||||
noteL10nId,
|
||||
}) =>
|
||||
html`
|
||||
}) => html`
|
||||
<label
|
||||
for="input"
|
||||
class="field-label"
|
||||
@@ -48,4 +46,4 @@ export const editableFieldTemplate = ({
|
||||
class="explainer text-deemphasized"
|
||||
data-l10n-id=${ifDefined(noteL10nId)}
|
||||
></span>
|
||||
`;
|
||||
`;
|
||||
|
||||
@@ -47,24 +47,19 @@ BasicLoginAlert.argTypes = {
|
||||
},
|
||||
};
|
||||
|
||||
export const VulnerablePasswordAlert = ({ hostname }) =>
|
||||
html`
|
||||
export const VulnerablePasswordAlert = ({ hostname }) => html`
|
||||
<login-vulnerable-password-alert
|
||||
.hostname=${hostname}
|
||||
></login-vulnerable-password-alert>
|
||||
`;
|
||||
`;
|
||||
|
||||
VulnerablePasswordAlert.args = {
|
||||
hostname: "https://www.example.com",
|
||||
};
|
||||
|
||||
export const LoginBreachAlert = ({ date, hostname }) =>
|
||||
html`
|
||||
<login-breach-alert
|
||||
.date=${date}
|
||||
.hostname=${hostname}
|
||||
></login-breach-alert>
|
||||
`;
|
||||
export const LoginBreachAlert = ({ date, hostname }) => html`
|
||||
<login-breach-alert .date=${date} .hostname=${hostname}></login-breach-alert>
|
||||
`;
|
||||
|
||||
LoginBreachAlert.argTypes = {
|
||||
date: {
|
||||
|
||||
@@ -15,7 +15,8 @@ import {
|
||||
} from "chrome://global/content/vendor/lit.all.mjs";
|
||||
import { MozLitElement } from "chrome://global/content/lit-utils.mjs";
|
||||
|
||||
export const stylesTemplate = () => html`<link
|
||||
export const stylesTemplate = () =>
|
||||
html`<link
|
||||
rel="stylesheet"
|
||||
href="chrome://global/skin/in-content/common.css"
|
||||
/>
|
||||
@@ -31,16 +32,17 @@ export const LoginCommandButton = ({
|
||||
variant,
|
||||
disabled,
|
||||
buttonText,
|
||||
}) => html`<button
|
||||
}) =>
|
||||
html`<button
|
||||
class=${variant}
|
||||
data-l10n-id=${ifDefined(l10nId)}
|
||||
?disabled=${disabled}
|
||||
@click=${ifDefined(onClick)}
|
||||
>
|
||||
>
|
||||
<img src=${ifDefined(icon)} role="presentation" />
|
||||
|
||||
<span data-l10n-id=${ifDefined(buttonText)}></span>
|
||||
</button>`;
|
||||
</button>`;
|
||||
|
||||
export class CreateLoginButton extends MozLitElement {
|
||||
static get properties() {
|
||||
|
||||
@@ -121,10 +121,12 @@ export class LoginListItem extends MozLitElement {
|
||||
<span class="title" dir="auto">${this.title}</span>
|
||||
${when(
|
||||
this.username,
|
||||
() => html` <span class="subtitle" dir="auto">
|
||||
() =>
|
||||
html` <span class="subtitle" dir="auto">
|
||||
${this.username}
|
||||
</span>`,
|
||||
() => html`<span
|
||||
() =>
|
||||
html`<span
|
||||
class="subtitle"
|
||||
dir="auto"
|
||||
data-l10n-id="login-list-item-subtitle-missing-username"
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
import { html, ifDefined } from "chrome://global/content/vendor/lit.all.mjs";
|
||||
import { MozLitElement } from "chrome://global/content/lit-utils.mjs";
|
||||
|
||||
const stylesTemplate = () => html` <link
|
||||
const stylesTemplate = () =>
|
||||
html` <link
|
||||
rel="stylesheet"
|
||||
href="chrome://browser/content/aboutlogins/components/login-message-popup.css"
|
||||
/>`;
|
||||
/>`;
|
||||
|
||||
export const MessagePopup = ({ l10nid, message, webTitle = "" }) => {
|
||||
return html` <div class="tooltip-container">
|
||||
|
||||
@@ -264,9 +264,8 @@ add_task(async function test_open_import_one_item_from_csv() {
|
||||
]);
|
||||
await CsvImportHelper.waitForImportToComplete();
|
||||
|
||||
let summary = await CsvImportHelper.getCsvImportSuccessDialogData(
|
||||
browser
|
||||
);
|
||||
let summary =
|
||||
await CsvImportHelper.getCsvImportSuccessDialogData(browser);
|
||||
Assert.equal(summary.added, "1", "It should have one item as added");
|
||||
Assert.equal(
|
||||
summary.l10nFocused,
|
||||
@@ -304,9 +303,8 @@ add_task(async function test_open_import_all_four_categories() {
|
||||
await CsvImportHelper.clickImportFromCsvMenu(browser, updatedCsvData);
|
||||
await CsvImportHelper.waitForImportToComplete();
|
||||
|
||||
let summary = await CsvImportHelper.getCsvImportSuccessDialogData(
|
||||
browser
|
||||
);
|
||||
let summary =
|
||||
await CsvImportHelper.getCsvImportSuccessDialogData(browser);
|
||||
Assert.equal(summary.added, "1", "It should have one item as added");
|
||||
Assert.equal(
|
||||
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");
|
||||
const errorDialog = await CsvImportHelper.getCsvImportErrorDialogData(
|
||||
browser
|
||||
);
|
||||
const errorDialog =
|
||||
await CsvImportHelper.getCsvImportErrorDialogData(browser);
|
||||
Assert.equal(errorDialog.hidden, false, "Dialog should not be hidden");
|
||||
Assert.equal(
|
||||
errorDialog.l10nTitle,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- 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/. -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -43,9 +43,8 @@ describe("AWScreenUtils", () => {
|
||||
result: false,
|
||||
},
|
||||
});
|
||||
const result = await AWScreenUtils.evaluateScreenTargeting(
|
||||
"test expression"
|
||||
);
|
||||
const result =
|
||||
await AWScreenUtils.evaluateScreenTargeting("test expression");
|
||||
assert.calledOnce(evalStub);
|
||||
assert.equal(result, false);
|
||||
});
|
||||
@@ -56,9 +55,8 @@ describe("AWScreenUtils", () => {
|
||||
result: false,
|
||||
},
|
||||
});
|
||||
const result = await AWScreenUtils.evaluateScreenTargeting(
|
||||
"test expression"
|
||||
);
|
||||
const result =
|
||||
await AWScreenUtils.evaluateScreenTargeting("test expression");
|
||||
assert.calledOnce(evalStub);
|
||||
assert.equal(result, true);
|
||||
});
|
||||
|
||||
@@ -570,9 +570,8 @@ describe("MultiStageAboutWelcomeProton module", () => {
|
||||
};
|
||||
it("should not set url for default qrcode svg", async () => {
|
||||
sandbox.stub(global.AppConstants, "isChinaRepack").returns(false);
|
||||
const data = await AboutWelcomeDefaults.prepareContentForReact(
|
||||
TEST_CONTENT
|
||||
);
|
||||
const data =
|
||||
await AboutWelcomeDefaults.prepareContentForReact(TEST_CONTENT);
|
||||
assert.propertyVal(
|
||||
data.screens[0].content.hero_image,
|
||||
"url",
|
||||
@@ -581,9 +580,8 @@ describe("MultiStageAboutWelcomeProton module", () => {
|
||||
});
|
||||
it("should set url for cn qrcode svg", async () => {
|
||||
sandbox.stub(global.AppConstants, "isChinaRepack").returns(true);
|
||||
const data = await AboutWelcomeDefaults.prepareContentForReact(
|
||||
TEST_CONTENT
|
||||
);
|
||||
const data =
|
||||
await AboutWelcomeDefaults.prepareContentForReact(TEST_CONTENT);
|
||||
assert.propertyVal(
|
||||
data.screens[0].content.hero_image,
|
||||
"url",
|
||||
@@ -617,9 +615,8 @@ describe("MultiStageAboutWelcomeProton module", () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
const data = await AboutWelcomeDefaults.prepareContentForReact(
|
||||
TEST_CONTENT
|
||||
);
|
||||
const data =
|
||||
await AboutWelcomeDefaults.prepareContentForReact(TEST_CONTENT);
|
||||
assert.propertyVal(data, "ua", "test");
|
||||
assert.propertyVal(
|
||||
data.screens[0].content.primary_button.action.data,
|
||||
@@ -644,9 +641,8 @@ describe("MultiStageAboutWelcomeProton module", () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
const data = await AboutWelcomeDefaults.prepareContentForReact(
|
||||
TEST_CONTENT
|
||||
);
|
||||
const data =
|
||||
await AboutWelcomeDefaults.prepareContentForReact(TEST_CONTENT);
|
||||
assert.propertyVal(data, "ua", "test");
|
||||
assert.notPropertyVal(
|
||||
data.screens[0].content.primary_button.action.data,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- 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/. -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -263,9 +263,8 @@ export class FeatureCallout {
|
||||
this._removePanelConflictListeners();
|
||||
this.doc.querySelector(`[src="${BUNDLE_SRC}"]`)?.remove();
|
||||
if (nextMessage) {
|
||||
const isMessageUnblocked = await lazy.ASRouter.isUnblockedMessage(
|
||||
nextMessage
|
||||
);
|
||||
const isMessageUnblocked =
|
||||
await lazy.ASRouter.isUnblockedMessage(nextMessage);
|
||||
if (!isMessageUnblocked) {
|
||||
this.endTour();
|
||||
return;
|
||||
|
||||
@@ -535,8 +535,8 @@ add_task(async function checkAddonsInfo() {
|
||||
"service",
|
||||
]);
|
||||
|
||||
const { addons: asRouterAddons, isFullData } = await ASRouterTargeting
|
||||
.Environment.addonsInfo;
|
||||
const { addons: asRouterAddons, isFullData } =
|
||||
await ASRouterTargeting.Environment.addonsInfo;
|
||||
|
||||
ok(
|
||||
addons.every(({ id }) => asRouterAddons[id]),
|
||||
|
||||
@@ -1277,18 +1277,16 @@ export class BackupService extends EventTarget {
|
||||
await IOUtils.writeJSON(manifestPath, manifest);
|
||||
|
||||
currentStep = STEPS.CREATE_BACKUP_FINALIZE_STAGING;
|
||||
let renamedStagingPath = await this.#finalizeStagingFolder(
|
||||
stagingPath
|
||||
);
|
||||
let renamedStagingPath =
|
||||
await this.#finalizeStagingFolder(stagingPath);
|
||||
lazy.logConsole.log(
|
||||
"Wrote backup to staging directory at ",
|
||||
renamedStagingPath
|
||||
);
|
||||
|
||||
// Record the total size of the backup staging directory
|
||||
let totalSizeKilobytes = await BackupResource.getDirectorySize(
|
||||
renamedStagingPath
|
||||
);
|
||||
let totalSizeKilobytes =
|
||||
await BackupResource.getDirectorySize(renamedStagingPath);
|
||||
let totalSizeBytesNearestMebibyte = MeasurementUtils.fuzzByteSize(
|
||||
totalSizeKilobytes * BYTES_IN_KILOBYTE,
|
||||
1 * BYTES_IN_MEBIBYTE
|
||||
@@ -1330,9 +1328,8 @@ export class BackupService extends EventTarget {
|
||||
});
|
||||
|
||||
// Record the size of the complete single-file archive
|
||||
let archiveSizeKilobytes = await BackupResource.getFileSize(
|
||||
archiveTmpPath
|
||||
);
|
||||
let archiveSizeKilobytes =
|
||||
await BackupResource.getFileSize(archiveTmpPath);
|
||||
let archiveSizeBytesNearestMebibyte = MeasurementUtils.fuzzByteSize(
|
||||
archiveSizeKilobytes * BYTES_IN_KILOBYTE,
|
||||
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
|
||||
// one to decrypt it. We now generate a new ArchiveEncryptionState with
|
||||
// that recovery code to write into the recovered profile.
|
||||
({ instance: encState } = await lazy.ArchiveEncryptionState.initialize(
|
||||
recoveryCode
|
||||
));
|
||||
({ instance: encState } =
|
||||
await lazy.ArchiveEncryptionState.initialize(recoveryCode));
|
||||
}
|
||||
|
||||
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
|
||||
// password is not considered common.
|
||||
({ instance: encState } = await lazy.ArchiveEncryptionState.initialize(
|
||||
password
|
||||
));
|
||||
({ instance: encState } =
|
||||
await lazy.ArchiveEncryptionState.initialize(password));
|
||||
if (!encState) {
|
||||
throw new BackupError(
|
||||
"Failed to construct ArchiveEncryptionState",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- 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, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
|
||||
@@ -143,9 +143,8 @@ export class BackupResource {
|
||||
|
||||
let size = 0;
|
||||
for (const childFilePath of children) {
|
||||
let { size: childSize, type: childType } = await IOUtils.stat(
|
||||
childFilePath
|
||||
);
|
||||
let { size: childSize, type: childType } =
|
||||
await IOUtils.stat(childFilePath);
|
||||
|
||||
if (shouldExclude(childFilePath, childType, directoryPath)) {
|
||||
continue;
|
||||
|
||||
@@ -176,9 +176,8 @@ export class PreferencesBackupResource extends BackupResource {
|
||||
}
|
||||
|
||||
const chromeDirectoryPath = PathUtils.join(profilePath, "chrome");
|
||||
let chromeDirectorySize = await BackupResource.getDirectorySize(
|
||||
chromeDirectoryPath
|
||||
);
|
||||
let chromeDirectorySize =
|
||||
await BackupResource.getDirectorySize(chromeDirectoryPath);
|
||||
if (Number.isInteger(chromeDirectorySize)) {
|
||||
fullSize += chromeDirectorySize;
|
||||
}
|
||||
|
||||
@@ -35,9 +35,8 @@ add_setup(async () => {
|
||||
* of an ArchiveEncryptionState.
|
||||
*/
|
||||
add_task(async function test_ArchiveEncryptor_initializer() {
|
||||
let { instance: encState } = await ArchiveEncryptionState.initialize(
|
||||
TEST_RECOVERY_CODE
|
||||
);
|
||||
let { instance: encState } =
|
||||
await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
|
||||
let encryptor = await ArchiveEncryptor.initialize(
|
||||
encState.publicKey,
|
||||
encState.backupAuthKey
|
||||
@@ -49,9 +48,8 @@ add_task(async function test_ArchiveEncryptor_initializer() {
|
||||
* Tests that we can encrypt a single chunk of bytes.
|
||||
*/
|
||||
add_task(async function test_ArchiveEncryption_single_chunk() {
|
||||
let { instance: encState } = await ArchiveEncryptionState.initialize(
|
||||
TEST_RECOVERY_CODE
|
||||
);
|
||||
let { instance: encState } =
|
||||
await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
|
||||
let encryptor = await ArchiveEncryptor.initialize(
|
||||
encState.publicKey,
|
||||
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.
|
||||
*/
|
||||
add_task(async function test_ArchiveEncryption_uneven_chunks() {
|
||||
let { instance: encState } = await ArchiveEncryptionState.initialize(
|
||||
TEST_RECOVERY_CODE
|
||||
);
|
||||
let { instance: encState } =
|
||||
await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
|
||||
let encryptor = await ArchiveEncryptor.initialize(
|
||||
encState.publicKey,
|
||||
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.
|
||||
*/
|
||||
add_task(async function test_ArchiveEncryption_even_chunks() {
|
||||
let { instance: encState } = await ArchiveEncryptionState.initialize(
|
||||
TEST_RECOVERY_CODE
|
||||
);
|
||||
let { instance: encState } =
|
||||
await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
|
||||
let encryptor = await ArchiveEncryptor.initialize(
|
||||
encState.publicKey,
|
||||
encState.backupAuthKey
|
||||
@@ -300,9 +296,8 @@ add_task(async function test_ArchiveEncryption_even_chunks() {
|
||||
* Tests that we cannot decrypt with the wrong recovery code.
|
||||
*/
|
||||
add_task(async function test_ArchiveEncryption_wrong_recoveryCode() {
|
||||
let { instance: encState } = await ArchiveEncryptionState.initialize(
|
||||
TEST_RECOVERY_CODE
|
||||
);
|
||||
let { instance: encState } =
|
||||
await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
|
||||
let encryptor = await ArchiveEncryptor.initialize(
|
||||
encState.publicKey,
|
||||
encState.backupAuthKey
|
||||
|
||||
@@ -31,9 +31,8 @@ add_task(async function test_ArchiveEncryptionState_enable() {
|
||||
*/
|
||||
add_task(
|
||||
async function test_ArchiveEncryptionState_serialization_deserialization() {
|
||||
let { instance: encState } = await ArchiveEncryptionState.initialize(
|
||||
TEST_RECOVERY_CODE
|
||||
);
|
||||
let { instance: encState } =
|
||||
await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
|
||||
let serialization = await encState.serialize();
|
||||
|
||||
// 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."
|
||||
);
|
||||
|
||||
let { instance: recoveredState } = await ArchiveEncryptionState.initialize(
|
||||
serialization
|
||||
);
|
||||
let { instance: recoveredState } =
|
||||
await ArchiveEncryptionState.initialize(serialization);
|
||||
|
||||
Assert.deepEqual(
|
||||
encState.publicKey,
|
||||
@@ -75,9 +73,8 @@ add_task(
|
||||
* a serialized state from a newer version of ArchiveEncryptionState.
|
||||
*/
|
||||
add_task(async function test_ArchiveEncryptionState_deserialize_newer() {
|
||||
let { instance: encState } = await ArchiveEncryptionState.initialize(
|
||||
TEST_RECOVERY_CODE
|
||||
);
|
||||
let { instance: encState } =
|
||||
await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
|
||||
let serialization = await encState.serialize();
|
||||
|
||||
// We'll pretend to write this serialization to disk by stringifying it,
|
||||
|
||||
@@ -127,9 +127,8 @@ add_task(async function test_createArchive_encrypted() {
|
||||
const TEST_RECOVERY_CODE = "This is some recovery code.";
|
||||
|
||||
let bs = new BackupService();
|
||||
let { instance: encState } = await ArchiveEncryptionState.initialize(
|
||||
TEST_RECOVERY_CODE
|
||||
);
|
||||
let { instance: encState } =
|
||||
await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
|
||||
|
||||
const FAKE_ARCHIVE_PATH = PathUtils.join(
|
||||
testProfilePath,
|
||||
@@ -245,9 +244,8 @@ add_task(async function test_createArchive_encrypted_truncated() {
|
||||
const TEST_RECOVERY_CODE = "This is some recovery code.";
|
||||
|
||||
let bs = new BackupService();
|
||||
let { instance: encState } = await ArchiveEncryptionState.initialize(
|
||||
TEST_RECOVERY_CODE
|
||||
);
|
||||
let { instance: encState } =
|
||||
await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
|
||||
|
||||
const FAKE_ARCHIVE_PATH = PathUtils.join(
|
||||
testProfilePath,
|
||||
@@ -327,9 +325,8 @@ add_task(async function test_createArchive_early_binary_stream_close() {
|
||||
const TEST_RECOVERY_CODE = "This is some recovery code.";
|
||||
|
||||
let bs = new BackupService();
|
||||
let { instance: encState } = await ArchiveEncryptionState.initialize(
|
||||
TEST_RECOVERY_CODE
|
||||
);
|
||||
let { instance: encState } =
|
||||
await ArchiveEncryptionState.initialize(TEST_RECOVERY_CODE);
|
||||
|
||||
const FAKE_ARCHIVE_PATH = PathUtils.join(
|
||||
testProfilePath,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# 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/.
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
||||
@@ -66,9 +66,8 @@ async function test_background_update_pref(expectedEnabled, expectedLocked) {
|
||||
}
|
||||
|
||||
add_task(async function test_background_app_update_policy() {
|
||||
const origBackgroundUpdateVal = await UpdateUtils.readUpdateConfigSetting(
|
||||
PREF_NAME
|
||||
);
|
||||
const origBackgroundUpdateVal =
|
||||
await UpdateUtils.readUpdateConfigSetting(PREF_NAME);
|
||||
registerCleanupFunction(async () => {
|
||||
await UpdateUtils.writeUpdateConfigSetting(
|
||||
PREF_NAME,
|
||||
|
||||
@@ -49,9 +49,8 @@ async function test_cookie_settings({
|
||||
uri: firstPartyURI,
|
||||
loadUsingSystemPrincipal: true,
|
||||
});
|
||||
channel.QueryInterface(
|
||||
Ci.nsIHttpChannelInternal
|
||||
).forceAllowThirdPartyCookie = true;
|
||||
channel.QueryInterface(Ci.nsIHttpChannelInternal).forceAllowThirdPartyCookie =
|
||||
true;
|
||||
Services.cookies.removeAll();
|
||||
Services.cookies.setCookieStringFromHttp(
|
||||
firstPartyURI,
|
||||
|
||||
@@ -136,9 +136,8 @@ async function handleHomepageUrl(extension, homepageUrl) {
|
||||
// eslint-disable-next-line mozilla/balanced-listeners
|
||||
extension.on("add-permissions", async (ignoreEvent, permissions) => {
|
||||
if (permissions.permissions.includes("internal:privateBrowsingAllowed")) {
|
||||
let item = await ExtensionPreferencesManager.getSetting(
|
||||
"homepage_override"
|
||||
);
|
||||
let item =
|
||||
await ExtensionPreferencesManager.getSetting("homepage_override");
|
||||
if (item && item.id == extension.id) {
|
||||
Services.prefs.setBoolPref(HOMEPAGE_PRIVATE_ALLOWED, true);
|
||||
}
|
||||
@@ -147,9 +146,8 @@ async function handleHomepageUrl(extension, homepageUrl) {
|
||||
// eslint-disable-next-line mozilla/balanced-listeners
|
||||
extension.on("remove-permissions", async (ignoreEvent, permissions) => {
|
||||
if (permissions.permissions.includes("internal:privateBrowsingAllowed")) {
|
||||
let item = await ExtensionPreferencesManager.getSetting(
|
||||
"homepage_override"
|
||||
);
|
||||
let item =
|
||||
await ExtensionPreferencesManager.getSetting("homepage_override");
|
||||
if (item && item.id == extension.id) {
|
||||
Services.prefs.setBoolPref(HOMEPAGE_PRIVATE_ALLOWED, false);
|
||||
}
|
||||
|
||||
@@ -29,9 +29,8 @@ async function runTests(options) {
|
||||
"expected value from getBadge"
|
||||
);
|
||||
|
||||
let badgeBackgroundColor = await browser[action].getBadgeBackgroundColor(
|
||||
details
|
||||
);
|
||||
let badgeBackgroundColor =
|
||||
await browser[action].getBadgeBackgroundColor(details);
|
||||
browser.test.assertEq(
|
||||
String(expecting.badgeBackgroundColor),
|
||||
String(badgeBackgroundColor),
|
||||
|
||||
@@ -139,9 +139,8 @@ add_task(async function test_devtools_inspectedWindow_tabId() {
|
||||
|
||||
await extension.startup();
|
||||
|
||||
let backgroundPageCurrentTabId = await extension.awaitMessage(
|
||||
"current-tab-id"
|
||||
);
|
||||
let backgroundPageCurrentTabId =
|
||||
await extension.awaitMessage("current-tab-id");
|
||||
|
||||
await openToolboxForTab(tab);
|
||||
|
||||
|
||||
@@ -72,16 +72,20 @@ add_task(async function test_devtools_panels_elements_sidebar() {
|
||||
);
|
||||
|
||||
async function devtools_page() {
|
||||
const sidebar1 = await browser.devtools.panels.elements.createSidebarPane(
|
||||
const sidebar1 =
|
||||
await browser.devtools.panels.elements.createSidebarPane(
|
||||
"Test Sidebar 1"
|
||||
);
|
||||
const sidebar2 = await browser.devtools.panels.elements.createSidebarPane(
|
||||
const sidebar2 =
|
||||
await browser.devtools.panels.elements.createSidebarPane(
|
||||
"Test Sidebar 2"
|
||||
);
|
||||
const sidebar3 = await browser.devtools.panels.elements.createSidebarPane(
|
||||
const sidebar3 =
|
||||
await browser.devtools.panels.elements.createSidebarPane(
|
||||
"Test Sidebar 3"
|
||||
);
|
||||
const sidebar4 = await browser.devtools.panels.elements.createSidebarPane(
|
||||
const sidebar4 =
|
||||
await browser.devtools.panels.elements.createSidebarPane(
|
||||
"Test Sidebar 4"
|
||||
);
|
||||
|
||||
|
||||
@@ -38,11 +38,8 @@ add_task(async function testFind() {
|
||||
async function background() {
|
||||
function awaitLoad(tabId, url) {
|
||||
return new Promise(resolve => {
|
||||
browser.tabs.onUpdated.addListener(function listener(
|
||||
tabId_,
|
||||
changed,
|
||||
tab
|
||||
) {
|
||||
browser.tabs.onUpdated.addListener(
|
||||
function listener(tabId_, changed, tab) {
|
||||
if (
|
||||
tabId == tabId_ &&
|
||||
changed.status == "complete" &&
|
||||
@@ -51,7 +48,8 @@ add_task(async function testFind() {
|
||||
browser.tabs.onUpdated.removeListener(listener);
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -297,11 +295,8 @@ add_task(async function testRemoveHighlighting() {
|
||||
async function background() {
|
||||
function awaitLoad(tabId, url) {
|
||||
return new Promise(resolve => {
|
||||
browser.tabs.onUpdated.addListener(function listener(
|
||||
tabId_,
|
||||
changed,
|
||||
tab
|
||||
) {
|
||||
browser.tabs.onUpdated.addListener(
|
||||
function listener(tabId_, changed, tab) {
|
||||
if (
|
||||
tabId == tabId_ &&
|
||||
changed.status == "complete" &&
|
||||
@@ -310,7 +305,8 @@ add_task(async function testRemoveHighlighting() {
|
||||
browser.tabs.onUpdated.removeListener(listener);
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -71,16 +71,14 @@ add_task(async function testIncognitoPopup() {
|
||||
const testPrivateWindow = async () => {
|
||||
const URL = "https://example.com/incognito";
|
||||
const windowReady = new Promise(resolve => {
|
||||
browser.tabs.onUpdated.addListener(function listener(
|
||||
tabId,
|
||||
changed,
|
||||
tab
|
||||
) {
|
||||
browser.tabs.onUpdated.addListener(
|
||||
function listener(tabId, changed, tab) {
|
||||
if (changed.status == "complete" && tab.url == URL) {
|
||||
browser.tabs.onUpdated.removeListener(listener);
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
const window = await browser.windows.create({
|
||||
|
||||
@@ -101,9 +101,8 @@ add_task(async function test_tab_options_popups() {
|
||||
|
||||
const optionsBrowser = getInlineOptionsBrowser(gBrowser.selectedBrowser);
|
||||
|
||||
const contentAreaContextMenu = await openContextMenuInOptionsPage(
|
||||
optionsBrowser
|
||||
);
|
||||
const contentAreaContextMenu =
|
||||
await openContextMenuInOptionsPage(optionsBrowser);
|
||||
|
||||
let contextMenuItemIds = [
|
||||
"context-openlinkintab",
|
||||
@@ -220,9 +219,8 @@ add_task(async function overrideContext_in_options_page() {
|
||||
await extension.awaitMessage("options-page:loaded");
|
||||
|
||||
const optionsBrowser = getInlineOptionsBrowser(gBrowser.selectedBrowser);
|
||||
const contentAreaContextMenu = await openContextMenuInOptionsPage(
|
||||
optionsBrowser
|
||||
);
|
||||
const contentAreaContextMenu =
|
||||
await openContextMenuInOptionsPage(optionsBrowser);
|
||||
|
||||
await extension.awaitMessage("contextmenu-overridden");
|
||||
|
||||
|
||||
@@ -168,9 +168,8 @@ add_task(async function test_search_default_engine() {
|
||||
let tabId = await extensionWithObserver.awaitMessage("ready");
|
||||
|
||||
extension.sendMessage("search", tabId);
|
||||
let requestDetails = await extensionWithObserver.awaitMessage(
|
||||
"detectedSearch"
|
||||
);
|
||||
let requestDetails =
|
||||
await extensionWithObserver.awaitMessage("detectedSearch");
|
||||
await extension.unload();
|
||||
await extensionWithObserver.unload();
|
||||
|
||||
|
||||
@@ -51,9 +51,8 @@ add_task(async function test_sessions_get_recently_closed() {
|
||||
|
||||
await extension.startup();
|
||||
|
||||
let { recentlyClosed, currentWindowId } = await extension.awaitMessage(
|
||||
"initialData"
|
||||
);
|
||||
let { recentlyClosed, currentWindowId } =
|
||||
await extension.awaitMessage("initialData");
|
||||
recordInitialTimestamps(recentlyClosed.map(item => item.lastModified));
|
||||
|
||||
await openAndCloseWindow();
|
||||
|
||||
@@ -4,11 +4,8 @@
|
||||
|
||||
add_task(async function test_sidebar_click_isAppTab_behavior() {
|
||||
function sidebarScript() {
|
||||
browser.tabs.onUpdated.addListener(function onUpdated(
|
||||
tabId,
|
||||
changeInfo,
|
||||
tab
|
||||
) {
|
||||
browser.tabs.onUpdated.addListener(
|
||||
function onUpdated(tabId, changeInfo, tab) {
|
||||
if (
|
||||
changeInfo.status == "complete" &&
|
||||
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.test.notifyPass("sidebar-click");
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
window.addEventListener(
|
||||
"load",
|
||||
() => {
|
||||
|
||||
@@ -97,16 +97,17 @@ add_task(async function default_url() {
|
||||
background() {
|
||||
function promiseNonBlankTab() {
|
||||
return new Promise(resolve => {
|
||||
browser.tabs.onUpdated.addListener(function listener(
|
||||
tabId,
|
||||
changeInfo,
|
||||
tab
|
||||
browser.tabs.onUpdated.addListener(
|
||||
function listener(tabId, changeInfo, tab) {
|
||||
if (
|
||||
changeInfo.status === "complete" &&
|
||||
tab.url !== "about:blank"
|
||||
) {
|
||||
if (changeInfo.status === "complete" && tab.url !== "about:blank") {
|
||||
browser.tabs.onUpdated.removeListener(listener);
|
||||
resolve(tab);
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -27,15 +27,17 @@ add_task(async function () {
|
||||
}
|
||||
resetLoad();
|
||||
|
||||
browser.tabs.onUpdated.addListener(function listener(
|
||||
tabId_,
|
||||
changed,
|
||||
tab
|
||||
browser.tabs.onUpdated.addListener(
|
||||
function listener(tabId_, changed, tab) {
|
||||
if (
|
||||
tabId == tabId_ &&
|
||||
changed.status == "complete" &&
|
||||
tab.url == URL
|
||||
) {
|
||||
if (tabId == tabId_ && changed.status == "complete" && tab.url == URL) {
|
||||
resolveLoad();
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
try {
|
||||
let tab = await browser.tabs.create({ url: URL });
|
||||
|
||||
@@ -64,9 +64,8 @@ async function runTest(stopLoadFunc) {
|
||||
stopLoadFunc(slowTab);
|
||||
|
||||
// Retrieve the requestId from onBeforeRequest
|
||||
let requestIdOnBeforeRequest = await extension.awaitMessage(
|
||||
"onBeforeRequest"
|
||||
);
|
||||
let requestIdOnBeforeRequest =
|
||||
await extension.awaitMessage("onBeforeRequest");
|
||||
|
||||
// Now verify that we got the correct event and request id
|
||||
let doneMessage = await extension.awaitMessage("done");
|
||||
|
||||
@@ -46,9 +46,8 @@ add_task(async function testWindowCreateFocused() {
|
||||
async background() {
|
||||
async function doWaitForWindow(createOpts, resolve) {
|
||||
let created;
|
||||
browser.windows.onFocusChanged.addListener(async function listener(
|
||||
wid
|
||||
) {
|
||||
browser.windows.onFocusChanged.addListener(
|
||||
async function listener(wid) {
|
||||
if (wid == browser.windows.WINDOW_ID_NONE) {
|
||||
return;
|
||||
}
|
||||
@@ -60,7 +59,8 @@ add_task(async function testWindowCreateFocused() {
|
||||
// update the window object
|
||||
let window = await browser.windows.get(wid);
|
||||
resolve(window);
|
||||
});
|
||||
}
|
||||
);
|
||||
created = browser.windows.create(createOpts);
|
||||
}
|
||||
async function awaitNewFocusedWindow(createOpts) {
|
||||
|
||||
@@ -32,15 +32,14 @@ add_task(async function testWindowCreate() {
|
||||
|
||||
let promiseTabUpdated = expected => {
|
||||
return new Promise(resolve => {
|
||||
browser.tabs.onUpdated.addListener(function listener(
|
||||
tabId,
|
||||
changeInfo
|
||||
) {
|
||||
browser.tabs.onUpdated.addListener(
|
||||
function listener(tabId, changeInfo) {
|
||||
if (changeInfo.url === expected) {
|
||||
browser.tabs.onUpdated.removeListener(listener);
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -13,12 +13,12 @@ add_task(async function test_window_incognito() {
|
||||
background() {
|
||||
let lastFocusedWindowId = null;
|
||||
// Catch focus change events to power the test below.
|
||||
browser.windows.onFocusChanged.addListener(function listener(
|
||||
eventWindowId
|
||||
) {
|
||||
browser.windows.onFocusChanged.addListener(
|
||||
function listener(eventWindowId) {
|
||||
lastFocusedWindowId = eventWindowId;
|
||||
browser.windows.onFocusChanged.removeListener(listener);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
browser.test.onMessage.addListener(async pbw => {
|
||||
browser.test.assertEq(
|
||||
|
||||
@@ -8,9 +8,8 @@ add_task(async function testWindowRemove() {
|
||||
async function closeWindow(id) {
|
||||
let window = await browser.windows.get(id);
|
||||
return new Promise(function (resolve) {
|
||||
browser.windows.onRemoved.addListener(async function listener(
|
||||
windowId
|
||||
) {
|
||||
browser.windows.onRemoved.addListener(
|
||||
async function listener(windowId) {
|
||||
browser.windows.onRemoved.removeListener(listener);
|
||||
await browser.test.assertEq(
|
||||
windowId,
|
||||
@@ -23,7 +22,8 @@ add_task(async function testWindowRemove() {
|
||||
"The window was really closed."
|
||||
);
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
);
|
||||
browser.windows.remove(id);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -201,9 +201,8 @@ add_task(async function test_delete() {
|
||||
);
|
||||
|
||||
extension.sendMessage("delete-all");
|
||||
[historyClearedCount, removedUrls] = await extension.awaitMessage(
|
||||
"history-cleared"
|
||||
);
|
||||
[historyClearedCount, removedUrls] =
|
||||
await extension.awaitMessage("history-cleared");
|
||||
equal(
|
||||
historyClearedCount,
|
||||
2,
|
||||
|
||||
@@ -132,7 +132,8 @@ class CardContainer extends MozLitElement {
|
||||
/>
|
||||
${when(
|
||||
this.toggleDisabled,
|
||||
() => html`<div
|
||||
() =>
|
||||
html`<div
|
||||
class=${classMap({
|
||||
"card-container": true,
|
||||
inner: this.isInnerCard,
|
||||
@@ -159,7 +160,8 @@ class CardContainer extends MozLitElement {
|
||||
<slot name="main"></slot>
|
||||
<slot name="footer" class="card-container-footer"></slot>
|
||||
</div>`,
|
||||
() => html`<details
|
||||
() =>
|
||||
html`<details
|
||||
class=${classMap({
|
||||
"card-container": true,
|
||||
inner: this.isInnerCard,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- 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/. -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -113,7 +113,8 @@ class FxviewEmptyState extends MozLitElement {
|
||||
${repeat(
|
||||
this.descriptionLabels,
|
||||
descLabel => descLabel,
|
||||
(descLabel, index) => html`<p
|
||||
(descLabel, index) =>
|
||||
html`<p
|
||||
class=${classMap({
|
||||
description: true,
|
||||
secondary: index !== 0,
|
||||
|
||||
@@ -697,7 +697,8 @@ export class FxviewTabRowBase extends MozLitElement {
|
||||
secondaryButtonTemplate() {
|
||||
return html`${when(
|
||||
this.secondaryL10nId && this.secondaryActionHandler,
|
||||
() => html`<moz-button
|
||||
() =>
|
||||
html`<moz-button
|
||||
type="icon ghost"
|
||||
class=${classMap({
|
||||
"fxview-tab-row-button": true,
|
||||
@@ -719,7 +720,8 @@ export class FxviewTabRowBase extends MozLitElement {
|
||||
tertiaryButtonTemplate() {
|
||||
return html`${when(
|
||||
this.tertiaryL10nId && this.tertiaryActionHandler,
|
||||
() => html`<moz-button
|
||||
() =>
|
||||
html`<moz-button
|
||||
type="icon ghost"
|
||||
class=${classMap({
|
||||
"fxview-tab-row-button": true,
|
||||
@@ -760,7 +762,8 @@ export class FxviewTabRow extends FxviewTabRowBase {
|
||||
${this.faviconTemplate()} ${this.titleTemplate()}
|
||||
${when(
|
||||
!this.compact,
|
||||
() => html`${this.urlTemplate()} ${this.dateTemplate()}
|
||||
() =>
|
||||
html`${this.urlTemplate()} ${this.dateTemplate()}
|
||||
${this.timeTemplate()}`
|
||||
)}
|
||||
</a>
|
||||
|
||||
@@ -487,7 +487,8 @@ export class OpenTabsTabRow extends FxviewTabRowBase {
|
||||
return html`${when(
|
||||
this.indicators?.includes("soundplaying") ||
|
||||
this.indicators?.includes("muted"),
|
||||
() => html`<moz-button
|
||||
() =>
|
||||
html`<moz-button
|
||||
type="icon ghost"
|
||||
class="fxview-tab-row-button"
|
||||
id="fxview-tab-row-media-button"
|
||||
@@ -558,7 +559,8 @@ export class OpenTabsTabRow extends FxviewTabRowBase {
|
||||
${this.#faviconTemplate()} ${this.titleTemplate()}
|
||||
${when(
|
||||
!this.compact,
|
||||
() => html`${this.#containerIndicatorTemplate()} ${this.urlTemplate()}
|
||||
() =>
|
||||
html`${this.#containerIndicatorTemplate()} ${this.urlTemplate()}
|
||||
${this.dateTemplate()} ${this.timeTemplate()}`
|
||||
)}
|
||||
</a>
|
||||
|
||||
@@ -271,8 +271,7 @@ class OpenTabsInView extends ViewPage {
|
||||
>
|
||||
${when(
|
||||
currentWindowIndex && currentWindowTabs,
|
||||
() =>
|
||||
html`
|
||||
() => html`
|
||||
<view-opentabs-card
|
||||
class=${cardClasses}
|
||||
.tabs=${currentWindowTabs}
|
||||
@@ -542,7 +541,8 @@ class OpenTabsInViewCard extends ViewPageContent {
|
||||
>
|
||||
${when(
|
||||
this.recentBrowsing,
|
||||
() => html`<h3
|
||||
() =>
|
||||
html`<h3
|
||||
slot="header"
|
||||
data-l10n-id="firefoxview-opentabs-header"
|
||||
></h3>`,
|
||||
@@ -567,7 +567,8 @@ class OpenTabsInViewCard extends ViewPageContent {
|
||||
</div>
|
||||
${when(
|
||||
this.recentBrowsing,
|
||||
() => html` <div
|
||||
() =>
|
||||
html` <div
|
||||
@click=${this.enableShowAll}
|
||||
@keydown=${this.enableShowAll}
|
||||
data-l10n-id="firefoxview-show-all"
|
||||
|
||||
@@ -163,9 +163,8 @@ class RecentlyClosedTabsInView extends ViewPage {
|
||||
}
|
||||
|
||||
updateRecentlyClosedTabs() {
|
||||
let recentlyClosedTabsData = lazy.SessionStore.getClosedTabData(
|
||||
getWindow()
|
||||
);
|
||||
let recentlyClosedTabsData =
|
||||
lazy.SessionStore.getClosedTabData(getWindow());
|
||||
if (Services.prefs.getBoolPref(INCLUDE_CLOSED_TABS_FROM_CLOSED_WINDOWS)) {
|
||||
recentlyClosedTabsData.push(
|
||||
...lazy.SessionStore.getClosedTabDataFromClosedWindows()
|
||||
@@ -338,7 +337,8 @@ class RecentlyClosedTabsInView extends ViewPage {
|
||||
/>
|
||||
${when(
|
||||
!this.recentBrowsing,
|
||||
() => html`<div
|
||||
() =>
|
||||
html`<div
|
||||
class="sticky-container bottom-fade"
|
||||
?hidden=${!this.selectedTab}
|
||||
>
|
||||
@@ -374,8 +374,7 @@ class RecentlyClosedTabsInView extends ViewPage {
|
||||
></h3>
|
||||
${when(
|
||||
this.recentlyClosedTabs.length,
|
||||
() =>
|
||||
html`
|
||||
() => html`
|
||||
<fxview-tab-list
|
||||
slot="main"
|
||||
.maxTabsLength=${!this.recentBrowsing || this.showAll
|
||||
@@ -397,7 +396,8 @@ class RecentlyClosedTabsInView extends ViewPage {
|
||||
)}
|
||||
${when(
|
||||
this.isShowAllLinkVisible(),
|
||||
() => html` <div
|
||||
() =>
|
||||
html` <div
|
||||
@click=${this.enableShowAll}
|
||||
@keydown=${this.enableShowAll}
|
||||
data-l10n-id="firefoxview-show-all"
|
||||
|
||||
@@ -142,7 +142,8 @@ export class SyncedTabsTabRow extends FxviewTabRowBase {
|
||||
secondaryButtonTemplate() {
|
||||
return html`${when(
|
||||
this.secondaryL10nId && this.secondaryActionHandler,
|
||||
() => html`<moz-button
|
||||
() =>
|
||||
html`<moz-button
|
||||
type="icon ghost"
|
||||
class=${classMap({
|
||||
"fxview-tab-row-button": true,
|
||||
@@ -183,7 +184,8 @@ export class SyncedTabsTabRow extends FxviewTabRowBase {
|
||||
${this.faviconTemplate()} ${this.titleTemplate()}
|
||||
${when(
|
||||
!this.compact,
|
||||
() => html`${this.urlTemplate()} ${this.dateTemplate()}
|
||||
() =>
|
||||
html`${this.urlTemplate()} ${this.dateTemplate()}
|
||||
${this.timeTemplate()}`
|
||||
)}
|
||||
</a>
|
||||
|
||||
@@ -306,7 +306,8 @@ class SyncedTabsInView extends ViewPage {
|
||||
</card-container>`;
|
||||
renderArray.push(template);
|
||||
if (this.isShowAllLinkVisible(tabItems)) {
|
||||
renderArray.push(html` <div class="show-all-link-container">
|
||||
renderArray.push(
|
||||
html` <div class="show-all-link-container">
|
||||
<div
|
||||
class="show-all-link"
|
||||
@click=${this.enableShowAll}
|
||||
@@ -315,7 +316,8 @@ class SyncedTabsInView extends ViewPage {
|
||||
tabindex="0"
|
||||
role="link"
|
||||
></div>
|
||||
</div>`);
|
||||
</div>`
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// 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);
|
||||
|
||||
let renderArray = [];
|
||||
renderArray.push(html` <link
|
||||
renderArray.push(
|
||||
html` <link
|
||||
rel="stylesheet"
|
||||
href="chrome://browser/content/firefoxview/view-syncedtabs.css"
|
||||
/>`);
|
||||
renderArray.push(html` <link
|
||||
/>`
|
||||
);
|
||||
renderArray.push(
|
||||
html` <link
|
||||
rel="stylesheet"
|
||||
href="chrome://browser/content/firefoxview/firefoxview.css"
|
||||
/>`);
|
||||
/>`
|
||||
);
|
||||
|
||||
if (!this.recentBrowsing) {
|
||||
renderArray.push(html`<div class="sticky-container bottom-fade">
|
||||
renderArray.push(
|
||||
html`<div class="sticky-container bottom-fade">
|
||||
<h2
|
||||
class="page-header"
|
||||
data-l10n-id="firefoxview-synced-tabs-header"
|
||||
@@ -392,7 +399,9 @@ class SyncedTabsInView extends ViewPage {
|
||||
data-l10n-attrs="placeholder"
|
||||
@fxview-search-textbox-query=${this.onSearchQuery}
|
||||
.size=${this.searchTextboxSize}
|
||||
pageName=${this.recentBrowsing ? "recentbrowsing" : "syncedtabs"}
|
||||
pageName=${this.recentBrowsing
|
||||
? "recentbrowsing"
|
||||
: "syncedtabs"}
|
||||
></fxview-search-textbox>
|
||||
</div>
|
||||
${when(
|
||||
@@ -416,7 +425,8 @@ class SyncedTabsInView extends ViewPage {
|
||||
`
|
||||
)}
|
||||
</div>
|
||||
</div>`);
|
||||
</div>`
|
||||
);
|
||||
}
|
||||
|
||||
if (this.recentBrowsing) {
|
||||
|
||||
@@ -448,9 +448,8 @@ add_task(async function test_cumulative_searches_recently_closed_telemetry() {
|
||||
EventUtils.synthesizeMouseAtCenter(searchTextbox, {}, content);
|
||||
EventUtils.sendString(URLs[0], content);
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const [recentlyclosedSlot, tabList] = await waitForRecentlyClosedTabsList(
|
||||
document
|
||||
);
|
||||
const [recentlyclosedSlot, tabList] =
|
||||
await waitForRecentlyClosedTabsList(document);
|
||||
await TestUtils.waitForCondition(() => recentlyclosedSlot?.searchQuery);
|
||||
|
||||
await click_recently_closed_tab_item(tabList[0]);
|
||||
|
||||
@@ -217,9 +217,8 @@ add_task(async function test_list_ordering() {
|
||||
const { document } = browser.contentWindow;
|
||||
await clearAllParentTelemetryEvents();
|
||||
await navigateToViewAndWait(document, "recentlyclosed");
|
||||
let [cardMainSlotNode, listItems] = await waitForRecentlyClosedTabsList(
|
||||
document
|
||||
);
|
||||
let [cardMainSlotNode, listItems] =
|
||||
await waitForRecentlyClosedTabsList(document);
|
||||
|
||||
is(
|
||||
cardMainSlotNode.tagName.toLowerCase(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- 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,
|
||||
- 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">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# 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/.
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
||||
@@ -85,9 +85,8 @@ export var ChromeMigrationUtils = {
|
||||
manifestPath = PathUtils.join(manifestPath, extensionId);
|
||||
// If there are multiple sub-directories in the extension directory,
|
||||
// read the files in the latest directory.
|
||||
let directories = await this._getSortedByVersionSubDirectoryNames(
|
||||
manifestPath
|
||||
);
|
||||
let directories =
|
||||
await this._getSortedByVersionSubDirectoryNames(manifestPath);
|
||||
if (!directories[0]) {
|
||||
return null;
|
||||
}
|
||||
@@ -165,9 +164,8 @@ export var ChromeMigrationUtils = {
|
||||
}
|
||||
let localeFilePath = await this.getExtensionPath(profileId);
|
||||
localeFilePath = PathUtils.join(localeFilePath, extensionId);
|
||||
let directories = await this._getSortedByVersionSubDirectoryNames(
|
||||
localeFilePath
|
||||
);
|
||||
let directories =
|
||||
await this._getSortedByVersionSubDirectoryNames(localeFilePath);
|
||||
// If there are multiple sub-directories in the extension directory,
|
||||
// read the files in the latest directory.
|
||||
localeFilePath = PathUtils.join(
|
||||
|
||||
@@ -45,9 +45,8 @@ export class ChromeWindowsLoginCrypto {
|
||||
let keyData;
|
||||
try {
|
||||
// NB: For testing, allow directory service to be faked before getting.
|
||||
const localState = await ChromeMigrationUtils.getLocalState(
|
||||
userDataPathSuffix
|
||||
);
|
||||
const localState =
|
||||
await ChromeMigrationUtils.getLocalState(userDataPathSuffix);
|
||||
const withHeader = atob(localState.os_crypt.encrypted_key);
|
||||
if (!withHeader.startsWith(DPAPI_KEY_PREFIX)) {
|
||||
throw new Error("Invalid key format");
|
||||
|
||||
@@ -373,9 +373,8 @@ Bookmarks.prototype = {
|
||||
},
|
||||
|
||||
async _migrateFolder(aSourceFolder, aDestFolderGuid) {
|
||||
let { bookmarks, favicons } = await this._getBookmarksInFolder(
|
||||
aSourceFolder
|
||||
);
|
||||
let { bookmarks, favicons } =
|
||||
await this._getBookmarksInFolder(aSourceFolder);
|
||||
if (!bookmarks.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- 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,
|
||||
- You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -57,7 +57,7 @@ function templateHTML(options) {
|
||||
- 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/. -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- 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/. -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- 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/. -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- 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/. -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -9,9 +9,8 @@ test_newtab({
|
||||
() => content.document.querySelector(siteSelector),
|
||||
"Topsites have loaded"
|
||||
);
|
||||
const contextMenuItems = await content.openContextMenuAndGetOptions(
|
||||
siteSelector
|
||||
);
|
||||
const contextMenuItems =
|
||||
await content.openContextMenuAndGetOptions(siteSelector);
|
||||
let icon = contextMenuItems[0].querySelector(".icon");
|
||||
ok(!icon, "icon was not rendered");
|
||||
},
|
||||
|
||||
@@ -19,9 +19,8 @@ test_newtab({
|
||||
"Topsite tippytop icon not found"
|
||||
);
|
||||
|
||||
const contextMenuItems = await content.openContextMenuAndGetOptions(
|
||||
siteSelector
|
||||
);
|
||||
const contextMenuItems =
|
||||
await content.openContextMenuAndGetOptions(siteSelector);
|
||||
|
||||
Assert.equal(contextMenuItems.length, 5, "Number of options is correct");
|
||||
|
||||
@@ -62,9 +61,8 @@ test_newtab({
|
||||
.querySelectorAll(siteSelector)[1]
|
||||
.getAttribute("href");
|
||||
|
||||
const contextMenuItems = await content.openContextMenuAndGetOptions(
|
||||
siteSelector
|
||||
);
|
||||
const contextMenuItems =
|
||||
await content.openContextMenuAndGetOptions(siteSelector);
|
||||
await ContentTaskUtils.waitForCondition(
|
||||
() => contextMenuItems[4].textContent === "Dismiss",
|
||||
"'Dismiss' is the 5th item in the context menu list"
|
||||
@@ -99,9 +97,8 @@ test_newtab({
|
||||
"1 search topsites is loaded by default"
|
||||
);
|
||||
|
||||
const contextMenuItems = await content.openContextMenuAndGetOptions(
|
||||
siteSelector
|
||||
);
|
||||
const contextMenuItems =
|
||||
await content.openContextMenuAndGetOptions(siteSelector);
|
||||
is(
|
||||
contextMenuItems.length,
|
||||
2,
|
||||
|
||||
@@ -931,9 +931,8 @@ add_task(
|
||||
);
|
||||
let sandbox = sinon.createSandbox();
|
||||
let feed = getHighlightsFeedForTest(sandbox);
|
||||
feed.store.state.Prefs.values[
|
||||
"section.highlights.includeBookmarks"
|
||||
] = false;
|
||||
feed.store.state.Prefs.values["section.highlights.includeBookmarks"] =
|
||||
false;
|
||||
|
||||
let links = [
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# 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/.
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
||||
@@ -34,8 +34,7 @@ function promiseTopicObserved(aTopic) {
|
||||
) {
|
||||
Services.obs.removeObserver(observe, aObsTopic);
|
||||
resolve([aObsSubject, aObsData]);
|
||||
},
|
||||
aTopic);
|
||||
}, aTopic);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -16,10 +16,13 @@ registerCleanupFunction(async () => {
|
||||
|
||||
async function selectAppMenuView(buttonId, viewId) {
|
||||
let btn;
|
||||
await TestUtils.waitForCondition(() => {
|
||||
await TestUtils.waitForCondition(
|
||||
() => {
|
||||
btn = document.getElementById(buttonId);
|
||||
return btn;
|
||||
}, "Should have the " + buttonId + " button");
|
||||
},
|
||||
"Should have the " + buttonId + " button"
|
||||
);
|
||||
btn.click();
|
||||
let view = document.getElementById(viewId);
|
||||
let viewPromise = BrowserTestUtils.waitForEvent(view, "ViewShown");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -30,9 +30,8 @@ let gSyncChooseWhatToSync = {
|
||||
});
|
||||
} else {
|
||||
// Hide the 'Disconnect' button if not applicable
|
||||
document
|
||||
.getElementById("syncChooseOptions")
|
||||
.getButton("extra2").hidden = true;
|
||||
document.getElementById("syncChooseOptions").getButton("extra2").hidden =
|
||||
true;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -72,9 +72,8 @@ var gFxaPairDeviceDialog = {
|
||||
FxAccountsPairingFlow.start({ emitter: this._emitter }),
|
||||
]);
|
||||
const imgData = QR.encodeToDataURI(uri, "L");
|
||||
document.getElementById(
|
||||
"qrContainer"
|
||||
).style.backgroundImage = `url("${imgData.src}")`;
|
||||
document.getElementById("qrContainer").style.backgroundImage =
|
||||
`url("${imgData.src}")`;
|
||||
document
|
||||
.getElementById("qrWrapper")
|
||||
.setAttribute("pairing-status", "ready");
|
||||
@@ -104,9 +103,8 @@ var gFxaPairDeviceDialog = {
|
||||
"https://accounts.firefox.com/pair",
|
||||
"L"
|
||||
);
|
||||
document.getElementById(
|
||||
"qrContainer"
|
||||
).style.backgroundImage = `url("${imgData.src}")`;
|
||||
document.getElementById("qrContainer").style.backgroundImage =
|
||||
`url("${imgData.src}")`;
|
||||
},
|
||||
|
||||
onError(err) {
|
||||
|
||||
@@ -289,9 +289,16 @@ var gMainPane = {
|
||||
}
|
||||
|
||||
// approximately a "requestIdleInterval"
|
||||
window.setTimeout(() => {
|
||||
window.setTimeout(
|
||||
() => {
|
||||
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(() => {
|
||||
@@ -710,9 +717,8 @@ var gMainPane = {
|
||||
"updateSettingsContainer"
|
||||
);
|
||||
updateContainer.classList.add("updateSettingCrossUserWarningContainer");
|
||||
document.getElementById(
|
||||
"updateSettingCrossUserWarningDesc"
|
||||
).hidden = false;
|
||||
document.getElementById("updateSettingCrossUserWarningDesc").hidden =
|
||||
false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -921,9 +927,8 @@ var gMainPane = {
|
||||
if (!(await FxAccounts.canConnectAccount())) {
|
||||
return;
|
||||
}
|
||||
let url = await FxAccounts.config.promiseConnectAccountURI(
|
||||
"dev-edition-setup"
|
||||
);
|
||||
let url =
|
||||
await FxAccounts.config.promiseConnectAccountURI("dev-edition-setup");
|
||||
let accountsTab = win.gBrowser.addWebTab(url);
|
||||
win.gBrowser.selectedTab = accountsTab;
|
||||
},
|
||||
@@ -1063,9 +1068,8 @@ var gMainPane = {
|
||||
await TranslationsParent.getSupportedLanguages();
|
||||
const languageList =
|
||||
TranslationsParent.getLanguageList(supportedLanguages);
|
||||
const downloadPhases = await TranslationsState.createDownloadPhases(
|
||||
languageList
|
||||
);
|
||||
const downloadPhases =
|
||||
await TranslationsState.createDownloadPhases(languageList);
|
||||
|
||||
if (supportedLanguages.languagePairs.length === 0) {
|
||||
throw new Error(
|
||||
@@ -2344,12 +2348,10 @@ var gMainPane = {
|
||||
if (Services.appinfo.fissionAutostart) {
|
||||
document.getElementById("limitContentProcess").hidden = true;
|
||||
document.getElementById("contentProcessCount").hidden = true;
|
||||
document.getElementById(
|
||||
"contentProcessCountEnabledDescription"
|
||||
).hidden = true;
|
||||
document.getElementById(
|
||||
"contentProcessCountDisabledDescription"
|
||||
).hidden = true;
|
||||
document.getElementById("contentProcessCountEnabledDescription").hidden =
|
||||
true;
|
||||
document.getElementById("contentProcessCountDisabledDescription").hidden =
|
||||
true;
|
||||
return;
|
||||
}
|
||||
if (Services.appinfo.browserTabsRemoteAutostart) {
|
||||
@@ -2368,21 +2370,17 @@ var gMainPane = {
|
||||
|
||||
document.getElementById("limitContentProcess").disabled = false;
|
||||
document.getElementById("contentProcessCount").disabled = false;
|
||||
document.getElementById(
|
||||
"contentProcessCountEnabledDescription"
|
||||
).hidden = false;
|
||||
document.getElementById(
|
||||
"contentProcessCountDisabledDescription"
|
||||
).hidden = true;
|
||||
document.getElementById("contentProcessCountEnabledDescription").hidden =
|
||||
false;
|
||||
document.getElementById("contentProcessCountDisabledDescription").hidden =
|
||||
true;
|
||||
} else {
|
||||
document.getElementById("limitContentProcess").disabled = true;
|
||||
document.getElementById("contentProcessCount").disabled = true;
|
||||
document.getElementById(
|
||||
"contentProcessCountEnabledDescription"
|
||||
).hidden = true;
|
||||
document.getElementById(
|
||||
"contentProcessCountDisabledDescription"
|
||||
).hidden = false;
|
||||
document.getElementById("contentProcessCountEnabledDescription").hidden =
|
||||
true;
|
||||
document.getElementById("contentProcessCountDisabledDescription").hidden =
|
||||
false;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -1549,12 +1549,10 @@ var gPrivacyPane = {
|
||||
|
||||
// Hide all cookie options first, until we learn which one should be showing.
|
||||
document.querySelector(selector + " .all-cookies-option").hidden = true;
|
||||
document.querySelector(
|
||||
selector + " .unvisited-cookies-option"
|
||||
).hidden = true;
|
||||
document.querySelector(
|
||||
selector + " .cross-site-cookies-option"
|
||||
).hidden = true;
|
||||
document.querySelector(selector + " .unvisited-cookies-option").hidden =
|
||||
true;
|
||||
document.querySelector(selector + " .cross-site-cookies-option").hidden =
|
||||
true;
|
||||
document.querySelector(
|
||||
selector + " .third-party-tracking-cookies-option"
|
||||
).hidden = true;
|
||||
@@ -1570,24 +1568,20 @@ var gPrivacyPane = {
|
||||
// Note "cookieBehavior0", will result in no UI changes, so is not listed here.
|
||||
switch (item) {
|
||||
case "tp":
|
||||
document.querySelector(
|
||||
selector + " .trackers-option"
|
||||
).hidden = false;
|
||||
document.querySelector(selector + " .trackers-option").hidden =
|
||||
false;
|
||||
break;
|
||||
case "-tp":
|
||||
document.querySelector(
|
||||
selector + " .trackers-option"
|
||||
).hidden = true;
|
||||
document.querySelector(selector + " .trackers-option").hidden =
|
||||
true;
|
||||
break;
|
||||
case "tpPrivate":
|
||||
document.querySelector(
|
||||
selector + " .pb-trackers-option"
|
||||
).hidden = false;
|
||||
document.querySelector(selector + " .pb-trackers-option").hidden =
|
||||
false;
|
||||
break;
|
||||
case "-tpPrivate":
|
||||
document.querySelector(
|
||||
selector + " .pb-trackers-option"
|
||||
).hidden = true;
|
||||
document.querySelector(selector + " .pb-trackers-option").hidden =
|
||||
true;
|
||||
break;
|
||||
case "fp":
|
||||
document.querySelector(
|
||||
@@ -1600,14 +1594,12 @@ var gPrivacyPane = {
|
||||
).hidden = true;
|
||||
break;
|
||||
case "cm":
|
||||
document.querySelector(
|
||||
selector + " .cryptominers-option"
|
||||
).hidden = false;
|
||||
document.querySelector(selector + " .cryptominers-option").hidden =
|
||||
false;
|
||||
break;
|
||||
case "-cm":
|
||||
document.querySelector(
|
||||
selector + " .cryptominers-option"
|
||||
).hidden = true;
|
||||
document.querySelector(selector + " .cryptominers-option").hidden =
|
||||
true;
|
||||
break;
|
||||
case "stp":
|
||||
// Store social tracking cookies pref
|
||||
@@ -1622,9 +1614,8 @@ var gPrivacyPane = {
|
||||
break;
|
||||
case "-stp":
|
||||
// Store social tracking cookies pref
|
||||
document.querySelector(
|
||||
selector + " .social-media-option"
|
||||
).hidden = true;
|
||||
document.querySelector(selector + " .social-media-option").hidden =
|
||||
true;
|
||||
break;
|
||||
case "cookieBehavior1":
|
||||
document.querySelector(
|
||||
@@ -1632,9 +1623,8 @@ var gPrivacyPane = {
|
||||
).hidden = false;
|
||||
break;
|
||||
case "cookieBehavior2":
|
||||
document.querySelector(
|
||||
selector + " .all-cookies-option"
|
||||
).hidden = false;
|
||||
document.querySelector(selector + " .all-cookies-option").hidden =
|
||||
false;
|
||||
break;
|
||||
case "cookieBehavior3":
|
||||
document.querySelector(
|
||||
|
||||
@@ -1461,7 +1461,8 @@ class DefaultEngineDropDown {
|
||||
) {
|
||||
return;
|
||||
}
|
||||
let defaultEngine = await Services.search[
|
||||
let defaultEngine =
|
||||
await Services.search[
|
||||
this.#type == "normal" ? "getDefault" : "getDefaultPrivate"
|
||||
]();
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# 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/.
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" class="private">
|
||||
<head>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- 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,
|
||||
- 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"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- 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,
|
||||
- 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"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- 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,
|
||||
- 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"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- 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,
|
||||
- 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"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- 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/. -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<!-- 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,
|
||||
- You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
@@ -90,9 +90,8 @@ add_task(async function dragTest1Point5Zoom() {
|
||||
|
||||
result.zoom = zoom;
|
||||
result.devicePixelRatio = window.devicePixelRatio;
|
||||
result.contentDevicePixelRatio = await getContentDevicePixelRatio(
|
||||
browser
|
||||
);
|
||||
result.contentDevicePixelRatio =
|
||||
await getContentDevicePixelRatio(browser);
|
||||
|
||||
info("result: " + JSON.stringify(result, null, 2));
|
||||
|
||||
|
||||
@@ -1920,9 +1920,8 @@ class SERPCategorizer {
|
||||
for (let domain of domains) {
|
||||
domainsCount++;
|
||||
|
||||
let categoryCandidates = await SearchSERPDomainToCategoriesMap.get(
|
||||
domain
|
||||
);
|
||||
let categoryCandidates =
|
||||
await SearchSERPDomainToCategoriesMap.get(domain);
|
||||
|
||||
if (!categoryCandidates.length) {
|
||||
unknownsCount++;
|
||||
|
||||
@@ -426,9 +426,12 @@ async function waitForTestMsg(browser, type) {
|
||||
);
|
||||
|
||||
let donePromise = SpecialPowers.spawn(browser, [type], async childType => {
|
||||
await ContentTaskUtils.waitForCondition(() => {
|
||||
await ContentTaskUtils.waitForCondition(
|
||||
() => {
|
||||
return !!content.eventDetails;
|
||||
}, "Expected " + childType + " event");
|
||||
},
|
||||
"Expected " + childType + " event"
|
||||
);
|
||||
return content.eventDetails;
|
||||
});
|
||||
|
||||
|
||||
@@ -136,9 +136,8 @@ add_task(async function test_categorization_simple() {
|
||||
"test10.com",
|
||||
]);
|
||||
|
||||
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic(
|
||||
domains
|
||||
);
|
||||
let resultsToReport =
|
||||
await SearchSERPCategorization.applyCategorizationLogic(domains);
|
||||
|
||||
Assert.deepEqual(
|
||||
resultsToReport,
|
||||
@@ -165,9 +164,8 @@ add_task(async function test_categorization_inconclusive() {
|
||||
"test20.com",
|
||||
]);
|
||||
|
||||
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic(
|
||||
domains
|
||||
);
|
||||
let resultsToReport =
|
||||
await SearchSERPCategorization.applyCategorizationLogic(domains);
|
||||
|
||||
Assert.deepEqual(
|
||||
resultsToReport,
|
||||
@@ -201,9 +199,8 @@ add_task(async function test_categorization_unknown() {
|
||||
"test30.com",
|
||||
]);
|
||||
|
||||
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic(
|
||||
domains
|
||||
);
|
||||
let resultsToReport =
|
||||
await SearchSERPCategorization.applyCategorizationLogic(domains);
|
||||
|
||||
Assert.deepEqual(
|
||||
resultsToReport,
|
||||
@@ -235,9 +232,8 @@ add_task(async function test_categorization_unknown_and_inconclusive() {
|
||||
"test40.com",
|
||||
]);
|
||||
|
||||
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic(
|
||||
domains
|
||||
);
|
||||
let resultsToReport =
|
||||
await SearchSERPCategorization.applyCategorizationLogic(domains);
|
||||
|
||||
Assert.deepEqual(
|
||||
resultsToReport,
|
||||
@@ -272,9 +268,8 @@ add_task(async function test_categorization_all_types() {
|
||||
"test60.com",
|
||||
]);
|
||||
|
||||
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic(
|
||||
domains
|
||||
);
|
||||
let resultsToReport =
|
||||
await SearchSERPCategorization.applyCategorizationLogic(domains);
|
||||
|
||||
Assert.deepEqual(
|
||||
resultsToReport,
|
||||
@@ -306,9 +301,8 @@ add_task(async function test_categorization_tie() {
|
||||
"test50.com",
|
||||
]);
|
||||
|
||||
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic(
|
||||
domains
|
||||
);
|
||||
let resultsToReport =
|
||||
await SearchSERPCategorization.applyCategorizationLogic(domains);
|
||||
|
||||
Assert.equal(
|
||||
[1, 2].includes(resultsToReport.category),
|
||||
@@ -345,9 +339,8 @@ add_task(async function test_rank_penalization_equal_scores() {
|
||||
"test60.com",
|
||||
]);
|
||||
|
||||
let resultsToReport = await SearchSERPCategorization.applyCategorizationLogic(
|
||||
domains
|
||||
);
|
||||
let resultsToReport =
|
||||
await SearchSERPCategorization.applyCategorizationLogic(domains);
|
||||
|
||||
Assert.deepEqual(
|
||||
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 resultsToReport = await SearchSERPCategorization.applyCategorizationLogic(
|
||||
domains
|
||||
);
|
||||
let resultsToReport =
|
||||
await SearchSERPCategorization.applyCategorizationLogic(domains);
|
||||
|
||||
Assert.deepEqual(
|
||||
resultsToReport,
|
||||
|
||||
@@ -71,12 +71,8 @@ add_task(async function test() {
|
||||
};
|
||||
|
||||
let promiseRestoringTabs = new Promise(resolve => {
|
||||
gProgressListener.setCallback(function (
|
||||
aBrowser,
|
||||
aNeedRestore,
|
||||
aRestoring,
|
||||
aRestored
|
||||
) {
|
||||
gProgressListener.setCallback(
|
||||
function (aBrowser, aNeedRestore, aRestoring, aRestored) {
|
||||
// get the tab
|
||||
let tab;
|
||||
for (let i = 0; i < window.gBrowser.tabs.length; i++) {
|
||||
@@ -93,7 +89,8 @@ add_task(async function test() {
|
||||
|
||||
gProgressListener.unsetCallback();
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
let backupState = ss.getBrowserState();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user