Bug 785225 - Part 11: Burninate trailing whitespace from tests; r=rnewman
authorGregory Szorc <gps@mozilla.com>
Wed, 29 Aug 2012 14:43:41 -0700
changeset 111058 43e9f9c938760ecf6f90a90868421792bb4198fe
parent 111057 cf4c39d50fd26b16f25e68cb370655ae620c0da0
child 111059 475cacc53484927638fea3e6faef340dc67b36f1
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersrnewman
bugs785225
milestone18.0a1
Bug 785225 - Part 11: Burninate trailing whitespace from tests; r=rnewman
services/sync/tests/unit/head_http_server.js
services/sync/tests/unit/test_bookmark_engine.js
services/sync/tests/unit/test_bookmark_livemarks.js
services/sync/tests/unit/test_bookmark_record.js
services/sync/tests/unit/test_bookmark_smart_bookmarks.js
services/sync/tests/unit/test_bookmark_store.js
services/sync/tests/unit/test_collections_recovery.js
services/sync/tests/unit/test_corrupt_keys.js
services/sync/tests/unit/test_engine_abort.js
services/sync/tests/unit/test_history_engine.js
services/sync/tests/unit/test_hmac_error.js
services/sync/tests/unit/test_httpd_sync_server.js
services/sync/tests/unit/test_jpakeclient.js
services/sync/tests/unit/test_password_tracker.js
services/sync/tests/unit/test_prefs_store.js
services/sync/tests/unit/test_records_crypto.js
services/sync/tests/unit/test_resource.js
services/sync/tests/unit/test_resource_async.js
services/sync/tests/unit/test_service_detect_upgrade.js
services/sync/tests/unit/test_service_migratePrefs.js
services/sync/tests/unit/test_service_passwordUTF8.js
services/sync/tests/unit/test_service_startOver.js
services/sync/tests/unit/test_service_sync_locked.js
services/sync/tests/unit/test_service_verifyLogin.js
services/sync/tests/unit/test_service_wipeServer.js
services/sync/tests/unit/test_syncengine_sync.js
services/sync/tests/unit/test_syncscheduler.js
services/sync/tests/unit/test_syncstoragerequest.js
services/sync/tests/unit/test_tab_engine.js
services/sync/tests/unit/test_utils_catch.js
services/sync/tests/unit/test_utils_deriveKey.js
services/sync/tests/unit/test_utils_getErrorString.js
services/sync/tests/unit/test_utils_passphrase.js
--- a/services/sync/tests/unit/head_http_server.js
+++ b/services/sync/tests/unit/head_http_server.js
@@ -432,17 +432,17 @@ function sync_httpd_setup(handlers) {
       = (new ServerWBO("global", {})).handler();
   return httpd_setup(handlers);
 }
 
 /*
  * Track collection modified times. Return closures.
  */
 function track_collections_helper() {
-  
+
   /*
    * Our tracking object.
    */
   let collections = {};
 
   /*
    * Update the timestamp of a collection.
    */
@@ -483,17 +483,17 @@ function track_collections_helper() {
 
     response.setHeader("Content-Type", "application/json");
     response.setHeader("X-Weave-Timestamp",
                        "" + new_timestamp(),
                        false);
     response.setStatusLine(request.httpVersion, 200, "OK");
     response.bodyOutputStream.write(body, body.length);
   }
-  
+
   return {"collections": collections,
           "handler": info_collections,
           "with_updated_collection": with_updated_collection,
           "update_collection": update_collection};
 }
 
 //===========================================================================//
 // httpd.js-based Sync server.                                               //
