Backed out changeset 71746bb87230 (bug 1858223) for causing marionette in test_no_errors_clean_profile.py CLOSED TREE

This commit is contained in:
Cristian Tuns 2023-10-17 13:42:36 -04:00
parent 0d4810205e
commit 009a937f2e
4 changed files with 8 additions and 69 deletions

View file

@ -90,7 +90,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
UIState: "resource://services-sync/UIState.sys.mjs", UIState: "resource://services-sync/UIState.sys.mjs",
UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs", UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs",
WebChannel: "resource://gre/modules/WebChannel.sys.mjs", WebChannel: "resource://gre/modules/WebChannel.sys.mjs",
WindowsLaunchOnLogin: "resource://gre/modules/WindowsLaunchOnLogin.sys.mjs",
WindowsRegistry: "resource://gre/modules/WindowsRegistry.sys.mjs", WindowsRegistry: "resource://gre/modules/WindowsRegistry.sys.mjs",
WindowsGPOParser: "resource://gre/modules/policies/WindowsGPOParser.sys.mjs", WindowsGPOParser: "resource://gre/modules/policies/WindowsGPOParser.sys.mjs",
clearTimeout: "resource://gre/modules/Timer.sys.mjs", clearTimeout: "resource://gre/modules/Timer.sys.mjs",
@ -1239,25 +1238,6 @@ BrowserGlue.prototype = {
"os-autostart", "os-autostart",
false false
); );
let launchOnLoginPref = "browser.startup.windowsLaunchOnLogin.enabled";
let profileSvc = Cc[
"@mozilla.org/toolkit/profile-service;1"
].getService(Ci.nsIToolkitProfileService);
if (
Services.prefs.getBoolPref(launchOnLoginPref) &&
!profileSvc.startWithLastProfile
) {
// If we don't start with last profile, the user
// likely sees the profile selector on launch.
Services.prefs.setBoolPref(launchOnLoginPref, false);
Services.telemetry.setEventRecordingEnabled("launch_on_login", true);
Services.telemetry.recordEvent(
"launch_on_login",
"last_profile_disable:",
"startup"
);
await lazy.WindowsLaunchOnLogin.removeLaunchOnLoginRegistryKey();
}
break; break;
} }
}, },

View file

