Merge autoland to mozilla-central. a=merge

This commit is contained in:
Bogdan Szekely 2022-06-27 10:54:43 +03:00
Родитель 396d235fb2 a27349ac67
Коммит 5b2d2863bd
11 изменённых файлов: 87 добавлений и 29 удалений

Просмотреть файл

@ -79,7 +79,7 @@
<label class="content-blocking-label" data-l10n-id="content-blocking-social-media-trackers"/>
</hbox>
<hbox class="extra-information-label cross-site-cookies-option" hidden="true">
<label class="content-blocking-label" data-l10n-id="content-blocking-cross-site-cookies-in-all-windows"/>
<label class="content-blocking-label" data-l10n-id="content-blocking-cross-site-cookies-in-all-windows2"/>
</hbox>
<hbox class="extra-information-label third-party-tracking-cookies-option" hidden="true">
<label class="content-blocking-label" data-l10n-id="content-blocking-cross-site-tracking-cookies"/>
@ -168,7 +168,7 @@
<label class="content-blocking-label" data-l10n-id="content-blocking-all-cross-site-cookies-private-windows"/>
</hbox>
<hbox class="extra-information-label cross-site-cookies-option" hidden="true">
<label class="content-blocking-label" data-l10n-id="content-blocking-cross-site-cookies-in-all-windows"/>
<label class="content-blocking-label" data-l10n-id="content-blocking-cross-site-cookies-in-all-windows2"/>
</hbox>
<hbox class="extra-information-label pb-trackers-option" hidden="true">
<label class="content-blocking-label" data-l10n-id="content-blocking-private-windows"/>

Просмотреть файл

@ -1 +1,2 @@
category l10n-registry 5-browser resource://app/localization/{locale}/
category l10n-registry 5-browser resource://app/localization/{locale}/ backgroundtask=0
category l10n-registry 5-browser resource://app/localization/{locale}/ backgroundtask=1

Просмотреть файл

@ -1190,7 +1190,7 @@ content-blocking-etp-custom-desc = Choose which trackers and scripts to block.
content-blocking-etp-blocking-desc = { -brand-short-name } blocks the following:
content-blocking-private-windows = Tracking content in Private Windows
content-blocking-cross-site-cookies-in-all-windows = Cross-site cookies in all windows (includes tracking cookies)
content-blocking-cross-site-cookies-in-all-windows2 = Cross-site cookies in all windows
content-blocking-cross-site-tracking-cookies = Cross-site tracking cookies
content-blocking-all-cross-site-cookies-private-windows = Cross-site cookies in Private Windows
content-blocking-cross-site-tracking-cookies-plus-isolate = Cross-site tracking cookies, and isolate remaining cookies
@ -1212,6 +1212,8 @@ content-blocking-etp-standard-tcp-rollout-checkbox =
content-blocking-etp-standard-tcp-rollout-description = Total Cookie Protection contains cookies to the site youre on, so trackers cant use them to follow you between sites.
content-blocking-etp-standard-tcp-rollout-learn-more = Learn more
content-blocking-etp-standard-tcp-title = Includes Total Cookie Protection, our most powerful privacy feature ever
content-blocking-warning-title = Heads up!
content-blocking-and-isolating-etp-warning-description-2 = This setting may cause some websites to not display content or work correctly. If a site seems broken, you may want to turn off tracking protection for that site to load all content.
content-blocking-warning-learn-how = Learn how

Просмотреть файл

