Backed out 2 changesets (bug 1609037, bug 1608320) for bc failures on browser_cleanFlow.js . CLOSED TREE

Backed out changeset 44539f8e0cea (bug 1609037)
Backed out changeset 3dddea4c5d73 (bug 1608320)
This commit is contained in:
Narcis Beleuzu 2020-01-17 19:18:49 +02:00
Родитель e693e42a59
Коммит a024104573
9 изменённых файлов: 9 добавлений и 157 удалений

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

@ -1825,12 +1825,6 @@ pref("extensions.screenshots.disabled", false);
// disable uploading to the server.
pref("extensions.screenshots.upload-disabled", false);
// DoH Rollout: the earliest date of profile creation for which we don't need
// to show the doorhanger. This is when the version of the privacy statement
// that includes DoH went live - Oct 31, 2019. This has to be a string because
// the number is outside the signed 32-bit integer range.
pref("doh-rollout.profileCreationThreshold", "1572476400000");
// URL for Learn More link for browser error logging in preferences
pref("browser.chrome.errorReporter.infoURL",
"https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/nightly-error-collection");

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

@ -190,9 +190,15 @@ const stateManager = {
},
async showDoorhanger() {
rollout.addDoorhangerListeners();
browser.experiments.doorhanger.onDoorhangerAccept.addListener(
rollout.doorhangerAcceptListener
);
let doorhangerShown = await browser.experiments.doorhanger.show({
browser.experiments.doorhanger.onDoorhangerDecline.addListener(
rollout.doorhangerDeclineListener
);
await browser.experiments.doorhanger.show({
name: browser.i18n.getMessage("doorhangerName"),
text: "<> " + browser.i18n.getMessage("doorhangerBody"),
okLabel: browser.i18n.getMessage("doorhangerButtonOk"),
@ -202,16 +208,6 @@ const stateManager = {
"doorhangerButtonCancelAccessKey"
),
});
if (!doorhangerShown) {
// The profile was created after the go-live date of the privacy statement
// that included DoH. Treat it as accepted.
log("Profile is new, doorhanger not shown.");
await stateManager.setState("UIOk");
await stateManager.rememberDoorhangerDecision("NewProfile");
await stateManager.rememberDoorhangerShown();
rollout.removeDoorhangerListeners();
}
},
};
@ -227,32 +223,11 @@ const rollout = {
return this._isTesting;
},
addDoorhangerListeners() {
browser.experiments.doorhanger.onDoorhangerAccept.addListener(
rollout.doorhangerAcceptListener
);
browser.experiments.doorhanger.onDoorhangerDecline.addListener(
rollout.doorhangerDeclineListener
);
},
removeDoorhangerListeners() {
browser.experiments.doorhanger.onDoorhangerAccept.removeListener(
rollout.doorhangerAcceptListener
);
browser.experiments.doorhanger.onDoorhangerDecline.removeListener(
rollout.doorhangerDeclineListener
);
},
async doorhangerAcceptListener(tabId) {
log("Doorhanger accepted on tab", tabId);
await stateManager.setState("UIOk");
await stateManager.rememberDoorhangerDecision("UIOk");
await stateManager.rememberDoorhangerShown();
rollout.removeDoorhangerListeners();
},
async doorhangerDeclineListener(tabId) {
@ -264,7 +239,6 @@ const rollout = {
browser.experiments.heuristics.sendHeuristicsPing("disable_doh", results);
await stateManager.rememberDisableHeuristics();
await stateManager.rememberDoorhangerShown();
rollout.removeDoorhangerListeners();
},
async heuristics(evaluateReason) {

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

@ -7,8 +7,6 @@
/* global BrowserWindowTracker, ExtensionCommon, ExtensionAPI */
ChromeUtils.import("resource://gre/modules/Services.jsm", this);
ChromeUtils.import("resource://gre/modules/Preferences.jsm", this);
ChromeUtils.import("resource:///modules/EveryWindow.jsm", this);
var { EventManager, EventEmitter } = ExtensionCommon;
const {
@ -99,65 +97,7 @@ this.doorhanger = class doorhanger extends ExtensionAPI {
experiments: {
doorhanger: {
async show(properties) {
let profileAge = await ChromeUtils.import(
"resource://gre/modules/ProfileAge.jsm",
{}
).ProfileAge();
let creationDate = await profileAge.created;
let firstUse = await profileAge.firstUse;
let resetDate = await profileAge.reset;
let profileDate = resetDate || firstUse || creationDate;
// We only need to show the doorhanger to users who have not been
// shown a version of the privacy statement that includes DoH at
// first-run.
let profileCreationThreshold = parseInt(
Preferences.get("doh-rollout.profileCreationThreshold")
);
if (
!isNaN(profileCreationThreshold) &&
profileDate > profileCreationThreshold
) {
return false;
}
// Show the doorhanger next time there's a top-level location change.
let tabsProgressListener = {
onLocationChange(
aBrowser,
aWebProgress,
aRequest,
aLocationURI,
aFlags
) {
let topWindow = getMostRecentBrowserWindow();
// Filter out history.push/pop and subframes.
if (
aBrowser != topWindow.gBrowser.selectedBrowser ||
aFlags &
Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT ||
!aWebProgress.isTopLevel
) {
return;
}
doorhangerEventEmitter.emitShow(properties);
EveryWindow.unregisterCallback("doh-rollout");
},
};
EveryWindow.registerCallback(
"doh-rollout",
win => {
win.gBrowser.addTabsProgressListener(tabsProgressListener);
},
(win, closing) => {
if (closing) {
return;
}
win.gBrowser.removeTabsProgressListener(tabsProgressListener);
}
);
return true;
await doorhangerEventEmitter.emitShow(properties);
},
onDoorhangerAccept: new EventManager({
context,

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

@ -5,7 +5,6 @@ skip-if = debug # Bug 1548006 - reloading an addon upsets the leak checker.
[browser_cleanFlow.js]
[browser_dirtyEnable.js]
[browser_doorhangerUserReject.js]
[browser_doorhanger_newProfile.js]
[browser_policyOverride.js]
skip-if = (!debug && bits == 64) #Bug 1605297
[browser_userInterference.js]

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

@ -13,7 +13,6 @@ add_task(async function testCleanFlow() {
});
is(Preferences.get(prefs.DOH_SELF_ENABLED_PREF), true, "Breadcrumb saved.");
let tab = BrowserTestUtils.addTab(gBrowser, EXAMPLE_URL);
let panel = await promise;
is(
Preferences.get(prefs.DOH_DOORHANGER_SHOWN_PREF),
@ -49,8 +48,6 @@ add_task(async function testCleanFlow() {
"Breadcrumb not cleared."
);
BrowserTestUtils.removeTab(tab);
// Change the environment to failing and simulate a network change.
setFailingHeuristics();
simulateNetworkChange();

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

@ -13,7 +13,6 @@ add_task(async function testDoorhangerUserReject() {
});
is(Preferences.get(prefs.DOH_SELF_ENABLED_PREF), true, "Breadcrumb saved.");
let tab = BrowserTestUtils.addTab(gBrowser, EXAMPLE_URL);
let panel = await promise;
is(
Preferences.get(prefs.DOH_DOORHANGER_SHOWN_PREF),
@ -50,8 +49,6 @@ add_task(async function testDoorhangerUserReject() {
"Breadcrumb cleared."
);
BrowserTestUtils.removeTab(tab);
await ensureTRRMode(5);
checkHeuristicsTelemetry("disable_doh", "doorhangerDecline");

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

@ -1,34 +0,0 @@
"use strict";
add_task(setup);
add_task(async function testDoorhanger() {
Preferences.reset(prefs.PROFILE_CREATION_THRESHOLD_PREF);
// Set up a passing environment and enable DoH.
setPassingHeuristics();
Preferences.set(prefs.DOH_ENABLED_PREF, true);
await BrowserTestUtils.waitForCondition(() => {
return Preferences.get(prefs.DOH_SELF_ENABLED_PREF);
});
is(Preferences.get(prefs.DOH_SELF_ENABLED_PREF), true, "Breadcrumb saved.");
await BrowserTestUtils.waitForCondition(() => {
return Preferences.get(prefs.DOH_DOORHANGER_SHOWN_PREF);
});
is(
Preferences.get(prefs.DOH_DOORHANGER_SHOWN_PREF),
true,
"Doorhanger shown pref saved."
);
is(
Preferences.get(prefs.DOH_DOORHANGER_USER_DECISION_PREF),
"NewProfile",
"Doorhanger decision saved."
);
is(
Preferences.get(prefs.DOH_SELF_ENABLED_PREF),
true,
"Breadcrumb not cleared."
);
});

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

@ -13,7 +13,6 @@ add_task(async function testUserInterference() {
});
is(Preferences.get(prefs.DOH_SELF_ENABLED_PREF), true, "Breadcrumb saved.");
let tab = BrowserTestUtils.addTab(gBrowser, EXAMPLE_URL);
let panel = await promise;
is(
Preferences.get(prefs.DOH_DOORHANGER_SHOWN_PREF),
@ -42,8 +41,6 @@ add_task(async function testUserInterference() {
"Doorhanger decision saved."
);
BrowserTestUtils.removeTab(tab);
await ensureTRRMode(2);
checkHeuristicsTelemetry("enable_doh", "startup");

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

@ -12,14 +12,8 @@ ChromeUtils.defineModuleGetter(
"resource://gre/modules/Preferences.jsm"
);
const { CommonUtils } = ChromeUtils.import(
"resource://services-common/utils.js"
);
const ADDON_ID = "doh-rollout@mozilla.org";
const EXAMPLE_URL = "https://example.com/";
const prefs = {
DOH_ENABLED_PREF: "doh-rollout.enabled",
TRR_MODE_PREF: "network.trr.mode",
@ -33,7 +27,6 @@ const prefs = {
DOH_BALROG_MIGRATION_PREF: "doh-rollout.balrog-migration-done",
DOH_DEBUG_PREF: "doh-rollout.debug",
MOCK_HEURISTICS_PREF: "doh-rollout.heuristics.mockValues",
PROFILE_CREATION_THRESHOLD_PREF: "doh-rollout.profileCreationThreshold",
};
const fakePassingHeuristics = JSON.stringify({
@ -66,11 +59,6 @@ async function setup() {
Services.telemetry.canRecordExtended = true;
Services.telemetry.clearEvents();
// Set the profile creation threshold to very far in the future by defualt,
// so that we can test the doorhanger. browser_doorhanger_newProfile.js
// overrides this.
Preferences.set(prefs.PROFILE_CREATION_THRESHOLD_PREF, "99999999999999");
registerCleanupFunction(async () => {
Services.telemetry.canRecordExtended = oldCanRecord;
Services.telemetry.clearEvents();