Bug 1826062 - Automatic fixes for Prettier 2.0.5 upgrade. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,owlish
Differential Revision: https://phabricator.services.mozilla.com/D177025
This commit is contained in:
@@ -114,7 +114,7 @@ export var Policies = {
|
||||
|
||||
AllowedDomainsForApps: {
|
||||
onBeforeAddons(manager, param) {
|
||||
Services.obs.addObserver(function(subject, topic, data) {
|
||||
Services.obs.addObserver(function (subject, topic, data) {
|
||||
let channel = subject.QueryInterface(Ci.nsIHttpChannel);
|
||||
if (channel.URI.host.endsWith(".google.com")) {
|
||||
channel.setRequestHeader("X-GoogApps-Allowed-Domains", param, true);
|
||||
@@ -425,7 +425,7 @@ export var Policies = {
|
||||
continue;
|
||||
}
|
||||
let reader = new FileReader();
|
||||
reader.onloadend = function() {
|
||||
reader.onloadend = function () {
|
||||
if (reader.readyState != reader.DONE) {
|
||||
lazy.log.error(`Unable to read certificate - ${certfile.path}`);
|
||||
return;
|
||||
@@ -2034,7 +2034,7 @@ export var Policies = {
|
||||
await runOncePerModification(
|
||||
"removeSearchEngines",
|
||||
JSON.stringify(param.Remove),
|
||||
async function() {
|
||||
async function () {
|
||||
for (let engineName of param.Remove) {
|
||||
let engine = Services.search.getEngineByName(engineName);
|
||||
if (engine) {
|
||||
@@ -2457,8 +2457,9 @@ function addAllowDenyPermissions(permissionName, allowList, blockList) {
|
||||
} catch (ex) {
|
||||
// It's possible if the origin was invalid, we'll have a string instead of an origin.
|
||||
lazy.log.error(
|
||||
`Unable to add ${permissionName} permission for ${origin.href ||
|
||||
origin}`
|
||||
`Unable to add ${permissionName} permission for ${
|
||||
origin.href || origin
|
||||
}`
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2680,7 +2681,7 @@ let ChromeURLBlockPolicy = {
|
||||
}
|
||||
let contentLocationSpec = contentLocation.spec.toLowerCase();
|
||||
if (
|
||||
gBlockedAboutPages.some(function(aboutPage) {
|
||||
gBlockedAboutPages.some(function (aboutPage) {
|
||||
return contentLocationSpec.startsWith(aboutPage.toLowerCase());
|
||||
})
|
||||
) {
|
||||
|
||||
@@ -300,7 +300,7 @@ function generateDocumentation() {
|
||||
for (let policyName in schema.properties) {
|
||||
let main_tbody = document.createElement("tbody");
|
||||
main_tbody.classList.add("collapsible");
|
||||
main_tbody.addEventListener("click", function() {
|
||||
main_tbody.addEventListener("click", function () {
|
||||
let content = this.nextElementSibling;
|
||||
content.classList.toggle("content");
|
||||
});
|
||||
@@ -354,7 +354,7 @@ function generateDocumentation() {
|
||||
}
|
||||
|
||||
let gInited = false;
|
||||
window.onload = function() {
|
||||
window.onload = function () {
|
||||
if (gInited) {
|
||||
return;
|
||||
}
|
||||
@@ -369,7 +369,7 @@ window.onload = function() {
|
||||
let menu = document.getElementById("categories");
|
||||
for (let category of menu.children) {
|
||||
category.addEventListener("click", () => show(category));
|
||||
category.addEventListener("keypress", function(event) {
|
||||
category.addEventListener("keypress", function (event) {
|
||||
if (event.keyCode == KeyEvent.DOM_VK_RETURN) {
|
||||
show(category);
|
||||
}
|
||||
@@ -385,7 +385,7 @@ window.onload = function() {
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("hashchange", function() {
|
||||
window.addEventListener("hashchange", function () {
|
||||
if (location.hash) {
|
||||
let sectionButton = document.getElementById(
|
||||
"category-" + location.hash.substring(1)
|
||||
|
||||
@@ -38,7 +38,7 @@ add_task(async function test_wrong_policies() {
|
||||
});
|
||||
|
||||
add_task(async function test_content_process() {
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() {
|
||||
await SpecialPowers.spawn(gBrowser.selectedBrowser, [], function () {
|
||||
try {
|
||||
Services.policies.getActivePolicies();
|
||||
} catch (ex) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
"use strict";
|
||||
|
||||
add_setup(async function() {
|
||||
add_setup(async function () {
|
||||
await setupPolicyEngineWithJson({
|
||||
policies: {
|
||||
BlockAboutSupport: true,
|
||||
@@ -26,7 +26,7 @@ add_task(async function test_about_memory() {
|
||||
"about:memory"
|
||||
);
|
||||
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], async function() {
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], async function () {
|
||||
let aboutSupportLink = content.document.querySelector(
|
||||
"a[href='about:support']"
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
"use strict";
|
||||
|
||||
add_setup(async function() {
|
||||
add_setup(async function () {
|
||||
await setupPolicyEngineWithJson({
|
||||
policies: {
|
||||
DisableSetDesktopBackground: true,
|
||||
|
||||
@@ -128,7 +128,7 @@ async function test_cookie_settings({
|
||||
);
|
||||
let browser = gBrowser.getBrowserForTab(tab);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], async function() {
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], async function () {
|
||||
// Load the script twice
|
||||
{
|
||||
let src = content.document.createElement("script");
|
||||
|
||||
@@ -14,7 +14,7 @@ async function checkPocket(shouldBeEnabled) {
|
||||
}
|
||||
|
||||
add_task(async function test_disable_firefox_screenshots() {
|
||||
await BrowserTestUtils.withNewTab("data:text/html,Test", async function() {
|
||||
await BrowserTestUtils.withNewTab("data:text/html,Test", async function () {
|
||||
// Sanity check to make sure Pocket is enabled on tests
|
||||
await checkPocket(true);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ function restore_prefs() {
|
||||
}
|
||||
|
||||
let ORIGINAL_PREF_VALUE = undefined;
|
||||
add_setup(async function() {
|
||||
add_setup(async function () {
|
||||
// It seems that this pref is given a special testing value for some reason.
|
||||
// Unset that value for this test, but save the old value
|
||||
if (Services.prefs.prefHasUserValue("dom.disable_open_during_load")) {
|
||||
@@ -37,7 +37,7 @@ async function test_popup_blocker_disabled({ disabled, locked }) {
|
||||
tab.linkedBrowser,
|
||||
[{ disabled, locked }],
|
||||
// eslint-disable-next-line no-shadow
|
||||
async function({ disabled, locked }) {
|
||||
async function ({ disabled, locked }) {
|
||||
let checkbox = content.document.getElementById("popupPolicy");
|
||||
is(
|
||||
checkbox.checked,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
add_setup(async function() {
|
||||
add_setup(async function () {
|
||||
await setupPolicyEngineWithJson({
|
||||
policies: {
|
||||
DisablePrivateBrowsing: true,
|
||||
|
||||
@@ -8,7 +8,7 @@ let { ResetProfile } = ChromeUtils.importESModule(
|
||||
|
||||
// For this test to work properly, this profile actually needs to be
|
||||
// "reset-able", which requires that it be recognized by the profile service
|
||||
add_setup(async function() {
|
||||
add_setup(async function () {
|
||||
let profileDirectory = Services.dirsvc.get("ProfD", Ci.nsIFile);
|
||||
let profileName = profileDirectory.leafName;
|
||||
let profileService = Cc["@mozilla.org/toolkit/profile-service;1"].getService(
|
||||
@@ -46,7 +46,7 @@ async function test_reset_disabled({ disabled }) {
|
||||
gBrowser,
|
||||
"about:support"
|
||||
);
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [{ disabled }], async function({
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [{ disabled }], async function ({
|
||||
// eslint-disable-next-line no-shadow
|
||||
disabled,
|
||||
}) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
"use strict";
|
||||
|
||||
add_setup(async function() {
|
||||
add_setup(async function () {
|
||||
await setupPolicyEngineWithJson({
|
||||
policies: {
|
||||
DisableSafeMode: true,
|
||||
@@ -26,7 +26,7 @@ add_task(async function test_safemode_from_about_support() {
|
||||
"about:support"
|
||||
);
|
||||
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], async function() {
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], async function () {
|
||||
let button = content.document.getElementById("restart-in-safe-mode-button");
|
||||
is(
|
||||
button.getAttribute("disabled"),
|
||||
@@ -44,7 +44,7 @@ add_task(async function test_safemode_from_about_profiles() {
|
||||
"about:profiles"
|
||||
);
|
||||
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], async function() {
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], async function () {
|
||||
let button = content.document.getElementById("restart-in-safe-mode-button");
|
||||
is(
|
||||
button.getAttribute("disabled"),
|
||||
|
||||
@@ -87,7 +87,7 @@ async function setDownloadDir() {
|
||||
);
|
||||
// Create this dir if it doesn't exist (ignores existing dirs)
|
||||
await IOUtils.makeDirectory(tmpDir);
|
||||
registerCleanupFunction(async function() {
|
||||
registerCleanupFunction(async function () {
|
||||
try {
|
||||
await IOUtils.remove(tmpDir, { recursive: true });
|
||||
} catch (e) {
|
||||
@@ -133,7 +133,7 @@ add_task(async function test_tmpdir_download() {
|
||||
waitForLoad: false,
|
||||
waitForStop: true,
|
||||
},
|
||||
async function() {
|
||||
async function () {
|
||||
let dialogWin = await dialogPromise;
|
||||
let tempFile = dialogWin.dialog.mLauncher.targetFile;
|
||||
isnot(
|
||||
|
||||
@@ -152,7 +152,7 @@ add_task(async function test_install_source_blocked_direct() {
|
||||
await SpecialPowers.spawn(
|
||||
tab.linkedBrowser,
|
||||
[{ baseUrl: BASE_URL }],
|
||||
async function({ baseUrl }) {
|
||||
async function ({ baseUrl }) {
|
||||
content.document.location.href = baseUrl + "policytest_v0.1.xpi";
|
||||
}
|
||||
);
|
||||
@@ -252,7 +252,7 @@ add_task(async function test_install_source_allowed_direct() {
|
||||
await SpecialPowers.spawn(
|
||||
tab.linkedBrowser,
|
||||
[{ baseUrl: BASE_URL }],
|
||||
async function({ baseUrl }) {
|
||||
async function ({ baseUrl }) {
|
||||
content.document.location.href = baseUrl + "policytest_v0.1.xpi";
|
||||
}
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
add_setup(async function() {
|
||||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["browser.newtabpage.activity-stream.feeds.section.highlights", true],
|
||||
@@ -18,7 +18,7 @@ add_task(async function test_firefox_home_without_policy_without_pocket() {
|
||||
waitForStateStop: true,
|
||||
});
|
||||
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], function() {
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], function () {
|
||||
let search = content.document.querySelector(".search-wrapper");
|
||||
isnot(search, null, "Search section should be there.");
|
||||
let topsites = content.document.querySelector(
|
||||
@@ -61,7 +61,7 @@ add_task(async function test_firefox_home_with_policy() {
|
||||
waitForStateStop: true,
|
||||
});
|
||||
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], function() {
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], function () {
|
||||
let search = content.document.querySelector(".search-wrapper");
|
||||
is(search, null, "Search section should not be there.");
|
||||
let topsites = content.document.querySelector(
|
||||
|
||||
@@ -25,7 +25,7 @@ add_task(async function test_policy_admin() {
|
||||
// Fake the subdialog
|
||||
let dialogURL = "";
|
||||
let originalOpenDialog = window.openDialog;
|
||||
window.openDialog = function(aDialogURL, unused, unused2, aCallback) {
|
||||
window.openDialog = function (aDialogURL, unused, unused2, aCallback) {
|
||||
dialogURL = aDialogURL;
|
||||
if (aCallback) {
|
||||
aCallback();
|
||||
|
||||
@@ -25,7 +25,7 @@ add_task(async function test_policy_masterpassword_doorhanger() {
|
||||
"https://example.com/browser/toolkit/components/" +
|
||||
"passwordmgr/test/browser/form_basic.html",
|
||||
},
|
||||
async function(browser) {
|
||||
async function (browser) {
|
||||
await SimpleTest.promiseFocus(browser.ownerGlobal);
|
||||
|
||||
// Update the form with credentials from the test case.
|
||||
@@ -38,7 +38,7 @@ add_task(async function test_policy_masterpassword_doorhanger() {
|
||||
// Submit the form with the new credentials. This will cause the doorhanger
|
||||
// notification to be displayed.
|
||||
let formSubmittedPromise = listenForTestNotification("ShowDoorhanger");
|
||||
await SpecialPowers.spawn(browser, [], async function() {
|
||||
await SpecialPowers.spawn(browser, [], async function () {
|
||||
let doc = this.content.document;
|
||||
doc.getElementById("form-basic").submit();
|
||||
});
|
||||
@@ -52,7 +52,7 @@ add_task(async function test_policy_masterpassword_doorhanger() {
|
||||
// Fake the subdialog
|
||||
let dialogURL = "";
|
||||
let originalOpenDialog = window.openDialog;
|
||||
window.openDialog = function(aDialogURL, unused, unused2, aCallback) {
|
||||
window.openDialog = function (aDialogURL, unused, unused2, aCallback) {
|
||||
dialogURL = aDialogURL;
|
||||
if (aCallback) {
|
||||
aCallback();
|
||||
|
||||
@@ -58,7 +58,7 @@ add_task(async function test_pageinfo_permissions() {
|
||||
"xr",
|
||||
];
|
||||
|
||||
await BrowserTestUtils.withNewTab(TEST_ORIGIN, async function(browser) {
|
||||
await BrowserTestUtils.withNewTab(TEST_ORIGIN, async function (browser) {
|
||||
let pageInfo = BrowserPageInfo(TEST_ORIGIN, "permTab");
|
||||
await BrowserTestUtils.waitForEvent(pageInfo, "load");
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ add_task(async function test_prevent_install_ui() {
|
||||
gBrowser,
|
||||
"about:preferences#search"
|
||||
);
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], async function() {
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], async function () {
|
||||
let linkContainer = content.document.getElementById("addEnginesBox");
|
||||
if (!linkContainer.hidden) {
|
||||
await ContentTaskUtils.waitForMutationCondition(
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
add_setup(async function() {
|
||||
add_setup(async function () {
|
||||
await setupPolicyEngineWithJson({
|
||||
policies: {
|
||||
SearchBar: "separate",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
"use strict";
|
||||
|
||||
add_setup(async function() {
|
||||
add_setup(async function () {
|
||||
// browser.startup.page is set by unittest-required/user.js,
|
||||
// but we need the default value
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
"use strict";
|
||||
|
||||
add_setup(async function() {
|
||||
add_setup(async function () {
|
||||
await setupPolicyEngineWithJson({
|
||||
policies: {
|
||||
SupportMenu: {
|
||||
|
||||
@@ -31,7 +31,7 @@ add_task(async function test_update_preferences_ui() {
|
||||
"about:preferences"
|
||||
);
|
||||
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], async function() {
|
||||
await SpecialPowers.spawn(tab.linkedBrowser, [], async function () {
|
||||
let setting = content.document.getElementById("updateSettingsContainer");
|
||||
is(
|
||||
setting.hidden,
|
||||
|
||||
@@ -73,7 +73,7 @@ async function testPageBlockedByPolicy(page, policyJSON) {
|
||||
async browser => {
|
||||
BrowserTestUtils.loadURIString(browser, page);
|
||||
await BrowserTestUtils.browserLoaded(browser, false, page, true);
|
||||
await SpecialPowers.spawn(browser, [page], async function(innerPage) {
|
||||
await SpecialPowers.spawn(browser, [page], async function (innerPage) {
|
||||
ok(
|
||||
content.document.documentURI.startsWith(
|
||||
"about:neterror?e=blockedByPolicy"
|
||||
|
||||
@@ -29,7 +29,7 @@ add_task(async function test_disable_firefox_screenshots() {
|
||||
"Screenshots pref is disabled"
|
||||
);
|
||||
|
||||
await BrowserTestUtils.withNewTab("data:text/html,Test", async function() {
|
||||
await BrowserTestUtils.withNewTab("data:text/html,Test", async function () {
|
||||
await checkScreenshots(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -104,7 +104,7 @@ async function check_homepage({
|
||||
tab.linkedBrowser,
|
||||
{ expectedURL, expectedPageVal, locked },
|
||||
// eslint-disable-next-line no-shadow
|
||||
async function({ expectedURL, expectedPageVal, locked }) {
|
||||
async function ({ expectedURL, expectedPageVal, locked }) {
|
||||
if (expectedPageVal != -1) {
|
||||
// Only check restore checkbox for StartPage
|
||||
let browserRestoreSessionCheckbox = content.document.getElementById(
|
||||
@@ -241,7 +241,7 @@ async function testPageBlockedByPolicy(page, policyJSON) {
|
||||
async browser => {
|
||||
BrowserTestUtils.loadURIString(browser, page);
|
||||
await BrowserTestUtils.browserLoaded(browser, false, page, true);
|
||||
await SpecialPowers.spawn(browser, [page], async function(innerPage) {
|
||||
await SpecialPowers.spawn(browser, [page], async function (innerPage) {
|
||||
ok(
|
||||
content.document.documentURI.startsWith(
|
||||
"about:neterror?e=blockedByPolicy"
|
||||
|
||||
@@ -40,7 +40,7 @@ function promiseLocaleNotChanged(requestedLocale) {
|
||||
};
|
||||
Services.obs.addObserver(localeObserver, REQ_LOC_CHANGE_EVENT);
|
||||
/* eslint-disable mozilla/no-arbitrary-setTimeout */
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
Services.obs.removeObserver(localeObserver, REQ_LOC_CHANGE_EVENT);
|
||||
resolve();
|
||||
}, 100);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
function checkArrayIsSorted(array, msg) {
|
||||
let sorted = true;
|
||||
let sortedArray = array.slice().sort(function(a, b) {
|
||||
let sortedArray = array.slice().sort(function (a, b) {
|
||||
return a.localeCompare(b);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user