@@ -775,17 +775,17 @@ SyncServer.prototype = {
   },
 
   /**
    * This is invoked by the HttpServer. `this` is bound to the SyncServer;
    * `handler` is the HttpServer's handler.
    *
    * TODO: need to use the correct Sync API response codes and errors here.
    * TODO: Basic Auth.
-   * TODO: check username in path against username in BasicAuth. 
+   * TODO: check username in path against username in BasicAuth.
    */
   handleDefault: function handleDefault(handler, req, resp) {
     try {
       this._handleDefault(handler, req, resp);
     } catch (e) {
       if (e instanceof HttpError) {
         this.respond(req, resp, e.code, e.description, "", {});
       } else {
@@ -909,17 +909,17 @@ SyncServer.prototype = {
             return;
           }
           coll.collectionHandler(req, resp);
 
           // Spot if this is a DELETE for some IDs, and don't blow away the
           // whole collection!
           //
           // We already handled deleting the WBOs by invoking the deleted
-          // collection's handler. However, in the case of 
+          // collection's handler. However, in the case of
           //
           //   DELETE storage/foobar
           //
           // we also need to remove foobar from the collections map. This
           // clause tries to differentiate the above request from
           //
           //  DELETE storage/foobar?ids=foo,baz
           //
--- a/services/sync/tests/unit/test_bookmark_engine.js
+++ b/services/sync/tests/unit/test_bookmark_engine.js
@@ -439,17 +439,17 @@ add_test(function test_bookmark_is_tagga
 add_test(function test_bookmark_tag_but_no_uri() {
   _("Ensure that a bookmark record with tags, but no URI, doesn't throw an exception.");
 
   let engine = new BookmarksEngine(Service);
   let store = engine._store;
 
   // We're simply checking that no exception is thrown, so
   // no actual checks in this test.
- 
+
   store._tagURI(null, ["foo"]);
   store._tagURI(null, null);
   store._tagURI(Utils.makeURI("about:fake"), null);
 
   let record = {
     _parent:     PlacesUtils.bookmarks.toolbarFolder,
     id:          Utils.makeGUID(),
     description: "",
--- a/services/sync/tests/unit/test_bookmark_livemarks.js
+++ b/services/sync/tests/unit/test_bookmark_livemarks.js
@@ -55,17 +55,17 @@ let record631361 = {
 
 // Clean up after other tests. Only necessary in XULRunner.
 store.wipe();
 
 function makeLivemark(p, mintGUID) {
   let b = new Livemark("bookmarks", p.id);
   // Copy here, because tests mutate the contents.
   b.cleartext = TestingUtils.deepCopy(p);
-  
+
   if (mintGUID)
     b.id = Utils.makeGUID();
 
   return b;
 }
 
 
 function run_test() {
@@ -80,64 +80,64 @@ add_test(function test_livemark_descript
   let record = record631361.payload;
 
   function doRecord(r) {
     store._childrenToOrder = {};
     store.applyIncoming(r);
     store._orderChildren();
     delete store._childrenToOrder;
   }
-  
+
   // Attempt to provoke an error by messing around with the description.
   record.description = null;
   doRecord(makeLivemark(record));
   record.description = "";
   doRecord(makeLivemark(record));
-  
+
   // Attempt to provoke an error by adding a bad description anno.
   let id = store.idForGUID(record.id);
   PlacesUtils.annotations.setItemAnnotation(id, DESCRIPTION_ANNO, "", 0,
                                             PlacesUtils.annotations.EXPIRE_NEVER);
 
   run_next_test();
 });
 
 add_test(function test_livemark_invalid() {
   _("Livemarks considered invalid by nsLivemarkService are skipped.");
-  
+
   _("Parent is 0, which is invalid. Will be set to unfiled.");
   let noParentRec = makeLivemark(record631361.payload, true);
   noParentRec._parent = 0;
   store.create(noParentRec);
   let recID = store.idForGUID(noParentRec.id, true);
   do_check_true(recID > 0);
   do_check_eq(PlacesUtils.bookmarks.getFolderIdForItem(recID), PlacesUtils.bookmarks.unfiledBookmarksFolder);
-  
+
   _("Parent is unknown. Will be set to unfiled.");
   let lateParentRec = makeLivemark(record631361.payload, true);
   let parentGUID = Utils.makeGUID();
   lateParentRec.parentid = parentGUID;
   lateParentRec._parent = store.idForGUID(parentGUID);   // Usually done by applyIncoming.
   do_check_eq(-1, lateParentRec._parent);
-  
+
   store.create(lateParentRec);
   recID = store.idForGUID(lateParentRec.id, true);
   do_check_true(recID > 0);
   do_check_eq(PlacesUtils.bookmarks.getFolderIdForItem(recID),
               PlacesUtils.bookmarks.unfiledBookmarksFolder);
-  
+
   _("No feed URI, which is invalid. Will be skipped.");
   let noFeedURIRec = makeLivemark(record631361.payload, true);
   delete noFeedURIRec.cleartext.feedUri;
   store.create(noFeedURIRec);
   // No exception, but no creation occurs.
   do_check_eq(-1, store.idForGUID(noFeedURIRec.id, true));
 
   _("Parent is a Livemark. Will be skipped.");
   let lmParentRec = makeLivemark(record631361.payload, true);
   lmParentRec._parent = recID;
   store.create(lmParentRec);
   // No exception, but no creation occurs.
   do_check_eq(-1, store.idForGUID(lmParentRec.id, true));
-  
+
   // Clear event loop.
   Utils.nextTick(run_next_test);
 });
--- a/services/sync/tests/unit/test_bookmark_record.js
+++ b/services/sync/tests/unit/test_bookmark_record.js
@@ -23,24 +23,24 @@ function run_test() {
   let log = Log4Moz.repository.getLogger("Test");
   Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
   log.info("Creating a record");
 
   let u = "http://localhost:8080/storage/bookmarks/foo";
   let placesItem = new PlacesItem("bookmarks", "foo", "bookmark");
   let bookmarkItem = prepareBookmarkItem("bookmarks", "foo");
-  
+
   log.info("Checking getTypeObject");
   do_check_eq(placesItem.getTypeObject(placesItem.type), Bookmark);
   do_check_eq(bookmarkItem.getTypeObject(bookmarkItem.type), Bookmark);
-  
+
   bookmarkItem.encrypt(keyBundle);
   log.info("Ciphertext is " + bookmarkItem.ciphertext);
   do_check_true(bookmarkItem.ciphertext != null);
-  
+
   log.info("Decrypting the record");
 
   let payload = bookmarkItem.decrypt(keyBundle);
   do_check_eq(payload.stuff, "my payload here");
   do_check_eq(bookmarkItem.getTypeObject(bookmarkItem.type), Bookmark);
   do_check_neq(payload, bookmarkItem.payload); // wrap.data.payload is the encrypted one
 }
--- a/services/sync/tests/unit/test_bookmark_smart_bookmarks.js
+++ b/services/sync/tests/unit/test_bookmark_smart_bookmarks.js
@@ -56,19 +56,19 @@ function serverForFoo(engine) {
 }
 
 // Verify that Places smart bookmarks have their annotation uploaded and
 // handled locally.
 add_test(function test_annotation_uploaded() {
   new SyncTestingInfrastructure();
 
   let startCount = smartBookmarkCount();
-  
+
   _("Start count is " + startCount);
-  
+
   if (startCount > 0) {
     // This can happen in XULRunner.
     clearBookmarks();
     _("Start count is now " + startCount);
   }
 
   _("Create a smart bookmark in the toolbar.");
   let parent = PlacesUtils.toolbarFolderId;
@@ -123,17 +123,17 @@ add_test(function test_annotation_upload
     do_check_true(!!serverWBO);
     let body = JSON.parse(JSON.parse(serverWBO.payload).ciphertext);
     do_check_eq(body.queryId, "MostVisited");
 
     _("We still have the right count.");
     do_check_eq(smartBookmarkCount(), startCount + 1);
 
     _("Clear local records; now we can't find it.");
-    
+
     // "Clear" by changing attributes: if we delete it, apparently it sticks
     // around as a deleted record...
     PlacesUtils.bookmarks.setItemTitle(mostVisitedID, "Not Most Visited");
     PlacesUtils.bookmarks.changeBookmarkURI(
       mostVisitedID, Utils.makeURI("http://something/else"));
     PlacesUtils.annotations.removeItemAnnotation(mostVisitedID,
                                                  SMART_BOOKMARKS_ANNO);
     store.wipe();
@@ -148,25 +148,25 @@ add_test(function test_annotation_upload
     do_check_eq(smartBookmarkCount(), startCount + 1);
 
     _("Find by GUID and verify that it's annotated.");
     let newID = store.idForGUID(serverGUID);
     let newAnnoValue = PlacesUtils.annotations.getItemAnnotation(
       newID, SMART_BOOKMARKS_ANNO);
     do_check_eq(newAnnoValue, "MostVisited");
     do_check_eq(PlacesUtils.bookmarks.getBookmarkURI(newID).spec, uri.spec);
-    
+
     _("Test updating.");
     let newRecord = store.createRecord(serverGUID);
     do_check_eq(newRecord.queryId, newAnnoValue);
     newRecord.queryId = "LeastVisited";
     store.update(newRecord);
     do_check_eq("LeastVisited", PlacesUtils.annotations.getItemAnnotation(
       newID, SMART_BOOKMARKS_ANNO));
-    
+
 
   } finally {
     // Clean up.
     store.wipe();
     Svc.Prefs.resetBranch("");
     Records.clearCache();
     server.stop(run_next_test);
   }
@@ -178,47 +178,47 @@ add_test(function test_smart_bookmarks_d
   let parent = PlacesUtils.toolbarFolderId;
   let uri =
     Utils.makeURI("place:sort=" +
                   Ci.nsINavHistoryQueryOptions.SORT_BY_VISITCOUNT_DESCENDING +
                   "&maxResults=10");
   let title = "Most Visited";
   let mostVisitedID = newSmartBookmark(parent, uri, -1, title, "MostVisited");
   let mostVisitedGUID = store.GUIDForId(mostVisitedID);
-  
+
   let record = store.createRecord(mostVisitedGUID);
-  
+
   _("Prepare sync.");
   let server = serverForFoo(engine);
   let collection = server.user("foo").collection("bookmarks");
 
   try {
     engine._syncStartup();
-    
+
     _("Verify that mapDupe uses the anno, discovering a dupe regardless of URI.");
     do_check_eq(mostVisitedGUID, engine._mapDupe(record));
-    
+
     record.bmkUri = "http://foo/";
     do_check_eq(mostVisitedGUID, engine._mapDupe(record));
     do_check_neq(PlacesUtils.bookmarks.getBookmarkURI(mostVisitedID).spec,
                  record.bmkUri);
-    
+
     _("Verify that different annos don't dupe.");
     let other = new BookmarkQuery("bookmarks", "abcdefabcdef");
     other.queryId = "LeastVisited";
     other.parentName = "Bookmarks Toolbar";
     other.bmkUri = "place:foo";
     other.title = "";
     do_check_eq(undefined, engine._findDupe(other));
-    
+
     _("Handle records without a queryId entry.");
     record.bmkUri = uri;
     delete record.queryId;
     do_check_eq(mostVisitedGUID, engine._mapDupe(record));
-    
+
     engine._syncFinish();
 
   } finally {
     // Clean up.
     store.wipe();
     server.stop(do_test_finished);
     Svc.Prefs.resetBranch("");
     Records.clearCache();
--- a/services/sync/tests/unit/test_bookmark_store.js
+++ b/services/sync/tests/unit/test_bookmark_store.js
@@ -159,17 +159,17 @@ function test_folder_create() {
     do_check_eq(PlacesUtils.bookmarks.getItemTitle(id), folder.title);
     do_check_eq(PlacesUtils.bookmarks.getFolderIdForItem(id),
                 PlacesUtils.bookmarks.toolbarFolder);
 
     _("Have the store create a new record object. Verify that it has the same data.");
     let newrecord = store.createRecord(folder.id);
     do_check_true(newrecord instanceof BookmarkFolder);
     for each (let property in ["title", "parentName", "parentid"])
-      do_check_eq(newrecord[property], folder[property]);      
+      do_check_eq(newrecord[property], folder[property]);
 
     _("Folders have high sort index to ensure they're synced first.");
     do_check_eq(newrecord.sortindex, 1000000);
   } finally {
     _("Clean up.");
     store.wipe();
   }
 }
--- a/services/sync/tests/unit/test_collections_recovery.js
+++ b/services/sync/tests/unit/test_collections_recovery.js
@@ -1,16 +1,16 @@
 // Verify that we wipe the server if we have to regenerate keys.
 Cu.import("resource://services-sync/service.js");
 
 add_test(function test_missing_crypto_collection() {
   let johnHelper = track_collections_helper();
   let johnU      = johnHelper.with_updated_collection;
   let johnColls  = johnHelper.collections;
-  
+
   let empty = false;
   function maybe_empty(handler) {
     return function (request, response) {
       if (empty) {
         let body = "{}";
         response.setStatusLine(request.httpVersion, 200, "OK");
         response.bodyOutputStream.write(body, body.length);
       } else {
@@ -39,17 +39,17 @@ add_test(function test_missing_crypto_co
   try {
     let fresh = 0;
     let orig  = Service._freshStart;
     Service._freshStart = function() {
       _("Called _freshStart.");
       orig.call(Service);
       fresh++;
     };
-    
+
     _("Startup, no meta/global: freshStart called once.");
     Service.sync();
     do_check_eq(fresh, 1);
     fresh = 0;
 
     _("Regular sync: no need to freshStart.");
     Service.sync();
     do_check_eq(fresh, 0);
--- a/services/sync/tests/unit/test_corrupt_keys.js
+++ b/services/sync/tests/unit/test_corrupt_keys.js
@@ -16,32 +16,32 @@ add_test(function test_locally_changed_k
 
   let hmacErrorCount = 0;
   function counting(f) {
     return function() {
       hmacErrorCount++;
       return f.call(this);
     };
   }
-  
+
   Service.handleHMACEvent = counting(Service.handleHMACEvent);
-  
+
   let server  = new SyncServer();
   let johndoe = server.registerUser("johndoe", "password");
   johndoe.createContents({
     meta: {},
     crypto: {},
     clients: {}
   });
   server.start();
 
   try {
     Svc.Prefs.set("registerEngines", "Tab");
     _("Set up some tabs.");
-    let myTabs = 
+    let myTabs =
       {windows: [{tabs: [{index: 1,
                           entries: [{
                             url: "http://foo.com/",
                             title: "Title"
                           }],
                           attributes: {
                             image: "image"
                           },
@@ -58,150 +58,150 @@ add_test(function test_locally_changed_k
     Service.clusterURL = TEST_CLUSTER_URL;
 
     Service.engineManager.register(HistoryEngine);
 
     function corrupt_local_keys() {
       CollectionKeys._default.keyPair = [Svc.Crypto.generateRandomKey(),
                                          Svc.Crypto.generateRandomKey()];
     }
-    
+
     _("Setting meta.");
-    
+
     // Bump version on the server.
     let m = new WBORecord("meta", "global");
     m.payload = {"syncID": "foooooooooooooooooooooooooo",
                  "storageVersion": STORAGE_VERSION};
     m.upload(Service.metaURL);
-    
+
     _("New meta/global: " + JSON.stringify(johndoe.collection("meta").wbo("global")));
-    
+
     // Upload keys.
     generateNewKeys();
     let serverKeys = CollectionKeys.asWBO("crypto", "keys");
     serverKeys.encrypt(Identity.syncKeyBundle);
     do_check_true(serverKeys.upload(Service.cryptoKeysURL).success);
-    
+
     // Check that login works.
     do_check_true(Service.login("johndoe", "ilovejane", passphrase));
     do_check_true(Service.isLoggedIn);
-    
+
     // Sync should upload records.
     Service.sync();
-    
+
     // Tabs exist.
     _("Tabs modified: " + johndoe.modified("tabs"));
     do_check_true(johndoe.modified("tabs") > 0);
-    
+
     let coll_modified = CollectionKeys.lastModified;
-    
+
     // Let's create some server side history records.
     let liveKeys = CollectionKeys.keyForCollection("history");
     _("Keys now: " + liveKeys.keyPair);
     let visitType = Ci.nsINavHistoryService.TRANSITION_LINK;
     let history   = johndoe.createCollection("history");
     for (let i = 0; i < 5; i++) {
       let id = 'record-no--' + i;
       let modified = Date.now()/1000 - 60*(i+10);
-      
+
       let w = new CryptoWrapper("history", "id");
       w.cleartext = {
         id: id,
         histUri: "http://foo/bar?" + id,
         title: id,
         sortindex: i,
         visits: [{date: (modified - 5) * 1000000, type: visitType}],
         deleted: false};
       w.encrypt();
-      
+
       let payload = {ciphertext: w.ciphertext,
                      IV:         w.IV,
                      hmac:       w.hmac};
       history.insert(id, payload, modified);
     }
-    
+
     history.timestamp = Date.now() / 1000;
     let old_key_time = johndoe.modified("crypto");
     _("Old key time: " + old_key_time);
-    
+
     // Check that we can decrypt one.
     let rec = new CryptoWrapper("history", "record-no--0");
     rec.fetch(Service.storageURL + "history/record-no--0");
     _(JSON.stringify(rec));
     do_check_true(!!rec.decrypt());
-    
+
     do_check_eq(hmacErrorCount, 0);
-    
+
     // Fill local key cache with bad data.
     corrupt_local_keys();
     _("Keys now: " + CollectionKeys.keyForCollection("history").keyPair);
-    
+
     do_check_eq(hmacErrorCount, 0);
-    
+
     _("HMAC error count: " + hmacErrorCount);
     // Now syncing should succeed, after one HMAC error.
     Service.sync();
     do_check_eq(hmacErrorCount, 1);
     _("Keys now: " + CollectionKeys.keyForCollection("history").keyPair);
-    
+
     // And look! We downloaded history!
     let store = Service.engineManager.get("history")._store;
     do_check_true(store.urlExists("http://foo/bar?record-no--0"));
     do_check_true(store.urlExists("http://foo/bar?record-no--1"));
     do_check_true(store.urlExists("http://foo/bar?record-no--2"));
     do_check_true(store.urlExists("http://foo/bar?record-no--3"));
     do_check_true(store.urlExists("http://foo/bar?record-no--4"));
     do_check_eq(hmacErrorCount, 1);
-    
+
     _("Busting some new server values.");
     // Now what happens if we corrupt the HMAC on the server?
     for (let i = 5; i < 10; i++) {
       let id = 'record-no--' + i;
       let modified = 1 + (Date.now() / 1000);
-      
+
       let w = new CryptoWrapper("history", "id");
       w.cleartext = {
         id: id,
         histUri: "http://foo/bar?" + id,
         title: id,
         sortindex: i,
         visits: [{date: (modified - 5 ) * 1000000, type: visitType}],
         deleted: false};
       w.encrypt();
       w.hmac = w.hmac.toUpperCase();
-      
+
       let payload = {ciphertext: w.ciphertext,
                      IV:         w.IV,
                      hmac:       w.hmac};
       history.insert(id, payload, modified);
     }
     history.timestamp = Date.now() / 1000;
-    
+
     _("Server key time hasn't changed.");
     do_check_eq(johndoe.modified("crypto"), old_key_time);
-    
+
     _("Resetting HMAC error timer.");
     Service.lastHMACEvent = 0;
-    
+
     _("Syncing...");
     Service.sync();
     _("Keys now: " + CollectionKeys.keyForCollection("history").keyPair);
     _("Server keys have been updated, and we skipped over 5 more HMAC errors without adjusting history.");
     do_check_true(johndoe.modified("crypto") > old_key_time);
     do_check_eq(hmacErrorCount, 6);
     do_check_false(store.urlExists("http://foo/bar?record-no--5"));
     do_check_false(store.urlExists("http://foo/bar?record-no--6"));
     do_check_false(store.urlExists("http://foo/bar?record-no--7"));
     do_check_false(store.urlExists("http://foo/bar?record-no--8"));
     do_check_false(store.urlExists("http://foo/bar?record-no--9"));
-    
+
   } finally {
     Svc.Prefs.resetBranch("");
     server.stop(run_next_test);
   }
 });
 
 function run_test() {
   let logger = Log4Moz.repository.rootLogger;
   Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
-  
+
   run_next_test();
 }
--- a/services/sync/tests/unit/test_engine_abort.js
+++ b/services/sync/tests/unit/test_engine_abort.js
@@ -28,17 +28,17 @@ add_test(function test_processIncoming_a
 
   _("Fake applyIncoming to abort.");
   engine._store.applyIncoming = function (record) {
     let ex = {code: Engine.prototype.eEngineAbortApplyIncoming,
               cause: "Nooo"};
     _("Throwing: " + JSON.stringify(ex));
     throw ex;
   };
-  
+
   _("Trying _processIncoming. It will throw after aborting.");
   let err;
   try {
     engine._syncStartup();
     engine._processIncoming();
   } catch (ex) {
     err = ex;
   }
--- a/services/sync/tests/unit/test_history_engine.js
+++ b/services/sync/tests/unit/test_history_engine.js
@@ -37,76 +37,76 @@ add_test(function test_processIncoming_m
     let modified = Date.now()/1000 - 60*(i+10);
     let payload = encryptPayload({
       id: id,
       histUri: "http://foo/bar?" + id,
         title: id,
         sortindex: i,
         visits: [{date: (modified - 5) * 1000000, type: visitType}],
         deleted: false});
-    
+
     let wbo = new ServerWBO(id, payload);
     wbo.modified = modified;
     collection.insertWBO(wbo);
   }
-  
+
   let server = sync_httpd_setup({
       "/1.1/foo/storage/history": collection.handler()
   });
 
   let engine = new HistoryEngine("history");
   let meta_global = Records.set(engine.metaURL, new WBORecord(engine.metaURL));
   meta_global.payload.engines = {history: {version: engine.version,
                                            syncID: engine.syncID}};
 
   try {
 
     _("On a mobile client, we get new records from the server in batches of 50.");
     engine._syncStartup();
-    
+
     // Fake a lower limit.
     engine.downloadLimit = FAKE_DOWNLOAD_LIMIT;
     _("Last modified: " + engine.lastModified);
     _("Processing...");
     engine._processIncoming();
-    
+
     _("Last modified: " + engine.lastModified);
     engine._syncFinish();
-    
+
     // Back to the normal limit.
     _("Running again. Should fetch none, because of lastModified");
     engine.downloadLimit = MAX_HISTORY_DOWNLOAD;
     _("Processing...");
     engine._processIncoming();
-    
+
     _("Last modified: " + engine.lastModified);
     _("Running again. Expecting to pull everything");
-    
+
     engine.lastModified = undefined;
     engine.lastSync     = 0;
     _("Processing...");
     engine._processIncoming();
-    
+
     _("Last modified: " + engine.lastModified);
 
     // Verify that the right number of GET requests with the right
     // kind of parameters were made.
     do_check_eq(collection.get_log.length,
         // First try:
         1 +    // First 50...
         1 +    // 1 GUID fetch...
                // 1 fetch...
         Math.ceil((FAKE_DOWNLOAD_LIMIT - 50) / MOBILE_BATCH_SIZE) +
         // Second try: none
         // Third try:
         1 +    // First 50...
         1 +    // 1 GUID fetch...
                // 4 fetch...
         Math.ceil((234 - 50) / MOBILE_BATCH_SIZE));
-    
+
     // Check the structure of each HTTP request.
     do_check_eq(collection.get_log[0].full, 1);
     do_check_eq(collection.get_log[0].limit, MOBILE_BATCH_SIZE);
     do_check_eq(collection.get_log[1].full, undefined);
     do_check_eq(collection.get_log[1].sort, "index");
     do_check_eq(collection.get_log[1].limit, FAKE_DOWNLOAD_LIMIT);
     do_check_eq(collection.get_log[2].full, 1);
     do_check_eq(collection.get_log[3].full, 1);
--- a/services/sync/tests/unit/test_hmac_error.js
+++ b/services/sync/tests/unit/test_hmac_error.js
@@ -219,17 +219,17 @@ add_test(function hmac_error_during_node
         hmacErrorCount = 0;
 
         onSyncFinished = function() {
           // Two rotary items, one client record... no errors.
           do_check_eq(hmacErrorCount, 0)
 
           Svc.Obs.remove("weave:service:sync:finish", obs);
           Svc.Obs.remove("weave:service:sync:error", obs);
-                  
+
           Svc.Prefs.resetBranch("");
           Records.clearCache();
           server.stop(run_next_test);
         };
 
         Service.sync();
       },
       this);
--- a/services/sync/tests/unit/test_httpd_sync_server.js
+++ b/services/sync/tests/unit/test_httpd_sync_server.js
@@ -180,17 +180,17 @@ add_test(function test_storage_request()
       Utils.nextTick(next);
     });
   }
   function deleteWBONotExists(next) {
     let req = localRequest(keysURL);
     server.callback.onItemDeleted = function (username, collection, wboID) {
       do_throw("onItemDeleted should not have been called.");
     };
-      
+
     req.delete(function (err) {
       _("Body is " + this.response.body);
       _("Modified is " + this.response.newModified);
       do_check_eq(this.response.status, 200);
       delete server.callback.onItemDeleted;
       Utils.nextTick(next);
     });
   }
@@ -199,17 +199,17 @@ add_test(function test_storage_request()
     server.callback.onItemDeleted = function (username, collection, wboID) {
       _("onItemDeleted called for " + collection + "/" + wboID);
       delete server.callback.onItemDeleted;
       do_check_eq(username, "john");
       do_check_eq(collection, "crypto");
       do_check_eq(wboID, "foos");
       Utils.nextTick(next);
     };
-      
+
     req.delete(function (err) {
       _("Body is " + this.response.body);
       _("Modified is " + this.response.newModified);
       do_check_eq(this.response.status, 200);
     });
   }
   function deleteStorage(next) {
     _("Testing DELETE on /storage.");
--- a/services/sync/tests/unit/test_jpakeclient.js
+++ b/services/sync/tests/unit/test_jpakeclient.js
@@ -295,17 +295,17 @@ add_test(function test_firstMsgMaxTries(
 
       // Clean up.
       initHooks();
       run_next_test();
     }
   });
   rec.receiveNoPIN();
 });
-  
+
 
 add_test(function test_lastMsgMaxTries() {
   _("Test that receiver can wait longer for the last message.");
 
  let snd = new JPAKEClient({
     __proto__: BaseController,
     onPaired: function onPaired() {
       // For the purpose of the tests, the poll interval is 50ms and
--- a/services/sync/tests/unit/test_password_tracker.js
+++ b/services/sync/tests/unit/test_password_tracker.js
@@ -78,17 +78,17 @@ function test_onWipe() {
   let tracker = engine._tracker;
   do_check_empty(tracker.changedIDs);
   do_check_eq(tracker.score, 0);
 
   try {
     _("A store wipe should increment the score");
     Svc.Obs.notify("weave:engine:start-tracking");
     store.wipe();
-    
+
     do_check_eq(tracker.score, SCORE_INCREMENT_XLARGE);
   } finally {
     tracker.resetScore();
     Svc.Obs.notify("weave:engine:stop-tracking");
   }
 }
 
 function run_test() {
--- a/services/sync/tests/unit/test_prefs_store.js
+++ b/services/sync/tests/unit/test_prefs_store.js
@@ -69,17 +69,17 @@ function run_test() {
     do_check_eq(record.value["services.sync.prefs.sync.testing.int"], true);
     do_check_eq(record.value["services.sync.prefs.sync.testing.string"], true);
     do_check_eq(record.value["services.sync.prefs.sync.testing.bool"], true);
     do_check_eq(record.value["services.sync.prefs.sync.testing.dont.change"], true);
     do_check_eq(record.value["services.sync.prefs.sync.testing.turned.off"], false);
     do_check_eq(record.value["services.sync.prefs.sync.testing.nonexistent"], true);
 
     _("Update some prefs, including one that's to be reset/deleted.");
-    Svc.Prefs.set("testing.deleteme", "I'm going to be deleted!"); 
+    Svc.Prefs.set("testing.deleteme", "I'm going to be deleted!");
     record = new PrefRec("prefs", PREFS_GUID);
     record.value = {
       "testing.int": 42,
       "testing.string": "im in ur prefs",
       "testing.bool": false,
       "testing.deleteme": null,
       "services.sync.prefs.sync.testing.somepref": true
     };
--- a/services/sync/tests/unit/test_records_crypto.js
+++ b/services/sync/tests/unit/test_records_crypto.js
@@ -49,17 +49,17 @@ function run_test() {
 
     log.info("cryptoWrap: " + cryptoWrap.toString());
 
     log.info("Encrypting a record");
 
     cryptoWrap.encrypt(keyBundle);
     log.info("Ciphertext is " + cryptoWrap.ciphertext);
     do_check_true(cryptoWrap.ciphertext != null);
-    
+
     let firstIV = cryptoWrap.IV;
 
     log.info("Decrypting the record");
 
     let payload = cryptoWrap.decrypt(keyBundle);
     do_check_eq(payload.stuff, "my payload here");
     do_check_neq(payload, cryptoWrap.payload); // wrap.data.payload is the encrypted one
 
--- a/services/sync/tests/unit/test_resource.js
+++ b/services/sync/tests/unit/test_resource.js
@@ -102,31 +102,31 @@ function server_timestamp(metadata, resp
   response.setStatusLine(metadata.httpVersion, 200, "OK");
   response.bodyOutputStream.write(body, body.length);
 }
 
 function server_backoff(metadata, response) {
   let body = "Hey, back off!";
   response.setHeader("X-Weave-Backoff", '600', false);
   response.setStatusLine(metadata.httpVersion, 200, "OK");
-  response.bodyOutputStream.write(body, body.length);  
+  response.bodyOutputStream.write(body, body.length);
 }
 
 function server_quota_notice(request, response) {
   let body = "You're approaching quota.";
   response.setHeader("X-Weave-Quota-Remaining", '1048576', false);
   response.setStatusLine(request.httpVersion, 200, "OK");
-  response.bodyOutputStream.write(body, body.length);  
+  response.bodyOutputStream.write(body, body.length);
 }
 
 function server_quota_error(request, response) {
   let body = "14";
   response.setHeader("X-Weave-Quota-Remaining", '-1024', false);
   response.setStatusLine(request.httpVersion, 400, "OK");
-  response.bodyOutputStream.write(body, body.length);  
+  response.bodyOutputStream.write(body, body.length);
 }
 
 function server_headers(metadata, response) {
   let ignore_headers = ["host", "user-agent", "accept", "accept-language",
                         "accept-encoding", "accept-charset", "keep-alive",
                         "connection", "pragma", "cache-control",
                         "content-length"];
   let headers = metadata.headers;
@@ -439,17 +439,17 @@ function run_test() {
   }
 
   // It throws and logs.
   do_check_eq(error.result, Cr.NS_ERROR_MALFORMED_URI);
   do_check_eq(error, "Error: NS_ERROR_MALFORMED_URI");
   do_check_eq(warnings.pop(),
               "Got exception calling onProgress handler during fetch of " +
               "http://localhost:8080/json");
-  
+
   // And this is what happens if JS throws an exception.
   res18 = new Resource("http://localhost:8080/json");
   onProgress = function(rec) {
     throw "BOO!";
   };
   res18._onProgress = onProgress;
   oldWarn = res18._log.warn;
   warnings = [];
--- a/services/sync/tests/unit/test_resource_async.js
+++ b/services/sync/tests/unit/test_resource_async.js
@@ -105,31 +105,31 @@ function server_timestamp(metadata, resp
   response.setStatusLine(metadata.httpVersion, 200, "OK");
   response.bodyOutputStream.write(body, body.length);
 }
 
 function server_backoff(metadata, response) {
   let body = "Hey, back off!";
   response.setHeader("X-Weave-Backoff", '600', false);
   response.setStatusLine(metadata.httpVersion, 200, "OK");
-  response.bodyOutputStream.write(body, body.length);  
+  response.bodyOutputStream.write(body, body.length);
 }
 
 function server_quota_notice(request, response) {
   let body = "You're approaching quota.";
   response.setHeader("X-Weave-Quota-Remaining", '1048576', false);
   response.setStatusLine(request.httpVersion, 200, "OK");
-  response.bodyOutputStream.write(body, body.length);  
+  response.bodyOutputStream.write(body, body.length);
 }
 
 function server_quota_error(request, response) {
   let body = "14";
   response.setHeader("X-Weave-Quota-Remaining", '-1024', false);
   response.setStatusLine(request.httpVersion, 400, "OK");
-  response.bodyOutputStream.write(body, body.length);  
+  response.bodyOutputStream.write(body, body.length);
 }
 
 function server_headers(metadata, response) {
   let ignore_headers = ["host", "user-agent", "accept", "accept-language",
                         "accept-encoding", "accept-charset", "keep-alive",
                         "connection", "pragma", "cache-control",
                         "content-length"];
   let headers = metadata.headers;
@@ -167,17 +167,17 @@ function run_test() {
 // Don't put any other HTTP requests earlier in the file!
 add_test(function test_proxy_auth_redirect() {
   _("Ensure that a proxy auth redirect (which switches out our channel) " +
     "doesn't break AsyncResource.");
   let server = httpd_setup({
     "/open": server_open,
     "/pac2": server_pac
   });
-    
+
   PACSystemSettings.PACURI = "http://localhost:8080/pac2";
   installFakePAC();
   let res = new AsyncResource("http://localhost:8080/open");
   res.get(function (error, result) {
     do_check_true(!error);
     do_check_true(pacFetched);
     do_check_true(fetched);
     do_check_eq("This path exists", result);
@@ -661,17 +661,17 @@ add_test(function test_js_exception_hand
 
   res15.get(function (error, content) {
     do_check_eq(error.result, Cr.NS_ERROR_XPC_JS_THREW_STRING);
     do_check_eq(error.message, "NS_ERROR_XPC_JS_THREW_STRING");
     do_check_eq(content, null);
     do_check_eq(warnings.pop(),
                 "Got exception calling onProgress handler during fetch of " +
                 "http://localhost:8080/json");
-      
+
     run_next_test();
   });
 });
 
 add_test(function test_timeout() {
   _("Ensure channel timeouts are thrown appropriately.");
   let res19 = new AsyncResource("http://localhost:8080/json");
   res19.ABORT_TIMEOUT = 0;
--- a/services/sync/tests/unit/test_service_detect_upgrade.js
+++ b/services/sync/tests/unit/test_service_detect_upgrade.js
@@ -26,55 +26,55 @@ add_test(function v4_upgrade() {
   let collections = collectionsHelper.collections;
 
   let keysWBO = new ServerWBO("keys");
   let server = httpd_setup({
     // Special.
     "/1.1/johndoe/info/collections": collectionsHelper.handler,
     "/1.1/johndoe/storage/crypto/keys": upd("crypto", keysWBO.handler()),
     "/1.1/johndoe/storage/meta/global": upd("meta", meta_global.handler()),
-      
+
     // Track modified times.
     "/1.1/johndoe/storage/clients": upd("clients", clients.handler()),
     "/1.1/johndoe/storage/tabs": upd("tabs", new ServerCollection().handler()),
-    
+
     // Just so we don't get 404s in the logs.
     "/1.1/johndoe/storage/bookmarks": new ServerCollection().handler(),
     "/1.1/johndoe/storage/forms": new ServerCollection().handler(),
     "/1.1/johndoe/storage/history": new ServerCollection().handler(),
     "/1.1/johndoe/storage/passwords": new ServerCollection().handler(),
     "/1.1/johndoe/storage/prefs": new ServerCollection().handler()
   });
 
   try {
-    
+
     _("Set up some tabs.");
-    let myTabs = 
+    let myTabs =
       {windows: [{tabs: [{index: 1,
                           entries: [{
                             url: "http://foo.com/",
                             title: "Title"
                           }],
                           attributes: {
                             image: "image"
                           },
                           extData: {
                             weaveLastUsed: 1
                           }}]}]};
     delete Svc.Session;
     Svc.Session = {
       getBrowserState: function () JSON.stringify(myTabs)
     };
-    
+
     Status.resetSync();
-    
+
     _("Logging in.");
     Weave.Service.serverURL = TEST_SERVER_URL;
     Weave.Service.clusterURL = TEST_CLUSTER_URL;
-    
+
     Weave.Service.login("johndoe", "ilovejane", passphrase);
     do_check_true(Weave.Service.isLoggedIn);
     Weave.Service.verifyAndFetchSymmetricKeys();
     do_check_true(Weave.Service._remoteSetup());
 
     function test_out_of_date() {
       _("Old meta/global: " + JSON.stringify(meta_global));
       meta_global.payload = JSON.stringify({"syncID": "foooooooooooooooooooooooooo",
@@ -84,41 +84,41 @@ add_test(function v4_upgrade() {
       Records.set(Weave.Service.metaURL, meta_global);
       try {
         Weave.Service.sync();
       }
       catch (ex) {
       }
       do_check_eq(Status.sync, VERSION_OUT_OF_DATE);
     }
-    
+
     // See what happens when we bump the storage version.
     _("Syncing after server has been upgraded.");
     test_out_of_date();
-    
+
     // Same should happen after a wipe.
     _("Syncing after server has been upgraded and wiped.");
     Weave.Service.wipeServer();
     test_out_of_date();
-    
+
     // Now's a great time to test what happens when keys get replaced.
     _("Syncing afresh...");
     Weave.Service.logout();
     CollectionKeys.clear();
     Weave.Service.serverURL = TEST_SERVER_URL;
     Weave.Service.clusterURL = TEST_CLUSTER_URL;
     meta_global.payload = JSON.stringify({"syncID": "foooooooooooooobbbbbbbbbbbb",
                                           "storageVersion": STORAGE_VERSION});
     collections.meta = Date.now() / 1000;
     Records.set(Weave.Service.metaURL, meta_global);
     Weave.Service.login("johndoe", "ilovejane", passphrase);
     do_check_true(Weave.Service.isLoggedIn);
     Weave.Service.sync();
     do_check_true(Weave.Service.isLoggedIn);
-    
+
     let serverDecrypted;
     let serverKeys;
     let serverResp;
 
 
     function retrieve_server_default() {
       serverKeys = serverResp = serverDecrypted = null;
 
@@ -131,66 +131,66 @@ add_test(function v4_upgrade() {
       _("serverKeys:          " + JSON.stringify(serverKeys));
 
       return serverDecrypted.default;
     }
 
     function retrieve_and_compare_default(should_succeed) {
       let serverDefault = retrieve_server_default();
       let localDefault = CollectionKeys.keyForCollection().keyPairB64;
-      
+
       _("Retrieved keyBundle: " + JSON.stringify(serverDefault));
       _("Local keyBundle:     " + JSON.stringify(localDefault));
-      
+
       if (should_succeed)
         do_check_eq(JSON.stringify(serverDefault), JSON.stringify(localDefault));
       else
         do_check_neq(JSON.stringify(serverDefault), JSON.stringify(localDefault));
     }
 
     // Uses the objects set above.
     function set_server_keys(pair) {
       serverDecrypted.default = pair;
       serverKeys.cleartext = serverDecrypted;
       serverKeys.encrypt(Weave.Identity.syncKeyBundle);
       serverKeys.upload(Weave.Service.cryptoKeysURL);
     }
 
     _("Checking we have the latest keys.");
     retrieve_and_compare_default(true);
-    
+
     _("Update keys on server.");
     set_server_keys(["KaaaaaaaaaaaHAtfmuRY0XEJ7LXfFuqvF7opFdBD/MY=",
                      "aaaaaaaaaaaapxMO6TEWtLIOv9dj6kBAJdzhWDkkkis="]);
-    
+
     _("Checking that we no longer have the latest keys.");
     retrieve_and_compare_default(false);
-    
+
     _("Indeed, they're what we set them to...");
     do_check_eq("KaaaaaaaaaaaHAtfmuRY0XEJ7LXfFuqvF7opFdBD/MY=",
                 retrieve_server_default()[0]);
-    
+
     _("Sync. Should download changed keys automatically.");
     let oldClientsModified = collections.clients;
     let oldTabsModified = collections.tabs;
-    
+
     Weave.Service.login("johndoe", "ilovejane", passphrase);
     Weave.Service.sync();
     _("New key should have forced upload of data.");
     _("Tabs: " + oldTabsModified + " < " + collections.tabs);
     _("Clients: " + oldClientsModified + " < " + collections.clients);
     do_check_true(collections.clients > oldClientsModified);
     do_check_true(collections.tabs    > oldTabsModified);
-    
+
     _("... and keys will now match.");
     retrieve_and_compare_default(true);
-    
+
     // Clean up.
     Weave.Service.startOver();
-    
+
   } finally {
     Weave.Svc.Prefs.resetBranch("");
     server.stop(run_next_test);
   }
 });
 
 add_test(function v5_upgrade() {
   let passphrase = "abcdeabcdeabcdeabcdeabcdea";
@@ -199,33 +199,33 @@ add_test(function v5_upgrade() {
   let collectionsHelper = track_collections_helper();
   let upd = collectionsHelper.with_updated_collection;
   let collections = collectionsHelper.collections;
 
   let keysWBO = new ServerWBO("keys");
   let bulkWBO = new ServerWBO("bulk");
   let clients = new ServerCollection();
   let meta_global = new ServerWBO('global');
-  
+
   let server = httpd_setup({
     // Special.
     "/1.1/johndoe/storage/meta/global": upd("meta", meta_global.handler()),
     "/1.1/johndoe/info/collections": collectionsHelper.handler,
     "/1.1/johndoe/storage/crypto/keys": upd("crypto", keysWBO.handler()),
     "/1.1/johndoe/storage/crypto/bulk": upd("crypto", bulkWBO.handler()),
-      
+
     // Track modified times.
     "/1.1/johndoe/storage/clients": upd("clients", clients.handler()),
     "/1.1/johndoe/storage/tabs": upd("tabs", new ServerCollection().handler()),
   });
 
   try {
-    
+
     _("Set up some tabs.");
-    let myTabs = 
+    let myTabs =
       {windows: [{tabs: [{index: 1,
                           entries: [{
                             url: "http://foo.com/",
                             title: "Title"
                           }],
                           attributes: {
                             image: "image"
                           },
--- a/services/sync/tests/unit/test_service_migratePrefs.js
+++ b/services/sync/tests/unit/test_service_migratePrefs.js
@@ -2,17 +2,17 @@ Cu.import("resource://services-common/pr
 
 function test_migrate_logging() {
   _("Testing log pref migration.");
   Svc.Prefs.set("log.appender.debugLog", "Warn");
   Svc.Prefs.set("log.appender.debugLog.enabled", true);
   do_check_true(Svc.Prefs.get("log.appender.debugLog.enabled"));
   do_check_eq(Svc.Prefs.get("log.appender.file.level"), "Trace");
   do_check_eq(Svc.Prefs.get("log.appender.file.logOnSuccess"), false);
-  
+
   Service._migratePrefs();
 
   do_check_eq("Warn", Svc.Prefs.get("log.appender.file.level"));
   do_check_true(Svc.Prefs.get("log.appender.file.logOnSuccess"));
   do_check_eq(Svc.Prefs.get("log.appender.debugLog"), undefined);
   do_check_eq(Svc.Prefs.get("log.appender.debugLog.enabled"), undefined);
 };
 
--- a/services/sync/tests/unit/test_service_passwordUTF8.js
+++ b/services/sync/tests/unit/test_service_passwordUTF8.js
@@ -48,17 +48,17 @@ function change_password(request, respon
   response.bodyOutputStream.write(body, body.length);
 }
 
 function run_test() {
   initTestLogging("Trace");
   let collectionsHelper = track_collections_helper();
   let upd = collectionsHelper.with_updated_collection;
   let collections = collectionsHelper.collections;
-  
+
   do_test_pending();
   let server = httpd_setup({
     "/1.1/johndoe/info/collections":    login_handling(collectionsHelper.handler),
     "/1.1/johndoe/storage/meta/global": upd("meta",   new ServerWBO("global").handler()),
     "/1.1/johndoe/storage/crypto/keys": upd("crypto", new ServerWBO("keys").handler()),
     "/user/1.0/johndoe/password":       change_password
   });
 
--- a/services/sync/tests/unit/test_service_startOver.js
+++ b/services/sync/tests/unit/test_service_startOver.js
@@ -70,17 +70,17 @@ add_test(function test_removeClientData(
 
   // No cluster URL = no removal.
   do_check_false(engine.removed);
   Service.startOver();
   do_check_false(engine.removed);
 
   Svc.Prefs.set("serverURL", TEST_SERVER_URL);
   Svc.Prefs.set("clusterURL", TEST_CLUSTER_URL);
-  
+
   do_check_false(engine.removed);
   Service.startOver();
   do_check_true(engine.removed);
 
   run_next_test();
 });
 
 add_test(function test_reset_SyncScheduler() {
--- a/services/sync/tests/unit/test_service_sync_locked.js
+++ b/services/sync/tests/unit/test_service_sync_locked.js
@@ -1,32 +1,32 @@
 Cu.import("resource://services-sync/main.js");
 
 function run_test() {
   let debug = [];
   let info  = [];
-  
+
   function augmentLogger(old) {
     let d = old.debug;
     let i = old.info;
     old.debug = function(m) { debug.push(m); d.call(old, m); }
     old.info  = function(m) { info.push(m);  i.call(old, m); }
     return old;
   }
-  
+
   Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
-  
+
   augmentLogger(Weave.Service._log);
 
   // Avoid daily ping
   Weave.Svc.Prefs.set("lastPing", Math.floor(Date.now() / 1000));
-  
+
   _("Check that sync will log appropriately if already in 'progress'.");
   Weave.Service._locked = true;
   Weave.Service.sync();
   Weave.Service._locked = false;
-  
+
   do_check_eq(debug[debug.length - 2],
               "Exception: Could not acquire lock. Label: \"service.js: login\". No traceback available");
   do_check_eq(info[info.length - 1],
               "Cannot start sync: already syncing?");
 }
 
--- a/services/sync/tests/unit/test_service_verifyLogin.js
+++ b/services/sync/tests/unit/test_service_verifyLogin.js
@@ -27,22 +27,22 @@ function run_test() {
   let logger = Log4Moz.repository.rootLogger;
   Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
   // This test expects a clean slate -- no saved passphrase.
   Services.logins.removeAllLogins();
   let johnHelper = track_collections_helper();
   let johnU      = johnHelper.with_updated_collection;
   let johnColls  = johnHelper.collections;
-  
+
   do_test_pending();
   let server = httpd_setup({
     "/api/1.1/johndoe/info/collections": login_handling(johnHelper.handler),
     "/api/1.1/janedoe/info/collections": service_unavailable,
-      
+
     "/api/1.1/johndoe/storage/crypto/keys": johnU("crypto", new ServerWBO("keys").handler()),
     "/api/1.1/johndoe/storage/meta/global": johnU("meta",   new ServerWBO("global").handler()),
     "/user/1.0/johndoe/node/weave": httpd_handler(200, "OK", "http://localhost:8080/api/")
   });
 
   try {
     Service.serverURL = TEST_SERVER_URL;
 
@@ -73,17 +73,17 @@ function run_test() {
     do_check_eq(Status.service, STATUS_OK);
     do_check_eq(Status.login, LOGIN_SUCCEEDED);
 
     _("If verifyLogin() encounters a server error, it flips on the backoff flag and notifies observers on a 503 with Retry-After.");
     Status.resetSync();
     Identity.account = "janedoe";
     Service._updateCachedURLs();
     do_check_false(Status.enforceBackoff);
-    let backoffInterval;    
+    let backoffInterval;
     Svc.Obs.add("weave:service:backoff:interval", function observe(subject, data) {
       Svc.Obs.remove("weave:service:backoff:interval", observe);
       backoffInterval = subject;
     });
     do_check_false(Service.verifyLogin());
     do_check_true(Status.enforceBackoff);
     do_check_eq(backoffInterval, 42);
     do_check_eq(Status.service, LOGIN_FAILED);
--- a/services/sync/tests/unit/test_service_wipeServer.js
+++ b/services/sync/tests/unit/test_service_wipeServer.js
@@ -113,17 +113,17 @@ add_test(function test_wipeServer_list_5
   } finally {
     server.stop(run_next_test);
     Svc.Prefs.resetBranch("");
   }
 });
 
 add_test(function test_wipeServer_all_success() {
   _("Service.wipeServer() deletes all the things.");
-  
+
   /**
    * Handle the bulk DELETE request sent by wipeServer.
    */
   let deleted = false;
   let serverTimestamp;
   function storageHandler(request, response) {
     do_check_eq("DELETE", request.method);
     do_check_true(request.hasHeader("X-Confirm-Delete"));
@@ -143,17 +143,17 @@ add_test(function test_wipeServer_all_su
   do_check_eq(returnedTimestamp, serverTimestamp);
 
   server.stop(run_next_test);
   Svc.Prefs.resetBranch("");
 });
 
 add_test(function test_wipeServer_all_404() {
   _("Service.wipeServer() accepts a 404.");
-  
+
   /**
    * Handle the bulk DELETE request sent by wipeServer. Returns a 404.
    */
   let deleted = false;
   let serverTimestamp;
   function storageHandler(request, response) {
     do_check_eq("DELETE", request.method);
     do_check_true(request.hasHeader("X-Confirm-Delete"));
@@ -175,17 +175,17 @@ add_test(function test_wipeServer_all_40
   do_check_eq(returnedTimestamp, serverTimestamp);
 
   server.stop(run_next_test);
   Svc.Prefs.resetBranch("");
 });
 
 add_test(function test_wipeServer_all_503() {
   _("Service.wipeServer() throws if it encounters a non-200/404 response.");
-  
+
   /**
    * Handle the bulk DELETE request sent by wipeServer. Returns a 503.
    */
   function storageHandler(request, response) {
     do_check_eq("DELETE", request.method);
     do_check_true(request.hasHeader("X-Confirm-Delete"));
     response.setStatusLine(request.httpVersion, 503, "Service Unavailable");
   }
--- a/services/sync/tests/unit/test_syncengine_sync.js
+++ b/services/sync/tests/unit/test_syncengine_sync.js
@@ -54,24 +54,24 @@ function createServerAndConfigureClient(
 function run_test() {
   generateNewKeys();
   Svc.Prefs.set("log.logger.engine.rotary", "Trace");
   run_next_test();
 }
 
 /*
  * Tests
- * 
+ *
  * SyncEngine._sync() is divided into four rather independent steps:
  *
  * - _syncStartup()
  * - _processIncoming()
  * - _uploadOutgoing()
  * - _syncFinish()
- * 
+ *
  * In the spirit of unit testing, these are tested individually for
  * different scenarios below.
  */
 
 add_test(function test_syncStartup_emptyOrOutdatedGlobalsResetsSync() {
   _("SyncEngine._syncStartup resets sync and wipes server data if there's no or an outdated global record");
 
   let syncTesting = new SyncTestingInfrastructure();
@@ -100,17 +100,17 @@ add_test(function test_syncStartup_empty
     do_check_eq(engine._tracker.changedIDs["rekolok"], undefined);
     let metaGlobal = Records.get(engine.metaURL);
     do_check_eq(metaGlobal.payload.engines, undefined);
     do_check_true(!!collection.payload("flying"));
     do_check_true(!!collection.payload("scotsman"));
 
     engine.lastSync = Date.now() / 1000;
     engine.lastSyncLocal = Date.now();
-    
+
     // Trying to prompt a wipe -- we no longer track CryptoMeta per engine,
     // so it has nothing to check.
     engine._syncStartup();
 
     // The meta/global WBO has been filled with data about the engine
     let engineData = metaGlobal.payload.engines["rotary"];
     do_check_eq(engineData.version, engine.version);
     do_check_eq(engineData.syncID, engine.syncID);
@@ -177,17 +177,17 @@ add_test(function test_syncStartup_syncI
     // Confirm initial environment
     do_check_eq(engine.syncID, 'fake-guid-0');
     do_check_eq(engine._tracker.changedIDs["rekolok"], undefined);
 
     engine.lastSync = Date.now() / 1000;
     engine.lastSyncLocal = Date.now();
     engine._syncStartup();
 
-    // The engine has assumed the server's syncID 
+    // The engine has assumed the server's syncID
     do_check_eq(engine.syncID, 'foobar');
 
     // Sync was reset
     do_check_eq(engine.lastSync, 0);
 
   } finally {
     cleanAndGo(server);
   }
@@ -222,17 +222,17 @@ add_test(function test_processIncoming_e
 
 add_test(function test_processIncoming_createFromServer() {
   _("SyncEngine._processIncoming creates new records from server data");
 
   let syncTesting = new SyncTestingInfrastructure();
   Svc.Prefs.set("serverURL", TEST_SERVER_URL);
   Svc.Prefs.set("clusterURL", TEST_CLUSTER_URL);
   Svc.Prefs.set("username", "foo");
-  
+
   generateNewKeys();
 
   // Some server records that will be downloaded
   let collection = new ServerCollection();
   collection.insert('flying',
                     encryptPayload({id: 'flying',
                                     denomination: "LNER Class A3 4472"}));
   collection.insert('scotsman',
@@ -918,17 +918,17 @@ add_test(function test_processIncoming_a
 
 
 add_test(function test_processIncoming_notify_count() {
   _("Ensure that failed records are reported only once.");
   let syncTesting = new SyncTestingInfrastructure();
   Svc.Prefs.set("serverURL", TEST_SERVER_URL);
   Svc.Prefs.set("clusterURL", TEST_CLUSTER_URL);
   Svc.Prefs.set("username", "foo");
-  
+
   const APPLY_BATCH_SIZE = 5;
   const NUMBER_OF_RECORDS = 15;
 
   // Engine that fails the first record.
   let engine = makeRotaryEngine();
   engine.applyIncomingBatchSize = APPLY_BATCH_SIZE;
   engine._store._applyIncomingBatch = engine._store.applyIncomingBatch;
   engine._store.applyIncomingBatch = function (records) {
@@ -965,34 +965,34 @@ add_test(function test_processIncoming_n
       counts = count;
       called++;
     }
     Svc.Obs.add("weave:engine:sync:applied", onApplied);
 
     // Do sync.
     engine._syncStartup();
     engine._processIncoming();
-    
+
     // Confirm failures.
     do_check_attribute_count(engine._store.items, 12);
     do_check_eq(engine.previousFailed.length, 3);
     do_check_eq(engine.previousFailed[0], "record-no-0");
     do_check_eq(engine.previousFailed[1], "record-no-5");
     do_check_eq(engine.previousFailed[2], "record-no-10");
 
     // There are newly failed records and they are reported.
     do_check_eq(called, 1);
     do_check_eq(counts.failed, 3);
     do_check_eq(counts.applied, 15);
     do_check_eq(counts.newFailed, 3);
     do_check_eq(counts.succeeded, 12);
 
     // Sync again, 1 of the failed items are the same, the rest didn't fail.
     engine._processIncoming();
-    
+
     // Confirming removed failures.
     do_check_attribute_count(engine._store.items, 14);
     do_check_eq(engine.previousFailed.length, 1);
     do_check_eq(engine.previousFailed[0], "record-no-0");
 
     do_check_eq(called, 2);
     do_check_eq(counts.failed, 1);
     do_check_eq(counts.applied, 3);
@@ -1008,23 +1008,23 @@ add_test(function test_processIncoming_n
 
 add_test(function test_processIncoming_previousFailed() {
   _("Ensure that failed records are retried.");
   let syncTesting = new SyncTestingInfrastructure();
   Svc.Prefs.set("serverURL", TEST_SERVER_URL);
   Svc.Prefs.set("clusterURL", TEST_CLUSTER_URL);
   Svc.Prefs.set("username", "foo");
   Svc.Prefs.set("client.type", "mobile");
-  
+
   const APPLY_BATCH_SIZE = 4;
   const NUMBER_OF_RECORDS = 14;
 
   // Engine that fails the first 2 records.
   let engine = makeRotaryEngine();
-  engine.mobileGUIDFetchBatchSize = engine.applyIncomingBatchSize = APPLY_BATCH_SIZE;  
+  engine.mobileGUIDFetchBatchSize = engine.applyIncomingBatchSize = APPLY_BATCH_SIZE;
   engine._store._applyIncomingBatch = engine._store.applyIncomingBatch;
   engine._store.applyIncomingBatch = function (records) {
     engine._store._applyIncomingBatch(records.slice(2));
     return [records[0].id, records[1].id];
   };
 
   // Create a batch of server side records.
   let collection = new ServerCollection();
@@ -1200,17 +1200,17 @@ add_test(function test_processIncoming_f
     function batchDownload(batchSize) {
       count = 0;
       uris  = [];
       engine.guidFetchBatchSize = batchSize;
       engine._processIncoming();
       _("Tried again. Requests: " + count + "; URIs: " + JSON.stringify(uris));
       return count;
     }
-    
+
     // There are 8 bad records, so this needs 3 fetches.
     _("Test batching with ID batch size 3, normal mobile batch size.");
     do_check_eq(batchDownload(3), 3);
 
     // Now see with a more realistic limit.
     _("Test batching with sufficient ID batch size.");
     do_check_eq(batchDownload(BOGUS_RECORDS.length), 1);
 
@@ -1321,17 +1321,17 @@ add_test(function test_uploadOutgoing_to
       "/1.1/foo/storage/rotary/scotsman": collection.wbo("scotsman").handler()
   });
   generateNewKeys();
 
   let engine = makeRotaryEngine();
   engine.lastSync = 123; // needs to be non-zero so that tracker is queried
   engine._store.items = {flying: "LNER Class A3 4472",
                          scotsman: "Flying Scotsman"};
-  // Mark one of these records as changed 
+  // Mark one of these records as changed
   engine._tracker.addChangedID('scotsman', 0);
 
   let meta_global = Records.set(engine.metaURL, new WBORecord(engine.metaURL));
   meta_global.payload.engines = {rotary: {version: engine.version,
                                          syncID: engine.syncID}};
 
   try {
 
@@ -1379,17 +1379,17 @@ add_test(function test_uploadOutgoing_fa
       "/1.1/foo/storage/rotary": collection.handler()
   });
 
   let engine = makeRotaryEngine();
   engine.lastSync = 123; // needs to be non-zero so that tracker is queried
   engine._store.items = {flying: "LNER Class A3 4472",
                          scotsman: "Flying Scotsman",
                          peppercorn: "Peppercorn Class"};
-  // Mark these records as changed 
+  // Mark these records as changed
   const FLYING_CHANGED = 12345;
   const SCOTSMAN_CHANGED = 23456;
   const PEPPERCORN_CHANGED = 34567;
   engine._tracker.addChangedID('flying', FLYING_CHANGED);
   engine._tracker.addChangedID('scotsman', SCOTSMAN_CHANGED);
   engine._tracker.addChangedID('peppercorn', PEPPERCORN_CHANGED);
 
   let meta_global = Records.set(engine.metaURL, new WBORecord(engine.metaURL));
@@ -1720,17 +1720,17 @@ add_test(function test_canDecrypt_true()
   _("SyncEngine.canDecrypt returns true if the engine can decrypt the items on the server.");
   let syncTesting = new SyncTestingInfrastructure();
   Svc.Prefs.set("serverURL", TEST_SERVER_URL);
   Svc.Prefs.set("clusterURL", TEST_CLUSTER_URL);
   Svc.Prefs.set("username", "foo");
 
   // Set up CollectionKeys, as service.js does.
   generateNewKeys();
-  
+
   let collection = new ServerCollection();
   collection._wbos.flying = new ServerWBO(
       'flying', encryptPayload({id: 'flying',
                                 denomination: "LNER Class A3 4472"}));
 
   let server = sync_httpd_setup({
       "/1.1/foo/storage/rotary": collection.handler()
   });
--- a/services/sync/tests/unit/test_syncscheduler.js
+++ b/services/sync/tests/unit/test_syncscheduler.js
@@ -153,17 +153,17 @@ add_test(function test_updateClientMode(
   clientsEngine._store.create({id: "foo", cleartext: "bar"});
   scheduler.updateClientMode();
 
   do_check_eq(scheduler.syncThreshold, MULTI_DEVICE_THRESHOLD);
   do_check_eq(scheduler.syncInterval, scheduler.activeInterval);
   do_check_true(scheduler.numClients > 1);
   do_check_false(scheduler.idle);
 
-  // Resets the number of clients to 0. 
+  // Resets the number of clients to 0.
   clientsEngine.resetClient();
   scheduler.updateClientMode();
 
   // Goes back to single user if # clients is 1.
   do_check_eq(scheduler.numClients, 1);
   do_check_eq(scheduler.syncThreshold, SINGLE_USER_THRESHOLD);
   do_check_eq(scheduler.syncInterval, scheduler.singleDeviceInterval);
   do_check_false(scheduler.numClients > 1);
@@ -171,17 +171,17 @@ add_test(function test_updateClientMode(
 
   cleanUpAndGo();
 });
 
 add_test(function test_masterpassword_locked_retry_interval() {
   _("Test Status.login = MASTER_PASSWORD_LOCKED results in reschedule at MASTER_PASSWORD interval");
   let loginFailed = false;
   Svc.Obs.add("weave:service:login:error", function onLoginError() {
-    Svc.Obs.remove("weave:service:login:error", onLoginError); 
+    Svc.Obs.remove("weave:service:login:error", onLoginError);
     loginFailed = true;
   });
 
   let rescheduleInterval = false;
 
   let oldScheduleAtInterval = SyncScheduler.prototype.scheduleAtInterval;
   SyncScheduler.prototype.scheduleAtInterval = function (interval) {
     rescheduleInterval = true;
@@ -215,22 +215,22 @@ add_test(function test_calculateBackoff(
   // Test no interval larger than the maximum backoff is used if
   // Status.backoffInterval is smaller.
   Status.backoffInterval = 5;
   let backoffInterval = Utils.calculateBackoff(50, MAXIMUM_BACKOFF_INTERVAL,
                                                Status.backoffInterval);
 
   do_check_eq(backoffInterval, MAXIMUM_BACKOFF_INTERVAL);
 
-  // Test Status.backoffInterval is used if it is 
+  // Test Status.backoffInterval is used if it is
   // larger than MAXIMUM_BACKOFF_INTERVAL.
   Status.backoffInterval = MAXIMUM_BACKOFF_INTERVAL + 10;
   backoffInterval = Utils.calculateBackoff(50, MAXIMUM_BACKOFF_INTERVAL,
                                            Status.backoffInterval);
-  
+
   do_check_eq(backoffInterval, MAXIMUM_BACKOFF_INTERVAL + 10);
 
   cleanUpAndGo();
 });
 
 add_test(function test_scheduleNextSync_nowOrPast() {
   Svc.Obs.add("weave:service:sync:finish", function onSyncFinish() {
     Svc.Obs.remove("weave:service:sync:finish", onSyncFinish);
@@ -341,17 +341,17 @@ add_test(function test_scheduleNextSync_
   do_check_eq(scheduler.syncTimer.delay, Status.backoffInterval);
 
   cleanUpAndGo();
 });
 
 add_test(function test_handleSyncError() {
   let server = sync_httpd_setup();
   setUp();
- 
+
   // Force sync to fail.
   Svc.Prefs.set("firstSync", "notReady");
 
   _("Ensure expected initial environment.");
   do_check_eq(scheduler._syncErrors, 0);
   do_check_false(Status.enforceBackoff);
   do_check_eq(scheduler.syncInterval, scheduler.singleDeviceInterval);
   do_check_eq(Status.backoffInterval, 0);
@@ -416,17 +416,17 @@ add_test(function test_client_sync_finis
   scheduler.updateClientMode();
   Service.sync();
 
   do_check_eq(scheduler.syncThreshold, MULTI_DEVICE_THRESHOLD);
   do_check_eq(scheduler.syncInterval, scheduler.activeInterval);
   do_check_true(scheduler.numClients > 1);
   do_check_false(scheduler.idle);
 
-  // Resets the number of clients to 0. 
+  // Resets the number of clients to 0.
   clientsEngine.resetClient();
   Service.sync();
 
   // Goes back to single user if # clients is 1.
   do_check_eq(scheduler.numClients, 1);
   do_check_eq(scheduler.syncThreshold, SINGLE_USER_THRESHOLD);
   do_check_eq(scheduler.syncInterval, scheduler.singleDeviceInterval);
   do_check_false(scheduler.numClients > 1);
--- a/services/sync/tests/unit/test_syncstoragerequest.js
+++ b/services/sync/tests/unit/test_syncstoragerequest.js
@@ -98,17 +98,17 @@ add_test(function test_weave_timestamp()
  */
 add_test(function test_weave_backoff() {
   function handler(request, response) {
     response.setHeader("X-Weave-Backoff", '600', false);
     response.setStatusLine(request.httpVersion, 200, "OK");
   }
   let server = httpd_setup({"/resource": handler});
 
-  let backoffInterval;  
+  let backoffInterval;
   Svc.Obs.add("weave:service:backoff:interval", function onBackoff(subject) {
     Svc.Obs.remove("weave:service:backoff:interval", onBackoff);
     backoffInterval = subject;
   });
 
   let request = new SyncStorageRequest(STORAGE_REQUEST_RESOURCE_URL);
   request.get(function (error) {
     do_check_eq(error, null);
--- a/services/sync/tests/unit/test_tab_engine.js
+++ b/services/sync/tests/unit/test_tab_engine.js
@@ -35,17 +35,17 @@ function run_test() {
 
   _("test locallyOpenTabMatchesURL");
   let engine = new TabEngine(Service);
 
   // 3 tabs
   fakeSessionSvc("http://bar.com", "http://foo.com", "http://foobar.com");
 
   let matches;
- 
+
   _("  test matching works (true)");
   matches = engine.locallyOpenTabMatchesURL("http://foo.com");
   do_check_true(matches);
 
   _("  test matching works (false)");
   matches = engine.locallyOpenTabMatchesURL("http://barfoo.com");
   do_check_false(matches);
 }
--- a/services/sync/tests/unit/test_utils_catch.js
+++ b/services/sync/tests/unit/test_utils_catch.js
@@ -21,25 +21,25 @@ function run_test() {
       return 5;
     })(),
 
     throwy: function() this.catch(function() {
       rightThis = this == obj;
       didCall = true;
       throw 10;
     })(),
-    
+
     callbacky: function() this.catch(function() {
       rightThis = this == obj;
       didCall = true;
       throw 10;
     }, function(ex) {
       wasTen = (ex == 10)
     })(),
-    
+
     lockedy: function() this.catch(function() {
       rightThis = this == obj;
       didCall = true;
       throw("Could not acquire lock.");
     })()
   };
 
   _("Make sure a normal call will call and return");
@@ -56,27 +56,27 @@ function run_test() {
   rightThis = didCall = didThrow = wasLocked = false;
   ret = obj.throwy();
   do_check_eq(ret, undefined);
   do_check_true(rightThis);
   do_check_true(didCall);
   do_check_true(didThrow);
   do_check_eq(wasTen, undefined);
   do_check_false(wasLocked);
-  
+
   _("Test callback for exception testing.");
   rightThis = didCall = didThrow = wasLocked = false;
   ret = obj.callbacky();
   do_check_eq(ret, undefined);
   do_check_true(rightThis);
   do_check_true(didCall);
   do_check_true(didThrow);
   do_check_true(wasTen);
   do_check_false(wasLocked);
-  
+
   _("Test the lock-aware catch that Service uses.");
   obj.catch = Service._catch;
   rightThis = didCall = didThrow = wasLocked = false;
   wasTen = undefined;
   ret = obj.lockedy();
   do_check_eq(ret, undefined);
   do_check_true(rightThis);
   do_check_true(didCall);
--- a/services/sync/tests/unit/test_utils_deriveKey.js
+++ b/services/sync/tests/unit/test_utils_deriveKey.js
@@ -9,50 +9,50 @@ function run_test() {
     gczeal(2);
   } else {
     _("Running deriveKey tests with default gczeal.");
   }
 
   var iv = cryptoSvc.generateRandomIV();
   var der_passphrase = "secret phrase";
   var der_salt = "RE5YUHpQcGl3bg==";   // btoa("DNXPzPpiwn")
-  
+
   _("Testing deriveKeyFromPassphrase. Input is \"" + der_passphrase + "\", \"" + der_salt + "\" (base64-encoded).");
-  
+
   // Test friendly-ing.
   do_check_eq("abcdefghijk8mn9pqrstuvwxyz234567",
               Utils.base32ToFriendly("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"));
   do_check_eq("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",
               Utils.base32FromFriendly(
                 Utils.base32ToFriendly("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567")));
-  
+
   // Test translation.
   do_check_false(Utils.isPassphrase("o-5wmnu-o5tqc-7lz2h-amkbw-izqzi"));  // Wrong charset.
   do_check_false(Utils.isPassphrase("O-5WMNU-O5TQC-7LZ2H-AMKBW-IZQZI"));  // Wrong charset.
   do_check_true(Utils.isPassphrase("9-5wmnu-95tqc-78z2h-amkbw-izqzi"));
   do_check_true(Utils.isPassphrase("9-5WMNU-95TQC-78Z2H-AMKBW-IZQZI"));   // isPassphrase normalizes.
   do_check_true(Utils.isPassphrase(
       Utils.normalizePassphrase("9-5WMNU-95TQC-78Z2H-AMKBW-IZQZI")));
-    
+
   // Base64. We don't actually use this in anger, particularly not with a 32-byte key.
   var der_key = Utils.deriveEncodedKeyFromPassphrase(der_passphrase, der_salt);
   _("Derived key in base64: " + der_key);
   do_check_eq(cryptoSvc.decrypt(cryptoSvc.encrypt("bacon", der_key, iv), der_key, iv), "bacon");
-  
+
   // Base64, 16-byte output.
   var der_key = Utils.deriveEncodedKeyFromPassphrase(der_passphrase, der_salt, 16);
   _("Derived key in base64: " + der_key);
   do_check_eq("d2zG0d2cBfXnRwMUGyMwyg==", der_key);
   do_check_eq(cryptoSvc.decrypt(cryptoSvc.encrypt("bacon", der_key, iv), der_key, iv), "bacon");
 
   // Base32. Again, specify '16' to avoid it generating a 256-bit key string.
   var b32key = Utils.derivePresentableKeyFromPassphrase(der_passphrase, der_salt, 16);
   var hyphenated = Utils.hyphenatePassphrase(b32key);
   do_check_true(Utils.isPassphrase(b32key));
-  
+
   _("Derived key in base32: " + b32key);
   do_check_eq(b32key.length, 26);
   do_check_eq(hyphenated.length, 31);  // 1 char, plus 5 groups of 5, hyphenated = 5 + (5*5) + 1 = 31.
   do_check_eq(hyphenated, "9-5wmnu-95tqc-78z2h-amkbw-izqzi");
 
   if (this.gczeal)
     gczeal(0);
 
--- a/services/sync/tests/unit/test_utils_getErrorString.js
+++ b/services/sync/tests/unit/test_utils_getErrorString.js
@@ -1,14 +1,14 @@
 Cu.import("resource://services-sync/util.js");
 
 function run_test() {
   let str;
 
   // we just test whether the returned string includes the
   // string "unknown", should be good enough
- 
+
   str = Utils.getErrorString("error.login.reason.account");
   do_check_true(str.match(/unknown/i) == null);
 
   str = Utils.getErrorString("foobar");
   do_check_true(str.match(/unknown/i) != null);
 }
--- a/services/sync/tests/unit/test_utils_passphrase.js
+++ b/services/sync/tests/unit/test_utils_passphrase.js
@@ -26,17 +26,17 @@ function run_test() {
   _("Arbitrary hyphenation.");
   // We don't allow invalid characters for our base32 character set.
   do_check_eq(Utils.hyphenatePassphrase("1234567"), "2-34567");  // Not partial, so no trailing dash.
   do_check_eq(Utils.hyphenatePassphrase("1234567890"), "2-34567-89");
   do_check_eq(Utils.hyphenatePassphrase("abcdeabcdeabcdeabcdeabcde"), "a-bcdea-bcdea-bcdea-bcdea-bcde");
   do_check_eq(Utils.hyphenatePartialPassphrase("1234567"), "2-34567-");
   do_check_eq(Utils.hyphenatePartialPassphrase("1234567890"), "2-34567-89");
   do_check_eq(Utils.hyphenatePartialPassphrase("abcdeabcdeabcdeabcdeabcde"), "a-bcdea-bcdea-bcdea-bcdea-bcde");
-  
+
   do_check_eq(Utils.hyphenatePartialPassphrase("a"), "a-");
   do_check_eq(Utils.hyphenatePartialPassphrase("1234567"), "2-34567-");
   do_check_eq(Utils.hyphenatePartialPassphrase("a-bcdef-g"),
               "a-bcdef-g");
   do_check_eq(Utils.hyphenatePartialPassphrase("abcdefghijklmnop"),
               "a-bcdef-ghijk-mnp");
   do_check_eq(Utils.hyphenatePartialPassphrase("abcdefghijklmnopabcde"),
               "a-bcdef-ghijk-mnpab-cde");
@@ -49,20 +49,20 @@ function run_test() {
   do_check_eq(Utils.normalizePassphrase(hyphenated), pp);
 
   _("Skip whitespace.");
   do_check_eq("aaaaaaaaaaaaaaaaaaaaaaaaaa", Utils.normalizePassphrase("aaaaaaaaaaaaaaaaaaaaaaaaaa  "));
   do_check_eq("aaaaaaaaaaaaaaaaaaaaaaaaaa", Utils.normalizePassphrase("	 aaaaaaaaaaaaaaaaaaaaaaaaaa"));
   do_check_eq("aaaaaaaaaaaaaaaaaaaaaaaaaa", Utils.normalizePassphrase("    aaaaaaaaaaaaaaaaaaaaaaaaaa  "));
   do_check_eq("aaaaaaaaaaaaaaaaaaaaaaaaaa", Utils.normalizePassphrase("    a-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa  "));
   do_check_true(Utils.isPassphrase("aaaaaaaaaaaaaaaaaaaaaaaaaa  "));
-  do_check_true(Utils.isPassphrase("	 aaaaaaaaaaaaaaaaaaaaaaaaaa"));          
-  do_check_true(Utils.isPassphrase("    aaaaaaaaaaaaaaaaaaaaaaaaaa  "));       
-  do_check_true(Utils.isPassphrase("    a-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa  "));  
-  do_check_false(Utils.isPassphrase("    -aaaaa-aaaaa-aaaaa-aaaaa-aaaaa  "));  
+  do_check_true(Utils.isPassphrase("	 aaaaaaaaaaaaaaaaaaaaaaaaaa"));
+  do_check_true(Utils.isPassphrase("    aaaaaaaaaaaaaaaaaaaaaaaaaa  "));
+  do_check_true(Utils.isPassphrase("    a-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa  "));
+  do_check_false(Utils.isPassphrase("    -aaaaa-aaaaa-aaaaa-aaaaa-aaaaa  "));
 
   _("Normalizing 20-char passphrases.");
   do_check_eq(Utils.normalizePassphrase("abcde-abcde-abcde-abcde"),
               "abcdeabcdeabcdeabcde");
   do_check_eq(Utils.normalizePassphrase("a-bcde-abcde-abcde-abcde"),
               "a-bcde-abcde-abcde-abcde");
   do_check_eq(Utils.normalizePassphrase(" abcde-abcde-abcde-abcde "),
               "abcdeabcdeabcdeabcde");