Bug 685926 - pass custom sync server url to mozmill framework, a=testonly, DONTBUILD
authorJonathan Griffin <jgriffin@mozilla.com>
Fri, 09 Sep 2011 10:27:17 -0700
changeset 77253 5e7a991c8305cc5a2f895923362e2832de5c414d
parent 77252 42cd2123ad10059497fc1dcf88a1ac6dfcf5def7
child 77254 cebcf93501983c32332ef712b32dcf271295b382
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewerstestonly, DONTBUILD
bugs685926
milestone9.0a1
Bug 685926 - pass custom sync server url to mozmill framework, a=testonly, DONTBUILD
services/sync/tps/extensions/tps/modules/sync.jsm
services/sync/tps/extensions/tps/modules/tps.jsm
--- a/services/sync/tps/extensions/tps/modules/sync.jsm
+++ b/services/sync/tps/extensions/tps/modules/sync.jsm
@@ -89,16 +89,20 @@ var TPS = {
           this._syncErrors = 0;
           this._waitingForSync = false;
         }
         break;
     }
   },
 
   SetupSyncAccount: function TPS__SetupSyncAccount() {
+    let serverURL = prefs.getCharPref('tps.account.serverURL');
+    if (serverURL) {
+      Weave.Service.serverURL = serverURL;
+    }
     Weave.Service.account = prefs.getCharPref('tps.account.username');
     Weave.Service.password = prefs.getCharPref('tps.account.password');
     Weave.Service.passphrase = prefs.getCharPref('tps.account.passphrase');
     Weave.Svc.Obs.notify("weave:service:setup-complete");
   },
 
   Sync: function TPS__Sync(options) {
     Logger.logInfo('Mozmill starting sync operation: ' + options);
--- a/services/sync/tps/extensions/tps/modules/tps.jsm
+++ b/services/sync/tps/extensions/tps/modules/tps.jsm
@@ -507,16 +507,19 @@ var TPS =
 
       // Store account details as prefs so they're accessible to the mozmill
       // framework.
       let prefs = CC["@mozilla.org/preferences-service;1"]
                   .getService(CI.nsIPrefBranch);
       prefs.setCharPref('tps.account.username', this.config.account.username);
       prefs.setCharPref('tps.account.password', this.config.account.password);
       prefs.setCharPref('tps.account.passphrase', this.config.account.passphrase);
+      if (this.config.account['serverURL']) {
+        prefs.setCharPref('tps.account.serverURL', this.config.account.serverURL);
+      }
 
       // start processing the test actions
       this._currentAction = 0;
     }
     catch(e) {
       this.DumpError("Exception caught: " + e);
       return;
     }