зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset ce50950ce10b (bug 1859608
) for causing bc failures on browser_doorhangerUserReject.js CLOSED TREE
This commit is contained in:
Родитель
c41993fe2e
Коммит
1d15b23e10
|
@ -166,18 +166,6 @@ export const DoHConfigController = {
|
|||
// until the region is available.
|
||||
async loadRegion() {
|
||||
await new Promise(resolve => {
|
||||
// If the region has changed since it was last set, update the pref.
|
||||
let homeRegionOverride = lazy.Preferences.get(
|
||||
`${kGlobalPrefBranch}.home-region-override`
|
||||
);
|
||||
if (homeRegionOverride) {
|
||||
lazy.Preferences.set(
|
||||
`${kGlobalPrefBranch}.home-region`,
|
||||
homeRegionOverride
|
||||
);
|
||||
lazy.Preferences.reset(`${kGlobalPrefBranch}.home-region-override`);
|
||||
}
|
||||
|
||||
let homeRegion = lazy.Preferences.get(`${kGlobalPrefBranch}.home-region`);
|
||||
if (homeRegion) {
|
||||
kRegionPrefBranch = `${kGlobalPrefBranch}.${homeRegion.toLowerCase()}`;
|
||||
|
@ -213,7 +201,6 @@ export const DoHConfigController = {
|
|||
await this.loadRegion();
|
||||
|
||||
Services.prefs.addObserver(`${kGlobalPrefBranch}.`, this, true);
|
||||
Services.obs.addObserver(this, lazy.Region.REGION_TOPIC);
|
||||
|
||||
gProvidersCollection.on("sync", this.updateFromRemoteSettings);
|
||||
gConfigCollection.on("sync", this.updateFromRemoteSettings);
|
||||
|
@ -226,7 +213,6 @@ export const DoHConfigController = {
|
|||
await this.initComplete;
|
||||
|
||||
Services.prefs.removeObserver(`${kGlobalPrefBranch}`, this);
|
||||
Services.obs.removeObserver(this, lazy.Region.REGION_TOPIC);
|
||||
|
||||
gProvidersCollection.off("sync", this.updateFromRemoteSettings);
|
||||
gConfigCollection.off("sync", this.updateFromRemoteSettings);
|
||||
|
@ -254,12 +240,6 @@ export const DoHConfigController = {
|
|||
}
|
||||
this.notifyNewConfig();
|
||||
break;
|
||||
case lazy.Region.REGION_TOPIC:
|
||||
lazy.Preferences.set(
|
||||
`${kGlobalPrefBranch}.home-region-override`,
|
||||
lazy.Region.home
|
||||
);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -29,5 +29,3 @@ skip-if = ["os == 'win' && bits == 32"] # Bug 1713464
|
|||
["browser_trrSelection_disable.js"]
|
||||
|
||||
["browser_userInterference.js"]
|
||||
|
||||
["browser_doh_region.js"]
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
add_task(setup);
|
||||
add_task(setupRegion); // Sets region to DE
|
||||
|
||||
add_task(async function testPrefFirstRollout() {
|
||||
registerCleanupFunction(setupRegion); // Reset region
|
||||
|
||||
let defaults = Services.prefs.getDefaultBranch("");
|
||||
|
||||
setPassingHeuristics();
|
||||
|
||||
is(
|
||||
DoHConfigController.currentConfig.enabled,
|
||||
false,
|
||||
"Rollout should not be enabled"
|
||||
);
|
||||
|
||||
let configFlushedPromise = DoHTestUtils.waitForConfigFlush();
|
||||
defaults.setBoolPref(`${kRegionalPrefNamespace}.enabled`, true);
|
||||
await configFlushedPromise;
|
||||
|
||||
is(
|
||||
DoHConfigController.currentConfig.enabled,
|
||||
true,
|
||||
"Rollout should be enabled"
|
||||
);
|
||||
await ensureTRRMode(2);
|
||||
|
||||
is(
|
||||
Preferences.get("doh-rollout.home-region"),
|
||||
"DE",
|
||||
"Initial region should be DE"
|
||||
);
|
||||
Region._setHomeRegion("UK");
|
||||
await ensureTRRMode(2); // Mode shouldn't change.
|
||||
|
||||
is(Preferences.get("doh-rollout.home-region-override"), "UK");
|
||||
|
||||
await DoHController._uninit();
|
||||
await DoHConfigController._uninit();
|
||||
|
||||
// Check after controller gets reinitialized (or restart)
|
||||
// that the region gets set to UK
|
||||
await DoHConfigController.init();
|
||||
await DoHController.init();
|
||||
is(Preferences.get("doh-rollout.home-region"), "UK");
|
||||
|
||||
is(
|
||||
DoHConfigController.currentConfig.enabled,
|
||||
false,
|
||||
"Rollout should not be enabled for new region"
|
||||
);
|
||||
await ensureTRRMode(undefined); // restart of the controller should change the region.
|
||||
});
|
Загрузка…
Ссылка в новой задаче