From ea99e4442dc9bdb7557da52304c5942b317c8877 Mon Sep 17 00:00:00 2001 From: Edouard Oger Date: Wed, 18 Jan 2017 16:30:38 -0500 Subject: [PATCH] Bug 1296767 part 6 - Remove startOverKeepIdentity pref. r=markh MozReview-Commit-ID: 7YDYTCRiKZa --- services/common/tests/unit/head_helpers.js | 13 ------------- services/fxaccounts/tests/xpcshell/head.js | 1 + services/fxaccounts/tests/xpcshell/test_accounts.js | 1 - .../xpcshell/test_accounts_device_registration.js | 1 - .../tests/xpcshell/test_loginmgr_storage.js | 1 - .../tests/xpcshell/test_oauth_grant_client.js | 1 - .../fxaccounts/tests/xpcshell/test_push_service.js | 1 - .../tests/xpcshell/test_storage_manager.js | 1 - services/sync/modules/service.js | 11 ----------- services/sync/tests/unit/test_bookmark_duping.js | 1 - 10 files changed, 1 insertion(+), 31 deletions(-) diff --git a/services/common/tests/unit/head_helpers.js b/services/common/tests/unit/head_helpers.js index f7fbf7af43e7..df354bac65b5 100644 --- a/services/common/tests/unit/head_helpers.js +++ b/services/common/tests/unit/head_helpers.js @@ -157,16 +157,3 @@ function uninstallFakePAC() { _("Uninstalling fake PAC."); MockRegistrar.unregister(fakePACCID); } - -// Many tests do service.startOver() and don't expect the provider type to -// change (whereas by default, a startOver will do exactly that so FxA is -// subsequently used). The tests that know how to deal with -// the Firefox Accounts identity hack things to ensure that still works. -function ensureStartOverKeepsIdentity() { - Cu.import("resource://gre/modules/Services.jsm"); - Services.prefs.setBoolPref("services.sync-testing.startOverKeepIdentity", true); - do_register_cleanup(function() { - Services.prefs.clearUserPref("services.sync-testing.startOverKeepIdentity"); - }); -} -ensureStartOverKeepsIdentity(); diff --git a/services/fxaccounts/tests/xpcshell/head.js b/services/fxaccounts/tests/xpcshell/head.js index ed70fdac5e2e..d880a279357e 100644 --- a/services/fxaccounts/tests/xpcshell/head.js +++ b/services/fxaccounts/tests/xpcshell/head.js @@ -5,6 +5,7 @@ var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; "use strict"; +Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); (function initFxAccountsTestingInfrastructure() { diff --git a/services/fxaccounts/tests/xpcshell/test_accounts.js b/services/fxaccounts/tests/xpcshell/test_accounts.js index 505623fc6264..8d934ed708b1 100644 --- a/services/fxaccounts/tests/xpcshell/test_accounts.js +++ b/services/fxaccounts/tests/xpcshell/test_accounts.js @@ -4,7 +4,6 @@ "use strict"; Cu.import("resource://services-common/utils.js"); -Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/FxAccounts.jsm"); Cu.import("resource://gre/modules/FxAccountsClient.jsm"); Cu.import("resource://gre/modules/FxAccountsCommon.js"); diff --git a/services/fxaccounts/tests/xpcshell/test_accounts_device_registration.js b/services/fxaccounts/tests/xpcshell/test_accounts_device_registration.js index 15c7caf284fe..dfec67f9bd52 100644 --- a/services/fxaccounts/tests/xpcshell/test_accounts_device_registration.js +++ b/services/fxaccounts/tests/xpcshell/test_accounts_device_registration.js @@ -4,7 +4,6 @@ "use strict"; Cu.import("resource://services-common/utils.js"); -Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/FxAccounts.jsm"); Cu.import("resource://gre/modules/FxAccountsClient.jsm"); Cu.import("resource://gre/modules/FxAccountsCommon.js"); diff --git a/services/fxaccounts/tests/xpcshell/test_loginmgr_storage.js b/services/fxaccounts/tests/xpcshell/test_loginmgr_storage.js index 64ddb1fd1de7..42c24bc220e9 100644 --- a/services/fxaccounts/tests/xpcshell/test_loginmgr_storage.js +++ b/services/fxaccounts/tests/xpcshell/test_loginmgr_storage.js @@ -10,7 +10,6 @@ Services.prefs.setCharPref("identity.fxaccounts.auth.uri", "http://localhost"); // See verbose logging from FxAccounts.jsm Services.prefs.setCharPref("identity.fxaccounts.loglevel", "Trace"); -Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/FxAccounts.jsm"); Cu.import("resource://gre/modules/FxAccountsClient.jsm"); Cu.import("resource://gre/modules/FxAccountsCommon.js"); diff --git a/services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js b/services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js index 02b8dab8462c..305bff6e8d78 100644 --- a/services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js +++ b/services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js @@ -5,7 +5,6 @@ Cu.import("resource://gre/modules/FxAccountsCommon.js"); Cu.import("resource://gre/modules/FxAccountsOAuthGrantClient.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); const CLIENT_OPTIONS = { serverURL: "http://127.0.0.1:9010/v1", diff --git a/services/fxaccounts/tests/xpcshell/test_push_service.js b/services/fxaccounts/tests/xpcshell/test_push_service.js index ae22f03cc71f..9047dee19011 100644 --- a/services/fxaccounts/tests/xpcshell/test_push_service.js +++ b/services/fxaccounts/tests/xpcshell/test_push_service.js @@ -6,7 +6,6 @@ // Tests for the FxA push service. Cu.import("resource://gre/modules/Task.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Promise.jsm"); Cu.import("resource://gre/modules/FxAccountsCommon.js"); Cu.import("resource://gre/modules/Log.jsm"); diff --git a/services/fxaccounts/tests/xpcshell/test_storage_manager.js b/services/fxaccounts/tests/xpcshell/test_storage_manager.js index c097c5328b1a..5bdcf48419c0 100644 --- a/services/fxaccounts/tests/xpcshell/test_storage_manager.js +++ b/services/fxaccounts/tests/xpcshell/test_storage_manager.js @@ -6,7 +6,6 @@ // Tests for the FxA storage manager. Cu.import("resource://gre/modules/Task.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/FxAccountsStorage.jsm"); Cu.import("resource://gre/modules/FxAccountsCommon.js"); Cu.import("resource://gre/modules/Log.jsm"); diff --git a/services/sync/modules/service.js b/services/sync/modules/service.js index 83e3387b29d7..5ae9955ceed9 100644 --- a/services/sync/modules/service.js +++ b/services/sync/modules/service.js @@ -831,17 +831,6 @@ Sync11Service.prototype = { this.identity.deleteSyncCredentials(); - // If necessary, reset the identity manager, then re-initialize it so the - // FxA manager is used. This is configurable via a pref - mainly for tests. - let keepIdentity = false; - try { - keepIdentity = Services.prefs.getBoolPref("services.sync-testing.startOverKeepIdentity"); - } catch (_) { /* no such pref */ } - if (keepIdentity) { - Svc.Obs.notify("weave:service:start-over:finish"); - return; - } - try { this.identity.finalize(); // an observer so the FxA migration code can take some action before diff --git a/services/sync/tests/unit/test_bookmark_duping.js b/services/sync/tests/unit/test_bookmark_duping.js index 66a8134555ba..b0b8ac3601c9 100644 --- a/services/sync/tests/unit/test_bookmark_duping.js +++ b/services/sync/tests/unit/test_bookmark_duping.js @@ -49,7 +49,6 @@ async function setup() { async function cleanup(server) { Svc.Obs.notify("weave:engine:stop-tracking"); - Services.prefs.setBoolPref("services.sync-testing.startOverKeepIdentity", true); let promiseStartOver = promiseOneObserver("weave:service:start-over:finish"); Service.startOver(); await promiseStartOver;