@ -10,20 +10,14 @@ ChromeUtils.defineESModuleGetters(this, {
WindowsLaunchOnLogin: "resource://gre/modules/WindowsLaunchOnLogin.sys.mjs", WindowsLaunchOnLogin: "resource://gre/modules/WindowsLaunchOnLogin.sys.mjs",
}); });
const { ExperimentAPI } = ChromeUtils.importESModule( add_setup(async function () {
"resource://nimbus/ExperimentAPI.sys.mjs" // Ensure checkbox is enabled before running tests
); await SpecialPowers.pushPrefEnv({
set: [["browser.startup.windowsLaunchOnLogin.enabled", true]],
const { ExperimentFakes } = ChromeUtils.importESModule( });
"resource://testing-common/NimbusTestUtils.sys.mjs" });
);
add_task(async function test_check_checkbox() { add_task(async function test_check_checkbox() {
await ExperimentAPI.ready();
let doCleanup = await ExperimentFakes.enrollWithFeatureConfig({
featureId: "windowsLaunchOnLogin",
value: { enabled: true },
});
await WindowsLaunchOnLogin.withLaunchOnLoginRegistryKey(async wrk => { await WindowsLaunchOnLogin.withLaunchOnLoginRegistryKey(async wrk => {
// Open preferences to general pane // Open preferences to general pane
await openPreferencesViaOpenPreferencesAPI("paneGeneral", { await openPreferencesViaOpenPreferencesAPI("paneGeneral", {
@ -42,15 +36,9 @@ add_task(async function test_check_checkbox() {
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
}); });
await doCleanup();
}); });
add_task(async function test_uncheck_checkbox() { add_task(async function test_uncheck_checkbox() {
await ExperimentAPI.ready();
let doCleanup = await ExperimentFakes.enrollWithFeatureConfig({
featureId: "windowsLaunchOnLogin",
value: { enabled: true },
});
await WindowsLaunchOnLogin.withLaunchOnLoginRegistryKey(async wrk => { await WindowsLaunchOnLogin.withLaunchOnLoginRegistryKey(async wrk => {
// Open preferences to general pane // Open preferences to general pane
await openPreferencesViaOpenPreferencesAPI("paneGeneral", { await openPreferencesViaOpenPreferencesAPI("paneGeneral", {
@ -69,15 +57,9 @@ add_task(async function test_uncheck_checkbox() {
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
}); });
await doCleanup();
}); });
add_task(async function create_external_regkey() { add_task(async function create_external_regkey() {
await ExperimentAPI.ready();
let doCleanup = await ExperimentFakes.enrollWithFeatureConfig({
featureId: "windowsLaunchOnLogin",
value: { enabled: true },
});
await WindowsLaunchOnLogin.withLaunchOnLoginRegistryKey(async wrk => { await WindowsLaunchOnLogin.withLaunchOnLoginRegistryKey(async wrk => {
// Create registry key without using settings pane to check if // Create registry key without using settings pane to check if
// this is reflected in the settings // this is reflected in the settings
@ -104,15 +86,9 @@ add_task(async function create_external_regkey() {
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
}); });
await doCleanup();
}); });
add_task(async function delete_external_regkey() { add_task(async function delete_external_regkey() {
await ExperimentAPI.ready();
let doCleanup = await ExperimentFakes.enrollWithFeatureConfig({
featureId: "windowsLaunchOnLogin",
value: { enabled: true },
});
await WindowsLaunchOnLogin.withLaunchOnLoginRegistryKey(async wrk => { await WindowsLaunchOnLogin.withLaunchOnLoginRegistryKey(async wrk => {
// Delete registry key without using settings pane to check if // Delete registry key without using settings pane to check if
// this is reflected in the settings // this is reflected in the settings
@ -132,10 +108,10 @@ add_task(async function delete_external_regkey() {
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();
}); });
await doCleanup();
}); });
registerCleanupFunction(async function () { registerCleanupFunction(async function () {
await SpecialPowers.popPrefEnv();
await WindowsLaunchOnLogin.withLaunchOnLoginRegistryKey(async wrk => { await WindowsLaunchOnLogin.withLaunchOnLoginRegistryKey(async wrk => {
let registryName = WindowsLaunchOnLogin.getLaunchOnLoginRegistryName(); let registryName = WindowsLaunchOnLogin.getLaunchOnLoginRegistryName();
if (wrk.hasValue(registryName)) { if (wrk.hasValue(registryName)) {

View file

@ -514,7 +514,7 @@ windowsLaunchOnLogin:
variables: variables:
enabled: enabled:
type: boolean type: boolean
setPref: browser.startup.windowsLaunchOnLogin.enabled fallbackPref: browser.startup.windowsLaunchOnLogin.enabled
description: Should users see the Windows launch on login checkbox. description: Should users see the Windows launch on login checkbox.
abouthomecache: abouthomecache:

View file

@ -2983,23 +2983,6 @@ pictureinpicture.settings:
expiry_version: "never" expiry_version: "never"
release_channel_collection: opt-out release_channel_collection: opt-out
launch_on_login:
last_profile_disable:
objects: ["startup"]
description: >
Recorded when Launch on login is disabled because the
start with last profile setting has been disabled.
notification_emails:
- nalexander@mozilla.com
products:
- "firefox"
record_in_processes:
- main
bug_numbers:
- 1858223
expiry_version: "never"
release_channel_collection: opt-out
doh: doh:
evaluate_v2: evaluate_v2:
methods: ["evaluate_v2"] methods: ["evaluate_v2"]