@ -33,8 +33,7 @@ ChromeUtils.defineModuleGetter(
const PREF_SECURITY_DELAY = "security.notification_enable_delay";
// Stores the browser and actor that has the active popup, used by formfill
let currentBrowserWeakRef = null;
// Stores the actor that has the active popup, used by formfill
let currentActor = null;
let autoCompleteListeners = new Set();
@ -177,10 +176,6 @@ class AutoCompleteParent extends JSWindowActorParent {
return currentActor;
}
static getCurrentBrowser() {
return currentBrowserWeakRef ? currentBrowserWeakRef.get() : null;
}
static addPopupStateListener(listener) {
autoCompleteListeners.add(listener);
}
@ -216,7 +211,6 @@ class AutoCompleteParent extends JSWindowActorParent {
// large list, and then open on a small one.
this.openedPopup.adjustHeight();
this.openedPopup = null;
currentBrowserWeakRef = null;
currentActor = null;
evt.target.removeEventListener("popuphidden", this);
evt.target.removeEventListener("popupshowing", this);
@ -247,7 +241,6 @@ class AutoCompleteParent extends JSWindowActorParent {
// Non-empty result styles
let resultStyles = new Set(results.map(r => r.style).filter(r => !!r));
currentBrowserWeakRef = Cu.getWeakReference(browser);
currentActor = this;
this.openedPopup = browser.autoCompletePopup;
// the layout varies according to different result type
@ -456,15 +449,6 @@ class AutoCompleteParent extends JSWindowActorParent {
this.closePopup();
break;
}
case "FormAutoComplete:Disconnect": {
// The controller stopped controlling the current input, so clear
// any cached data. This is necessary cause otherwise we'd clear data
// only when starting a new search, but the next input could not support
// autocomplete and it would end up inheriting the existing data.
AutoCompleteResultView.clearResults();
break;
}
}
// Returning false to pacify ESLint, but this return value is
// ignored by the messaging infrastructure.

Просмотреть файл

@ -65,6 +65,7 @@ TESTING_JS_MODULES.backgroundtasks += [
"tests/BackgroundTask_crash.jsm",
"tests/BackgroundTask_file_exists.jsm",
"tests/BackgroundTask_jsdebugger.jsm",
"tests/BackgroundTask_localization.jsm",
"tests/BackgroundTask_policies.jsm",
"tests/BackgroundTask_profile_is_slim.jsm",
"tests/BackgroundTask_shouldnotprocessupdates.jsm",

Просмотреть файл

@ -0,0 +1,33 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
* 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/. */
var EXPORTED_SYMBOLS = ["runBackgroundTask"];
const { EXIT_CODE } = ChromeUtils.import(
"resource://gre/modules/BackgroundTasksManager.jsm"
).BackgroundTasksManager;
/**
* Return 0 (success) if in the given resource file, the given string
* identifier has the given string value, 11 (failure) otherwise.
*/
async function runBackgroundTask(commandLine) {
let resource = commandLine.getArgument(0);
let id = commandLine.getArgument(1);
let expected = commandLine.getArgument(2);
let l10n = new Localization([resource]);
let value = await l10n.formatValue(id);
let exitCode = value == expected ? EXIT_CODE.SUCCESS : 11;
console.error(
`runBackgroundTask: in resource '${resource}': for id '${id}', ` +
`expected is '${expected}' and value is '${value}'; ` +
`exiting with status ${exitCode}`
);
return exitCode;
}

Просмотреть файл

@ -0,0 +1,28 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
* vim: sw=4 ts=4 sts=4 et
* 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/. */
async function doOne(resource, id) {
let l10n = new Localization([resource], true);
let value = await l10n.formatValue(id);
Assert.ok(value, `${id} from ${resource} is not null: ${value}`);
let exitCode = await do_backgroundtask("localization", {
extraArgs: [resource, id, value],
});
Assert.equal(0, exitCode);
}
add_task(async function test_localization() {
// Verify that the `l10n-registry` category is processed and that localization
// works as expected in background tasks. We can use any FTL resource and
// string identifier here as long as the value is short and can be passed as a
// command line argument safely (i.e., is ASCII).
// One from toolkit/.
await doOne("toolkit/global/commonDialog.ftl", "common-dialog-title-system");
// And one from browser/.
await doOne("browser/pageInfo.ftl", "not-set-date");
});

Просмотреть файл

@ -12,6 +12,7 @@ support-files =
[test_backgroundtask_deletes_profile.js]
[test_backgroundtask_exitcodes.js]
[test_backgroundtask_help.js]
[test_backgroundtask_localization.js]
[test_backgroundtask_locked_profile.js]
[test_backgroundtask_policies.js]
[test_backgroundtask_profile_is_slim.js]

Просмотреть файл

@ -47,7 +47,10 @@ skip-if = os == "android"
[test_TelemetryClientID_reset.js]
skip-if = os == "android" # Disabled as Android/GeckoView doesn't run TelemetryController
[test_HealthPing.js]
skip-if = (verify && (os == 'win')) || (os == 'android' && processor == 'x86_64')
skip-if =
(verify && (os == 'win'))
(os == 'android' && processor == 'x86_64')
win10_2004
tags = addons
[test_TelemetryController_idle.js]
[test_TelemetryControllerShutdown.js]

Просмотреть файл

@ -1 +1,2 @@
category l10n-registry 0-toolkit resource://gre/localization/{locale}/
category l10n-registry 0-toolkit resource://gre/localization/{locale}/ backgroundtask=0
category l10n-registry 0-toolkit resource://gre/localization/{locale}/ backgroundtask=1

Просмотреть файл

@ -456,10 +456,12 @@ add_task(async function saveas_files() {
let list = await Downloads.getList(Downloads.PUBLIC);
let downloadFinishedPromise = promiseDownloadFinished(list);
await BrowserTestUtils.openNewForegroundTab(
await BrowserTestUtils.openNewForegroundTab({
gBrowser,
expectedItems[idx].url
);
opening: expectedItems[idx].url,
waitForLoad: false,
waitForStateStop: true,
});
let download = await downloadFinishedPromise;
@ -482,10 +484,12 @@ add_task(async function saveas_files() {
continue;
}
await BrowserTestUtils.openNewForegroundTab(
await BrowserTestUtils.openNewForegroundTab({
gBrowser,
expectedItems[idx].url
);
opening: expectedItems[idx].url,
waitForLoad: false,
waitForStateStop: true,
});
}
let filename = await new Promise(resolve => {