Bug 1296767 part 11 - Remove Weave.Service.serverURL and friends. r?markh draft
authorEdouard Oger <eoger@fastmail.com>
Thu, 19 Jan 2017 13:19:33 -0500
changeset 467371 4e3485eb0d831b3f43a04f955dc082a513b3dfb7
parent 467370 227eebd073abf6031570cffca234bc5b6536e5cc
child 467372 6ed20f1bc916c7ab76758088b3d3cef54b4fb415
push id43155
push userbmo:eoger@fastmail.com
push dateFri, 27 Jan 2017 18:31:15 +0000
reviewersmarkh
bugs1296767
milestone54.0a1
Bug 1296767 part 11 - Remove Weave.Service.serverURL and friends. r?markh MozReview-Commit-ID: Kmsxn10sA2X
services/sync/modules-testing/utils.js
services/sync/modules/constants.js
services/sync/modules/service.js
services/sync/services-sync.js
services/sync/tests/unit/test_errorhandler_1.js
services/sync/tests/unit/test_service_attributes.js
services/sync/tests/unit/test_service_cluster.js
services/sync/tests/unit/test_service_detect_upgrade.js
services/sync/tests/unit/test_service_getStorageInfo.js
services/sync/tests/unit/test_service_login.js
services/sync/tests/unit/test_service_set_serverURL.js
services/sync/tests/unit/test_service_startOver.js
services/sync/tests/unit/test_service_sync_remoteSetup.js
services/sync/tests/unit/test_service_verifyLogin.js
services/sync/tests/unit/test_service_wipeServer.js
services/sync/tests/unit/test_syncscheduler.js
services/sync/tests/unit/test_telemetry.js
services/sync/tests/unit/xpcshell.ini
toolkit/components/telemetry/TelemetryEnvironment.jsm
--- a/services/sync/modules-testing/utils.js
+++ b/services/sync/modules-testing/utils.js
@@ -203,20 +203,16 @@ this.configureFxAccountIdentity = functi
   authService._account = config.fxaccount.user.email;
 }
 
 this.configureIdentity = async function(identityOverrides, server) {
   let config = makeIdentityConfig(identityOverrides, server);
   let ns = {};
   Cu.import("resource://services-sync/service.js", ns);
 
-  if (server) {
-    ns.Service.serverURL = server.baseURI;
-  }
-
   // If a server was specified, ensure FxA has a correct cluster URL available.
   if (server && !config.fxaccount.token.endpoint) {
     let ep = server.baseURI;
     if (!ep.endsWith("/")) {
       ep += "/";
     }
     ep += "1.1/" + config.username + "/";
     config.fxaccount.token.endpoint = ep;
--- a/services/sync/modules/constants.js
+++ b/services/sync/modules/constants.js
@@ -6,17 +6,16 @@
 // Process each item in the "constants hash" to add to "global" and give a name
 this.EXPORTED_SYMBOLS = [];
 for (let [key, val] of Object.entries({
 
 WEAVE_VERSION:                         "@weave_version@",
 
 // Sync Server API version that the client supports.
 SYNC_API_VERSION:                      "1.1",
-MISC_API_VERSION:                      "1.0",
 
 // Version of the data format this client supports. The data format describes
 // how records are packaged; this is separate from the Server API version and
 // the per-engine cleartext formats.
 STORAGE_VERSION:                       5,
 PREFS_BRANCH:                          "services.sync.",
 
 // Host "key" to access Weave Identity in the password manager
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -63,57 +63,27 @@ Sync11Service.prototype = {
   infoURL: null,
   storageURL: null,
   metaURL: null,
   cryptoKeyURL: null,
   // The cluster URL comes via the ClusterManager object, which in the FxA
   // world is ebbedded in the token returned from the token server.
   _clusterURL: null,
 
-  get serverURL() {
-    return Svc.Prefs.get("serverURL");
-  },
-  set serverURL(value) {
-    if (!value.endsWith("/")) {
-      value += "/";
-    }
-
-    // Only do work if it's actually changing
-    if (value == this.serverURL)
-      return;
-
-    Svc.Prefs.set("serverURL", value);
-
-    // A new server most likely uses a different cluster, so clear that.
-    this._clusterURL = null;
-  },
-
   get clusterURL() {
     return this._clusterURL || "";
   },
   set clusterURL(value) {
     if (value != null && typeof value != "string") {
       throw new Error("cluster must be a string, got " + (typeof value));
     }
     this._clusterURL = value;
     this._updateCachedURLs();
   },
 
-  get miscAPI() {
-    // Append to the serverURL if it's a relative fragment
-    let misc = Svc.Prefs.get("miscURL");
-    if (misc.indexOf(":") == -1)
-      misc = this.serverURL + misc;
-    return misc + MISC_API_VERSION + "/";
-  },
-
-  get pwResetURL() {
-    return this.serverURL + "weave-password-reset";
-  },
-
   get syncID() {
     // Generate a random syncID id we don't have one
     let syncID = Svc.Prefs.get("client.syncID", "");
     return syncID == "" ? this.syncID = Utils.makeGUID() : syncID;
   },
   set syncID(value) {
     Svc.Prefs.set("client.syncID", value);
   },
--- a/services/sync/services-sync.js
+++ b/services/sync/services-sync.js
@@ -1,17 +1,12 @@
 /* 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/. */
 
-pref("services.sync.serverURL", "https://auth.services.mozilla.com/");
-pref("services.sync.miscURL", "misc/");
-pref("services.sync.statusURL", "https://services.mozilla.com/status/");
-pref("services.sync.syncKeyHelpURL", "https://services.mozilla.com/help/synckey");
-
 pref("services.sync.lastversion", "firstrun");
 pref("services.sync.sendVersionInfo", true);
 
 pref("services.sync.scheduler.eolInterval", 604800); // 1 week
 pref("services.sync.scheduler.idleInterval", 3600);  // 1 hour
 pref("services.sync.scheduler.activeInterval", 600);   // 10 minutes
 pref("services.sync.scheduler.immediateInterval", 90);    // 1.5 minutes
 pref("services.sync.scheduler.idleTime", 300);   // 5 minutes
--- a/services/sync/tests/unit/test_errorhandler_1.js
+++ b/services/sync/tests/unit/test_errorhandler_1.js
@@ -148,17 +148,16 @@ add_task(function test_no_lastSync_pref(
 });
 
 add_task(function test_shouldReportError() {
   Status.login = MASTER_PASSWORD_LOCKED;
   do_check_false(errorHandler.shouldReportError());
 
   // Give ourselves a clusterURL so that the temporary 401 no-error situation
   // doesn't come into play.
-  Service.serverURL  = fakeServerUrl;
   Service.clusterURL = fakeServerUrl;
 
   // Test dontIgnoreErrors, non-network, non-prolonged, sync error reported
   Status.resetSync();
   setLastSync(NON_PROLONGED_ERROR_DURATION);
   errorHandler.dontIgnoreErrors = true;
   Status.sync = CREDENTIALS_CHANGED;
   do_check_true(errorHandler.shouldReportError());
@@ -342,17 +341,16 @@ add_task(async function test_shouldRepor
   clean();
   await promiseStopServer(server);
 });
 
 // Test that even if we don't have a cluster URL, a login failure due to
 // authentication errors is always reported.
 add_task(function test_shouldReportLoginFailureWithNoCluster() {
   // Ensure no clusterURL - any error not specific to login should not be reported.
-  Service.serverURL  = "";
   Service.clusterURL = "";
 
   // Test explicit "login rejected" state.
   Status.resetSync();
   // If we have a LOGIN_REJECTED state, we always report the error.
   Status.login = LOGIN_FAILED_LOGIN_REJECTED;
   do_check_true(errorHandler.shouldReportError());
   // But any other status with a missing clusterURL is treated as a mid-sync
@@ -457,17 +455,16 @@ add_task(async function test_sync_syncAn
   await promiseNextTick();
   clean();
   await promiseStopServer(server);
 });
 
 add_task(async function test_login_syncAndReportErrors_network_error() {
   // Test network errors are reported when calling syncAndReportErrors.
   await configureIdentity({username: "broken.wipe"});
-  Service.serverURL  = fakeServerUrl;
   Service.clusterURL = fakeServerUrl;
 
   let promiseObserved = promiseOneObserver("weave:ui:login:error");
 
   setLastSync(NON_PROLONGED_ERROR_DURATION);
   errorHandler.syncAndReportErrors();
   await promiseObserved;
 
@@ -494,17 +491,16 @@ add_test(function test_sync_syncAndRepor
   errorHandler.syncAndReportErrors();
 });
 
 add_task(async function test_login_syncAndReportErrors_prolonged_network_error() {
   // Test prolonged, network errors are reported
   // when calling syncAndReportErrors.
   await configureIdentity({username: "johndoe"});
 
-  Service.serverURL  = fakeServerUrl;
   Service.clusterURL = fakeServerUrl;
 
   let promiseObserved = promiseOneObserver("weave:ui:login:error");
 
   setLastSync(PROLONGED_ERROR_DURATION);
   errorHandler.syncAndReportErrors();
   await promiseObserved;
   do_check_eq(Status.login, LOGIN_FAILED_NETWORK_ERROR);
@@ -575,17 +571,16 @@ add_task(async function test_sync_prolon
   do_check_true(errorHandler.didReportProlongedError);
   clean();
   await promiseStopServer(server);
 });
 
 add_task(async function test_login_prolonged_network_error() {
   // Test prolonged, network errors are reported
   await configureIdentity({username: "johndoe"});
-  Service.serverURL  = fakeServerUrl;
   Service.clusterURL = fakeServerUrl;
 
   let promiseObserved = promiseOneObserver("weave:ui:login:error");
 
   setLastSync(PROLONGED_ERROR_DURATION);
   Service.sync();
   await promiseObserved;
   do_check_eq(Status.sync, PROLONGED_SYNC_FAILURE);
@@ -651,17 +646,16 @@ add_task(async function test_sync_non_ne
   do_check_false(errorHandler.didReportProlongedError);
 
   clean();
   await promiseStopServer(server);
 });
 
 add_task(async function test_login_network_error() {
   await configureIdentity({username: "johndoe"});
-  Service.serverURL  = fakeServerUrl;
   Service.clusterURL = fakeServerUrl;
 
   let promiseObserved = promiseOneObserver("weave:ui:clear-error");
   // Test network errors are not reported.
 
   setLastSync(NON_PROLONGED_ERROR_DURATION);
   Service.sync();
   await promiseObserved;
--- a/services/sync/tests/unit/test_service_attributes.js
+++ b/services/sync/tests/unit/test_service_attributes.js
@@ -5,59 +5,40 @@ Cu.import("resource://services-sync/cons
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://testing-common/services/sync/fakeservices.js");
 Cu.import("resource://testing-common/services/sync/utils.js");
 
 add_task(async function test_urls() {
   _("URL related Service properties correspond to preference settings.");
   try {
-    do_check_true(!!Service.serverURL); // actual value may change
     do_check_eq(Service.clusterURL, "");
     do_check_false(Service.userBaseURL);
     do_check_eq(Service.infoURL, undefined);
     do_check_eq(Service.storageURL, undefined);
     do_check_eq(Service.metaURL, undefined);
 
     _("The 'clusterURL' attribute updates preferences and cached URLs.");
 
     // Since we don't have a cluster URL yet, these will still not be defined.
     do_check_eq(Service.infoURL, undefined);
     do_check_false(Service.userBaseURL);
     do_check_eq(Service.storageURL, undefined);
     do_check_eq(Service.metaURL, undefined);
 
-    Service.serverURL = "http://weave.server/";
     Service.clusterURL = "http://weave.cluster/1.1/johndoe/";
 
     do_check_eq(Service.userBaseURL, "http://weave.cluster/1.1/johndoe/");
     do_check_eq(Service.infoURL,
                 "http://weave.cluster/1.1/johndoe/info/collections");
     do_check_eq(Service.storageURL,
                 "http://weave.cluster/1.1/johndoe/storage/");
     do_check_eq(Service.metaURL,
                 "http://weave.cluster/1.1/johndoe/storage/meta/global");
 
-    _("The 'miscURL' attribute can be relative to 'serverURL' or absolute.");
-    Svc.Prefs.set("miscURL", "relative/misc/");
-    do_check_eq(Service.miscAPI,
-                "http://weave.server/relative/misc/1.0/");
-
-    Svc.Prefs.set("miscURL", "http://weave.misc.services/");
-    do_check_eq(Service.miscAPI, "http://weave.misc.services/1.0/");
-
-    do_check_eq(Service.pwResetURL,
-                "http://weave.server/weave-password-reset");
-
-    _("The 'serverURL' attributes updates/resets preferences.");
-
-    Service.serverURL = "http://different.auth.node/";
-    do_check_eq(Svc.Prefs.get("serverURL"), "http://different.auth.node/");
-    do_check_eq(Service.clusterURL, "");
-
   } finally {
     Svc.Prefs.resetBranch("");
   }
 });
 
 
 add_test(function test_syncID() {
   _("Service.syncID is auto-generated, corresponds to preference.");
--- a/services/sync/tests/unit/test_service_cluster.js
+++ b/services/sync/tests/unit/test_service_cluster.js
@@ -23,18 +23,16 @@ add_test(function test_findCluster() {
     let whenReadyToAuthenticate = PromiseUtils.defer();
     Service.identity.whenReadyToAuthenticate = whenReadyToAuthenticate;
     whenReadyToAuthenticate.resolve(true);
 
     Service.identity._ensureValidToken = () => Promise.reject(new Error("Connection refused"));
 
     _("_findCluster() throws on network errors (e.g. connection refused).");
     do_check_throws(function() {
-      Service.serverURL = "http://dummy:9000/";
-      Service.identity.account = "johndoe";
       Service._clusterManager._findCluster();
     });
 
     Service.identity._ensureValidToken = () => Promise.resolve(true);
     Service.identity._token = { endpoint: "http://weave.user.node" }
 
     _("_findCluster() returns the user's cluster node");
     let cluster = Service._clusterManager._findCluster();
--- a/services/sync/tests/unit/test_service_detect_upgrade.js
+++ b/services/sync/tests/unit/test_service_detect_upgrade.js
@@ -57,17 +57,16 @@ add_task(async function v4_upgrade() {
     delete Svc.Session;
     Svc.Session = {
       getBrowserState: () => JSON.stringify(myTabs)
     };
 
     Service.status.resetSync();
 
     _("Logging in.");
-    Service.serverURL = server.baseURI;
 
     await configureIdentity({ "username": "johndoe" }, server);
 
     Service.login();
     do_check_true(Service.isLoggedIn);
     Service.verifyAndFetchSymmetricKeys();
     do_check_true(Service._remoteSetup());
 
@@ -93,17 +92,16 @@ add_task(async function v4_upgrade() {
     _("Syncing after server has been upgraded and wiped.");
     Service.wipeServer();
     test_out_of_date();
 
     // Now's a great time to test what happens when keys get replaced.
     _("Syncing afresh...");
     Service.logout();
     Service.collectionKeys.clear();
-    Service.serverURL = server.baseURI;
     meta_global.payload = JSON.stringify({"syncID": "foooooooooooooobbbbbbbbbbbb",
                                           "storageVersion": STORAGE_VERSION});
     collections.meta = Date.now() / 1000;
     Service.recordManager.set(Service.metaURL, meta_global);
     Service.login();
     do_check_true(Service.isLoggedIn);
     Service.sync();
     do_check_true(Service.isLoggedIn);
@@ -223,17 +221,16 @@ add_task(async function v5_upgrade() {
                           }]}]};
     delete Svc.Session;
     Svc.Session = {
       getBrowserState: () => JSON.stringify(myTabs)
     };
 
     Service.status.resetSync();
 
-    Service.serverURL = server.baseURI + "/";
     Service.clusterURL = server.baseURI + "/";
 
     await configureIdentity({ "username": "johndoe" }, server);
 
     // Test an upgrade where the contents of the server would cause us to error
     // -- keys decrypted with a different sync key, for example.
     _("Testing v4 -> v5 (or similar) upgrade.");
     function update_server_keys(syncKeyBundle, wboName, collWBO) {
--- a/services/sync/tests/unit/test_service_getStorageInfo.js
+++ b/services/sync/tests/unit/test_service_getStorageInfo.js
@@ -23,17 +23,16 @@ function run_test() {
   setBasicCredentials("johndoe", "ilovejane");
 
   run_next_test();
 }
 
 add_test(function test_success() {
   let handler = httpd_handler(200, "OK", JSON.stringify(collections));
   let server = httpd_setup({"/1.1/johndoe/info/collections": handler});
-  Service.serverURL = server.baseURI + "/";
   Service.clusterURL = server.baseURI + "/";
 
   let request = Service.getStorageInfo("collections", function(error, info) {
     do_check_eq(error, null);
     do_check_true(Utils.deepEquals(info, collections));
 
     // Ensure that the request is sent off with the right bits.
     do_check_true(basic_auth_matches(handler.request,
@@ -65,30 +64,28 @@ add_test(function test_network_error() {
     do_check_eq(info, null);
     run_next_test();
   });
 });
 
 add_test(function test_http_error() {
   let handler = httpd_handler(500, "Oh noez", "Something went wrong!");
   let server = httpd_setup({"/1.1/johndoe/info/collections": handler});
-  Service.serverURL = server.baseURI + "/";
   Service.clusterURL = server.baseURI + "/";
 
   Service.getStorageInfo(INFO_COLLECTIONS, function(error, info) {
     do_check_eq(error.status, 500);
     do_check_eq(info, null);
     server.stop(run_next_test);
   });
 });
 
 add_test(function test_invalid_json() {
   let handler = httpd_handler(200, "OK", "Invalid JSON");
   let server = httpd_setup({"/1.1/johndoe/info/collections": handler});
-  Service.serverURL = server.baseURI + "/";
   Service.clusterURL = server.baseURI + "/";
 
   Service.getStorageInfo(INFO_COLLECTIONS, function(error, info) {
     do_check_eq(error.name, "SyntaxError");
     do_check_eq(info, null);
     server.stop(run_next_test);
   });
 });
--- a/services/sync/tests/unit/test_service_login.js
+++ b/services/sync/tests/unit/test_service_login.js
@@ -54,17 +54,16 @@ function setup() {
     // is where keys are generated or fetched.
     // TODO: have Jane fetch her keys, not generate them...
     "/1.1/johndoe/storage/crypto/keys": johnU("crypto", new ServerWBO("keys").handler()),
     "/1.1/johndoe/storage/meta/global": johnU("meta", new ServerWBO("global").handler()),
     "/1.1/janedoe/storage/crypto/keys": janeU("crypto", new ServerWBO("keys").handler()),
     "/1.1/janedoe/storage/meta/global": janeU("meta", new ServerWBO("global").handler())
   });
 
-  Service.serverURL = server.baseURI;
   return server;
 }
 
 add_task(async function test_login_logout() {
   let server = setup();
 
   try {
     _("Force the initial state.");
deleted file mode 100644
--- a/services/sync/tests/unit/test_service_set_serverURL.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Cu.import("resource://services-sync/service.js");
-
-function run_test() {
-  Service.serverURL = "http://example.com/sync";
-  do_check_eq(Service.serverURL, "http://example.com/sync/");
-
-  Service.serverURL = "http://example.com/sync/";
-  do_check_eq(Service.serverURL, "http://example.com/sync/");
-}
-
--- a/services/sync/tests/unit/test_service_startOver.js
+++ b/services/sync/tests/unit/test_service_startOver.js
@@ -61,18 +61,17 @@ add_task(async function test_resetLocalD
 add_test(function test_removeClientData() {
   let engine = Service.engineManager.get("bla");
 
   // No cluster URL = no removal.
   do_check_false(engine.removed);
   Service.startOver();
   do_check_false(engine.removed);
 
-  Service.serverURL = "https://localhost/";
-  Service.clusterURL = Service.serverURL;
+  Service.clusterURL = "https://localhost/";
 
   do_check_false(engine.removed);
   Service.startOver();
   do_check_true(engine.removed);
 
   run_next_test();
 });
 
--- a/services/sync/tests/unit/test_service_sync_remoteSetup.js
+++ b/services/sync/tests/unit/test_service_sync_remoteSetup.js
@@ -69,19 +69,16 @@ add_task(async function run_test() {
     return {
       restore() { server.registerPathHandler(path, handlers[path]); }
     }
   }
 
   let server = httpd_setup(handlers);
 
   try {
-    _("Log in.");
-    Service.serverURL = server.baseURI;
-
     _("Checking Status.sync with no credentials.");
     Service.verifyAndFetchSymmetricKeys();
     do_check_eq(Service.status.sync, CREDENTIALS_CHANGED);
     do_check_eq(Service.status.login, LOGIN_FAILED_NO_PASSPHRASE);
 
     await configureIdentity({ username: "johndoe" }, server);
 
     Service.login();
--- a/services/sync/tests/unit/test_service_verifyLogin.js
+++ b/services/sync/tests/unit/test_service_verifyLogin.js
@@ -44,18 +44,16 @@ add_task(async function test_verifyLogin
     "/1.1/johndoe/info/collections": login_handling(johnHelper.handler),
     "/1.1/janedoe/info/collections": service_unavailable,
 
     "/1.1/johndoe/storage/crypto/keys": johnU("crypto", new ServerWBO("keys").handler()),
     "/1.1/johndoe/storage/meta/global": johnU("meta", new ServerWBO("global").handler())
   });
 
   try {
-    Service.serverURL = server.baseURI;
-
     _("Force the initial state.");
     Service.status.service = STATUS_OK;
     do_check_eq(Service.status.service, STATUS_OK);
 
     _("Credentials won't check out because we're not configured yet.");
     Service.status.resetSync();
     do_check_false(Service.verifyLogin());
     do_check_eq(Service.status.service, CLIENT_NOT_CONFIGURED);
@@ -81,17 +79,17 @@ add_task(async function test_verifyLogin
     do_check_false(Service.verifyLogin());
     do_check_true(Service.status.enforceBackoff);
     do_check_eq(backoffInterval, 42);
     do_check_eq(Service.status.service, LOGIN_FAILED);
     do_check_eq(Service.status.login, SERVER_MAINTENANCE);
 
     _("Ensure a network error when finding the cluster sets the right Status bits.");
     Service.status.resetSync();
-    Service.serverURL = "http://localhost:12345/";
+    Service.clusterURL = "";
     Service._clusterManager._findCluster = () => "http://localhost:12345/";
     do_check_false(Service.verifyLogin());
     do_check_eq(Service.status.service, LOGIN_FAILED);
     do_check_eq(Service.status.login, LOGIN_FAILED_NETWORK_ERROR);
 
     _("Ensure a network error when getting the collection info sets the right Status bits.");
     Service.status.resetSync();
     Service.clusterURL = "http://localhost:12345/";
--- a/services/sync/tests/unit/test_service_wipeServer.js
+++ b/services/sync/tests/unit/test_service_wipeServer.js
@@ -27,17 +27,16 @@ FakeCollection.prototype = {
       response.setHeader("X-Weave-Timestamp", timestamp);
       response.setStatusLine(request.httpVersion, 200, "OK");
       response.bodyOutputStream.write(body, body.length);
     };
   }
 };
 
 async function setUpTestFixtures(server) {
-  Service.serverURL = server.baseURI + "/";
   Service.clusterURL = server.baseURI + "/";
 
   await configureIdentity(identityConfig);
 }
 
 
 function run_test() {
   initTestLogging("Trace");
@@ -213,17 +212,16 @@ add_task(async function test_wipeServer_
   Svc.Prefs.resetBranch("");
 });
 
 add_task(async function test_wipeServer_all_connectionRefused() {
   _("Service.wipeServer() throws if it encounters a network problem.");
   let server = httpd_setup({});
   await setUpTestFixtures(server);
 
-  Service.serverURL = "http://localhost:4352/";
   Service.clusterURL = "http://localhost:4352/";
 
   _("Try deletion.");
   try {
     Service.wipeServer();
     do_throw("Should have thrown!");
   } catch (ex) {
     do_check_eq(ex.result, Cr.NS_ERROR_CONNECTION_REFUSED);
--- a/services/sync/tests/unit/test_syncscheduler.js
+++ b/services/sync/tests/unit/test_syncscheduler.js
@@ -882,18 +882,17 @@ add_task(async function test_sync_503_Re
   do_check_true(scheduler.syncTimer.delay >= minimumExpectedDelay);
 
   await cleanUpAndGo(server);
 });
 
 add_task(async function test_loginError_recoverable_reschedules() {
   _("Verify that a recoverable login error schedules a new sync.");
   await configureIdentity({username: "johndoe@mozilla.com"});
-  Service.serverURL = "http://localhost:1234/";
-  Service.clusterURL = Service.serverURL;
+  Service.clusterURL = "http://localhost:1234/";
   Status.resetSync(); // reset Status.login
 
   let promiseObserved = promiseOneObserver("weave:service:login:error");
 
   // Let's set it up so that a sync is overdue, both in terms of previously
   // scheduled syncs and the global score. We still do not expect an immediate
   // sync because we just tried (duh).
   scheduler.nextSync = Date.now() - 100000;
@@ -927,18 +926,17 @@ add_task(async function test_loginError_
 add_task(async function test_loginError_fatal_clearsTriggers() {
   _("Verify that a fatal login error clears sync triggers.");
   await configureIdentity({username: "johndoe@mozilla.com"});
 
   let server = httpd_setup({
     "/1.1/johndoe@mozilla.com/info/collections": httpd_handler(401, "Unauthorized")
   });
 
-  Service.serverURL = server.baseURI + "/";
-  Service.clusterURL = Service.serverURL;
+  Service.clusterURL = server.baseURI + "/";
   Status.resetSync(); // reset Status.login
 
   let promiseObserved = promiseOneObserver("weave:service:login:error");
 
   // Sanity check.
   do_check_eq(scheduler.nextSync, 0);
   do_check_eq(scheduler.syncTimer, null);
   do_check_eq(Status.checkSetup(), STATUS_OK);
--- a/services/sync/tests/unit/test_telemetry.js
+++ b/services/sync/tests/unit/test_telemetry.js
@@ -82,17 +82,16 @@ add_task(async function test_basic() {
   let collections = ["clients", "bookmarks", "forms", "history", "passwords", "prefs", "tabs"];
 
   for (let coll of collections) {
     handlers["/1.1/johndoe/storage/" + coll] = upd(coll, new ServerCollection({}, true).handler());
   }
 
   let server = httpd_setup(handlers);
   await configureIdentity({ username: "johndoe" }, server);
-  Service.serverURL = server.baseURI;
 
   await sync_and_validate_telem(true);
 
   await promiseStopServer(server);
 });
 
 add_task(async function test_processIncoming_error() {
   let engine = new BookmarksEngine(Service);
--- a/services/sync/tests/unit/xpcshell.ini
+++ b/services/sync/tests/unit/xpcshell.ini
@@ -73,17 +73,16 @@ skip-if = os == "android"
 # Bug 752243: Profile cleanup frequently fails
 skip-if = os == "mac" || os == "linux"
 [test_service_cluster.js]
 [test_service_detect_upgrade.js]
 # XXX - Disabled because getStorageInfo is broken
 # [test_service_getStorageInfo.js]
 [test_service_login.js]
 [test_service_migratePrefs.js]
-[test_service_set_serverURL.js]
 [test_service_startOver.js]
 [test_service_startup.js]
 [test_service_sync_401.js]
 [test_service_sync_locked.js]
 [test_service_sync_remoteSetup.js]
 # Bug 676978: test hangs on Android (see also testing/xpcshell/xpcshell.ini)
 skip-if = os == "android"
 [test_service_sync_specified.js]
--- a/toolkit/components/telemetry/TelemetryEnvironment.jsm
+++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm
@@ -177,17 +177,16 @@ const DEFAULT_ENVIRONMENT_PREFS = new Ma
   ["layout.css.devPixelsPerPx", {what: RECORD_PREF_VALUE}],
   ["network.proxy.autoconfig_url", {what: RECORD_PREF_STATE}],
   ["network.proxy.http", {what: RECORD_PREF_STATE}],
   ["network.proxy.ssl", {what: RECORD_PREF_STATE}],
   ["pdfjs.disabled", {what: RECORD_PREF_VALUE}],
   ["places.history.enabled", {what: RECORD_PREF_VALUE}],
   ["privacy.trackingprotection.enabled", {what: RECORD_PREF_VALUE}],
   ["privacy.donottrackheader.enabled", {what: RECORD_PREF_VALUE}],
-  ["services.sync.serverURL", {what: RECORD_PREF_STATE}],
   ["security.mixed_content.block_active_content", {what: RECORD_PREF_VALUE}],
   ["security.mixed_content.block_display_content", {what: RECORD_PREF_VALUE}],
   ["security.sandbox.content.level", {what: RECORD_PREF_VALUE}],
   ["xpinstall.signatures.required", {what: RECORD_PREF_VALUE}],
 ]);
 
 const LOGGER_NAME = "Toolkit.Telemetry";