Bug 1386684 - Enable ESLint for toolkit/components/url-classifier (automatic fixes). r=hchang
authorDan Banner <dbugs@thebanners.uk>
Wed, 02 Aug 2017 16:12:07 +0100
changeset 373510 4148c51d43fa084fb272b7621d96bbe7d6d4e012
parent 373509 cb33a188655b840e499497e617cfe05085a5c382
child 373511 ff12e5530767f171d128a910914a15f9271f7bdf
push id32303
push usercbook@mozilla.com
push dateWed, 09 Aug 2017 09:34:07 +0000
treeherdermozilla-central@c93fa2271ee7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershchang
bugs1386684
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1386684 - Enable ESLint for toolkit/components/url-classifier (automatic fixes). r=hchang MozReview-Commit-ID: F0Z8dRaYOku
.eslintignore
toolkit/components/url-classifier/SafeBrowsing.jsm
toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
toolkit/components/url-classifier/nsUrlClassifierLib.js
toolkit/components/url-classifier/nsUrlClassifierListManager.js
toolkit/components/url-classifier/tests/UrlClassifierTestUtils.jsm
toolkit/components/url-classifier/tests/browser/classifierHelper.js
toolkit/components/url-classifier/tests/browser/classifierTester.js
toolkit/components/url-classifier/tests/mochitest/allowlistAnnotatedFrame.html
toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html
toolkit/components/url-classifier/tests/mochitest/classifierCommon.js
toolkit/components/url-classifier/tests/mochitest/classifierFrame.html
toolkit/components/url-classifier/tests/mochitest/classifierHelper.js
toolkit/components/url-classifier/tests/mochitest/cleanWorker.js
toolkit/components/url-classifier/tests/mochitest/dnt.html
toolkit/components/url-classifier/tests/mochitest/test_advisory_link.html
toolkit/components/url-classifier/tests/mochitest/test_allowlisted_annotations.html
toolkit/components/url-classifier/tests/mochitest/test_bug1254766.html
toolkit/components/url-classifier/tests/mochitest/test_cachemiss.html
toolkit/components/url-classifier/tests/mochitest/test_classified_annotations.html
toolkit/components/url-classifier/tests/mochitest/test_classifier.html
toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html
toolkit/components/url-classifier/tests/mochitest/test_classifier_match.html
toolkit/components/url-classifier/tests/mochitest/test_classifier_worker.html
toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html
toolkit/components/url-classifier/tests/mochitest/test_donottrack.html
toolkit/components/url-classifier/tests/mochitest/test_gethash.html
toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
toolkit/components/url-classifier/tests/mochitest/test_reporturl.html
toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1157081.html
toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1312515.html
toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html
toolkit/components/url-classifier/tests/mochitest/tracker.js
toolkit/components/url-classifier/tests/mochitest/trackingRequest.js
toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
toolkit/components/url-classifier/tests/unit/test_addsub.js
toolkit/components/url-classifier/tests/unit/test_bug1274685_unowned_list.js
toolkit/components/url-classifier/tests/unit/test_dbservice.js
toolkit/components/url-classifier/tests/unit/test_hashcompleter.js
toolkit/components/url-classifier/tests/unit/test_listmanager.js
toolkit/components/url-classifier/tests/unit/test_partial.js
toolkit/components/url-classifier/tests/unit/test_pref.js
toolkit/components/url-classifier/tests/unit/test_prefixset.js
toolkit/components/url-classifier/tests/unit/test_safebrowsing_protobuf.js
toolkit/components/url-classifier/tests/unit/test_streamupdater.js
toolkit/components/url-classifier/tests/unit/test_threat_type_conversion.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -335,19 +335,16 @@ services/sync/tps/extensions/mozmill
 toolkit/components/help/**
 
 # Intentionally invalid JS
 toolkit/components/workerloader/tests/moduleF-syntax-error.js
 
 # Tests old non-star function generators
 toolkit/modules/tests/xpcshell/test_task.js
 
-# Not yet updated
-toolkit/components/url-classifier/**
-
 # External code:
 toolkit/components/microformats/test/**
 toolkit/components/microformats/microformat-shiv.js
 toolkit/components/reader/Readability.js
 toolkit/components/reader/JSDOMParser.js
 
 # Uses preprocessing
 toolkit/content/widgets/wizard.xml
--- a/toolkit/components/url-classifier/SafeBrowsing.jsm
+++ b/toolkit/components/url-classifier/SafeBrowsing.jsm
@@ -50,17 +50,17 @@ const tablePreferences = [
   "urlclassifier.flashExceptTable",
   "urlclassifier.flashSubDocTable",
   "urlclassifier.flashSubDocExceptTable",
   "urlclassifier.flashInfobarTable"
 ];
 
 this.SafeBrowsing = {
 
-  init: function() {
+  init() {
     if (this.initialized) {
       log("Already initialized");
       return;
     }
 
     Services.prefs.addObserver("browser.safebrowsing", this);
     Services.prefs.addObserver("privacy.trackingprotection", this);
     Services.prefs.addObserver("urlclassifier", this);
@@ -70,17 +70,17 @@ this.SafeBrowsing = {
     this.addMozEntries();
 
     this.controlUpdateChecking();
     this.initialized = true;
 
     log("init() finished");
   },
 
-  registerTableWithURLs: function(listname) {
+  registerTableWithURLs(listname) {
     let listManager = Cc["@mozilla.org/url-classifier/listmanager;1"].
       getService(Ci.nsIUrlListManager);
 
     let providerName = this.listToProvider[listname];
     let provider = this.providers[providerName];
 
     if (!providerName || !provider) {
       log("No provider info found for " + listname);
@@ -91,17 +91,17 @@ this.SafeBrowsing = {
     if (!provider.updateURL) {
       log("Invalid update url " + listname);
       return;
     }
 
     listManager.registerTable(listname, providerName, provider.updateURL, provider.gethashURL);
   },
 
-  registerTables: function() {
+  registerTables() {
     for (let i = 0; i < this.phishingLists.length; ++i) {
       this.registerTableWithURLs(this.phishingLists[i]);
     }
     for (let i = 0; i < this.malwareLists.length; ++i) {
       this.registerTableWithURLs(this.malwareLists[i]);
     }
     for (let i = 0; i < this.downloadBlockLists.length; ++i) {
       this.registerTableWithURLs(this.downloadBlockLists[i]);
@@ -146,17 +146,17 @@ this.SafeBrowsing = {
   flashLists:                   [],
   flashInfobarLists:            [],
 
   updateURL:             null,
   gethashURL:            null,
 
   reportURL:             null,
 
-  getReportURL: function(kind, info) {
+  getReportURL(kind, info) {
     let pref;
     switch (kind) {
       case "Phish":
         pref = "browser.safebrowsing.reportPhishURL";
         break;
 
       case "PhishMistake":
       case "MalwareMistake":
@@ -182,31 +182,31 @@ this.SafeBrowsing = {
     }
 
     if (reportUrl) {
       reportUrl += encodeURIComponent(info.uri);
     }
     return reportUrl;
   },
 
-  observe: function(aSubject, aTopic, aData) {
+  observe(aSubject, aTopic, aData) {
     // skip nextupdatetime and lastupdatetime
     if (aData.indexOf("lastupdatetime") >= 0 || aData.indexOf("nextupdatetime") >= 0) {
       return;
     }
 
     if (aData == PREF_DEBUG_ENABLED) {
       loggingEnabled = Services.prefs.getBoolPref(PREF_DEBUG_ENABLED);
       return;
     }
 
     this.readPrefs();
   },
 
-  readPrefs: function() {
+  readPrefs() {
     loggingEnabled = Services.prefs.getBoolPref(PREF_DEBUG_ENABLED);
     log("reading prefs");
 
     this.phishingEnabled = Services.prefs.getBoolPref("browser.safebrowsing.phishing.enabled");
     this.malwareEnabled = Services.prefs.getBoolPref("browser.safebrowsing.malware.enabled");
     this.trackingEnabled = Services.prefs.getBoolPref("privacy.trackingprotection.enabled") || Services.prefs.getBoolPref("privacy.trackingprotection.pbmode.enabled");
     this.blockedEnabled = Services.prefs.getBoolPref("browser.safebrowsing.blockedURIs.enabled");
     this.trackingAnnotations = Services.prefs.getBoolPref("privacy.trackingprotection.annotate_channels");
@@ -244,20 +244,20 @@ this.SafeBrowsing = {
     // lists are registered. So only call it here when a pref changes, and not
     // when doing initialization. I expect to refactor this later, so pardon the hack.
     if (this.initialized) {
       this.controlUpdateChecking();
     }
   },
 
 
-  updateProviderURLs: function() {
+  updateProviderURLs() {
     try {
       var clientID = Services.prefs.getCharPref("browser.safebrowsing.id");
-    } catch(e) {
+    } catch (e) {
       clientID = Services.appinfo.name;
     }
 
     log("initializing safe browsing URLs, client id", clientID);
 
     // Get the different providers
     let branch = Services.prefs.getBranch("browser.safebrowsing.provider.");
     let children = branch.getChildList("", {});
@@ -290,18 +290,18 @@ this.SafeBrowsing = {
         "browser.safebrowsing.provider." + provider + ".gethashURL");
       updateURL = updateURL.replace("SAFEBROWSING_ID", clientID);
       gethashURL = gethashURL.replace("SAFEBROWSING_ID", clientID);
 
       // Disable updates and gethash if the Google API key is missing.
       let googleKey = Services.urlFormatter.formatURL("%GOOGLE_API_KEY%").trim();
       if ((provider == "google" || provider == "google4") &&
           (!googleKey || googleKey == "no-google-api-key")) {
-        updateURL= "";
-        gethashURL= "";
+        updateURL = "";
+        gethashURL = "";
       }
 
       log("Provider: " + provider + " updateURL=" + updateURL);
       log("Provider: " + provider + " gethashURL=" + gethashURL);
 
       // Urls used to update DB
       this.providers[provider].updateURL  = updateURL;
       this.providers[provider].gethashURL = gethashURL;
@@ -313,17 +313,17 @@ this.SafeBrowsing = {
           this.listToProvider[list] = provider;
         }, this);
       } else {
         log("Update URL given but no lists managed for provider: " + provider);
       }
     }, this);
   },
 
-  controlUpdateChecking: function() {
+  controlUpdateChecking() {
     log("phishingEnabled:", this.phishingEnabled, "malwareEnabled:",
         this.malwareEnabled, "trackingEnabled:", this.trackingEnabled,
         "blockedEnabled:", this.blockedEnabled, "trackingAnnotations",
         this.trackingAnnotations, "flashBlockEnabled", this.flashBlockEnabled,
         "flashInfobarListEnabled:", this.flashInfobarListEnabled);
 
     let listManager = Cc["@mozilla.org/url-classifier/listmanager;1"].
                       getService(Ci.nsIUrlListManager);
@@ -390,17 +390,17 @@ this.SafeBrowsing = {
       } else {
         listManager.disableUpdate(this.flashInfobarLists[i]);
       }
     }
     listManager.maybeToggleUpdateChecking();
   },
 
 
-  addMozEntries: function() {
+  addMozEntries() {
     // Add test entries to the DB.
     // XXX bug 779008 - this could be done by DB itself?
     const phishURL    = "itisatrap.org/firefox/its-a-trap.html";
     const malwareURL  = "itisatrap.org/firefox/its-an-attack.html";
     const unwantedURL = "itisatrap.org/firefox/unwanted.html";
     const harmfulURL  = "itisatrap.org/firefox/harmful.html";
     const trackerURLs = [
       "trackertest.org/",
@@ -409,17 +409,17 @@ this.SafeBrowsing = {
     const whitelistURL  = "itisatrap.org/?resource=itisatracker.org";
     const blockedURL    = "itisatrap.org/firefox/blocked.html";
 
     let update = "n:1000\ni:test-malware-simple\nad:1\n" +
                  "a:1:32:" + malwareURL.length + "\n" +
                  malwareURL + "\n";
     update += "n:1000\ni:test-phish-simple\nad:1\n" +
               "a:1:32:" + phishURL.length + "\n" +
-              phishURL  + "\n";
+              phishURL + "\n";
     update += "n:1000\ni:test-unwanted-simple\nad:1\n" +
               "a:1:32:" + unwantedURL.length + "\n" +
               unwantedURL + "\n";
     update += "n:1000\ni:test-harmful-simple\nad:1\n" +
               "a:1:32:" + harmfulURL.length + "\n" +
               harmfulURL + "\n";
     update += "n:1000\ni:test-track-simple\n" +
               "ad:" + trackerURLs.length + "\n";
@@ -435,36 +435,36 @@ this.SafeBrowsing = {
               blockedURL;
     log("addMozEntries:", update);
 
     let db = Cc["@mozilla.org/url-classifier/dbservice;1"].
              getService(Ci.nsIUrlClassifierDBService);
 
     // nsIUrlClassifierUpdateObserver
     let dummyListener = {
-      updateUrlRequested: function() { },
-      streamFinished:     function() { },
+      updateUrlRequested() { },
+      streamFinished() { },
       // We notify observers when we're done in order to be able to make perf
       // test results more consistent
-      updateError:        function() {
+      updateError() {
         Services.obs.notifyObservers(db, "mozentries-update-finished", "error");
       },
-      updateSuccess:      function() {
+      updateSuccess() {
         Services.obs.notifyObservers(db, "mozentries-update-finished", "success");
       }
     };
 
     try {
       let tables = "test-malware-simple,test-phish-simple,test-unwanted-simple,test-harmful-simple,test-track-simple,test-trackwhite-simple,test-block-simple";
       db.beginUpdate(dummyListener, tables, "");
       db.beginStream("", "");
       db.updateStream(update);
       db.finishStream();
       db.finishUpdate();
-    } catch(ex) {
+    } catch (ex) {
       // beginUpdate will throw harmlessly if there's an existing update in progress, ignore failures.
       log("addMozEntries failed!", ex);
       Services.obs.notifyObservers(db, "mozentries-update-finished", "exception");
     }
   },
 
   addMozEntriesFinishedPromise: new Promise(resolve => {
     let finished = (subject, topic, data) => {
--- a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
+++ b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
@@ -16,23 +16,23 @@ const PARTIAL_LENGTH = 4;
 // Upper limit on the server response minimumWaitDuration
 const MIN_WAIT_DURATION_MAX_VALUE = 24 * 60 * 60 * 1000;
 const PREF_DEBUG_ENABLED = "browser.safebrowsing.debug";
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
 
-XPCOMUtils.defineLazyServiceGetter(this, 'gDbService',
-                                   '@mozilla.org/url-classifier/dbservice;1',
-                                   'nsIUrlClassifierDBService');
+XPCOMUtils.defineLazyServiceGetter(this, "gDbService",
+                                   "@mozilla.org/url-classifier/dbservice;1",
+                                   "nsIUrlClassifierDBService");
 
-XPCOMUtils.defineLazyServiceGetter(this, 'gUrlUtil',
-                                   '@mozilla.org/url-classifier/utils;1',
-                                   'nsIUrlClassifierUtils');
+XPCOMUtils.defineLazyServiceGetter(this, "gUrlUtil",
+                                   "@mozilla.org/url-classifier/utils;1",
+                                   "nsIUrlClassifierUtils");
 
 let loggingEnabled = false;
 
 // Log only if browser.safebrowsing.debug is true
 function log(...stuff) {
   if (!loggingEnabled) {
     return;
   }
@@ -142,32 +142,32 @@ function httpStatusToBucket(httpStatus) 
     break;
   case 505:
     // HTTP Version Not Supported - The server CANNOT handle the requested
     // protocol major version.
     statusBucket = 14;
     break;
   default:
     statusBucket = 15;
-  };
+  }
   return statusBucket;
 }
 
 function FullHashMatch(table, hash, duration) {
   this.tableName = table;
   this.fullHash = hash;
   this.cacheDuration = duration;
 }
 
 FullHashMatch.prototype = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIFullHashMatch]),
 
-  tableName : null,
-  fullHash : null,
-  cacheDuration : null,
+  tableName: null,
+  fullHash: null,
+  cacheDuration: null,
 };
 
 function HashCompleter() {
   // The current HashCompleterRequest in flight. Once it is started, it is set
   // to null. It may be used by multiple calls to |complete| in succession to
   // avoid creating multiple requests to the same gethash URL.
   this._currentRequest = null;
   // A map of gethashUrls to HashCompleterRequests that haven't yet begun.
@@ -235,17 +235,17 @@ HashCompleter.prototype = {
     // Start off this request. Without dispatching to a thread, every call to
     // complete makes an individual HTTP request.
     Services.tm.dispatchToMainThread(this);
   },
 
   // This is called after several calls to |complete|, or after the
   // currentRequest has finished.  It starts off the HTTP request by making a
   // |begin| call to the HashCompleterRequest.
-  run: function() {
+  run() {
     // Clear everything on shutdown
     if (this._shuttingDown) {
       this._currentRequest = null;
       this._pendingRequests = null;
       this._nextGethashTimeMs = null;
 
       for (var url in this._backoffs) {
         this._backoffs[url] = null;
@@ -268,31 +268,31 @@ HashCompleter.prototype = {
         // If |begin| fails, we should get rid of our request.
         this._currentRequest = null;
       }
     }
   },
 
   // Pass the server response status to the RequestBackoff for the given
   // gethashUrl and fetch the next pending request, if there is one.
-  finishRequest: function(url, aStatus) {
+  finishRequest(url, aStatus) {
     this._backoffs[url].noteServerResponse(aStatus);
     Services.tm.dispatchToMainThread(this);
   },
 
   // Returns true if we can make a request from the given url, false otherwise.
-  canMakeRequest: function(aGethashUrl) {
+  canMakeRequest(aGethashUrl) {
     return this._backoffs[aGethashUrl].canMakeRequest() &&
            Date.now() >= this._nextGethashTimeMs[aGethashUrl];
   },
 
   // Notifies the RequestBackoff of a new request so we can throttle based on
   // max requests/time period. This must be called before a channel is opened,
   // and finishRequest must be called once the response is received.
-  noteRequest: function(aGethashUrl) {
+  noteRequest(aGethashUrl) {
     return this._backoffs[aGethashUrl].noteRequest();
   },
 
   observe: function HC_observe(aSubject, aTopic, aData) {
     switch (aTopic) {
     case "quit-application":
       this._shuttingDown = true;
       Services.obs.removeObserver(this, "quit-application");
@@ -334,27 +334,27 @@ HashCompleterRequest.prototype = {
 
   // This is called by the HashCompleter to add a hash and callback to the
   // HashCompleterRequest. It must be called before calling |begin|.
   add: function HCR_add(aPartialHash, aCallback, aTableName) {
     this._requests.push({
       partialHash: aPartialHash,
       callback: aCallback,
       tableName: aTableName,
-      response: { matches:[] },
+      response: { matches: [] },
     });
 
     if (aTableName) {
-      let isTableNameV4 = aTableName.endsWith('-proto');
+      let isTableNameV4 = aTableName.endsWith("-proto");
       if (0 === this.tableNames.size) {
         // Decide if this request is v4 by the first added partial hash.
         this.isV4 = isTableNameV4;
       } else if (this.isV4 !== isTableNameV4) {
         log('ERROR: Cannot mix "proto" tables with other types within ' +
-            'the same gethash URL.');
+            "the same gethash URL.");
       }
       this.tableNames.set(aTableName);
 
       // Assuming all tables with the same gethash URL have the same provider
       if (this.telemetryProvider == "") {
         this.telemetryProvider = gUrlUtil.getTelemetryProvider(aTableName);
       }
     }
@@ -398,18 +398,17 @@ HashCompleterRequest.prototype = {
     // Note that |HCR_begin| is fine to be sync because
     // it doesn't appear in a sync call chain.
     this.fillTableStatesBase64(() => {
       try {
         this.openChannel();
         // Notify the RequestBackoff if opening the channel succeeded. At this
         // point, finishRequest must be called.
         this._completer.noteRequest(this.gethashUrl);
-      }
-      catch (err) {
+      } catch (err) {
         this.notifyFailure(err);
         throw err;
       }
     });
   },
 
   notify: function HCR_notify() {
     // If we haven't gotten onStopRequest, just cancel. This will call us
@@ -485,18 +484,18 @@ HashCompleterRequest.prototype = {
 
     // Build the "distinct" prefix array.
     // The array is sorted to make sure the entries are arbitrary mixed in a
     // deterministic way
     let prefixSet = new Set();
     this._requests.forEach(r => prefixSet.add(btoa(r.partialHash)));
     let prefixArray = Array.from(prefixSet).sort();
 
-    log("Build v4 gethash request with " + JSON.stringify(tableNameArray) + ', '
-                                         + JSON.stringify(stateArray) + ', '
+    log("Build v4 gethash request with " + JSON.stringify(tableNameArray) + ", "
+                                         + JSON.stringify(stateArray) + ", "
                                          + JSON.stringify(prefixArray));
 
     return gUrlUtil.makeFindFullHashRequestV4(tableNameArray,
                                               stateArray,
                                               prefixArray,
                                               tableNameArray.length,
                                               prefixArray.length);
   },
@@ -517,17 +516,17 @@ HashCompleterRequest.prototype = {
 
     // Sort to make sure the entries are arbitrary mixed in a deterministic way
     prefixes.sort();
 
     let body;
     body = PARTIAL_LENGTH + ":" + (PARTIAL_LENGTH * prefixes.length) +
            "\n" + prefixes.join("");
 
-    log('Requesting completions for ' + prefixes.length + ' ' + PARTIAL_LENGTH + '-byte prefixes: ' + body);
+    log("Requesting completions for " + prefixes.length + " " + PARTIAL_LENGTH + "-byte prefixes: " + body);
     return body;
   },
 
   // Sets the request body of this._channel.
   addRequestBody: function HCR_addRequestBody(aBody) {
     let inputStream = Cc["@mozilla.org/io/string-input-stream;1"].
                       createInstance(Ci.nsIStringInputStream);
 
@@ -558,19 +557,19 @@ HashCompleterRequest.prototype = {
       start = this.handleTable(start);
     }
   },
 
   handleResponseV4: function HCR_handleResponseV4() {
     let callback = {
       // onCompleteHashFound will be called for each fullhash found in
       // FullHashResponse.
-      onCompleteHashFound : (aCompleteHash,
-                             aTableNames,
-                             aPerHashCacheDuration) => {
+      onCompleteHashFound: (aCompleteHash,
+                            aTableNames,
+                            aPerHashCacheDuration) => {
         log("V4 fullhash response complete hash found callback: " +
             JSON.stringify(aCompleteHash) + ", " +
             aTableNames + ", CacheDuration(" + aPerHashCacheDuration + ")");
 
         // Filter table names which we didn't requested.
         let filteredTables = aTableNames.split(",").filter(name => {
           return this.tableNames.get(name);
         });
@@ -587,18 +586,18 @@ HashCompleterRequest.prototype = {
           tableName: filteredTables[0],
           cacheDuration: aPerHashCacheDuration
         });
       },
 
       // onResponseParsed will be called no matter if there is match in
       // FullHashResponse, the callback is mainly used to pass negative cache
       // duration and minimum wait duration.
-      onResponseParsed : (aMinWaitDuration,
-                          aNegCacheDuration) => {
+      onResponseParsed: (aMinWaitDuration,
+                        aNegCacheDuration) => {
         log("V4 fullhash response parsed callback: " +
             "MinWaitDuration(" + aMinWaitDuration + "), " +
             "NegativeCacheDuration(" + aNegCacheDuration + ")");
 
         let minWaitDuration = aMinWaitDuration;
 
         if (aMinWaitDuration > MIN_WAIT_DURATION_MAX_VALUE) {
           log("WARNING: Minimum wait duration too large, clamping it down " +
@@ -639,17 +638,17 @@ HashCompleterRequest.prototype = {
     if (entries.length != 3) {
       throw errorWithStack();
     }
 
     let list = entries[0];
     let addChunk = parseInt(entries[1]);
     let dataLength = parseInt(entries[2]);
 
-    log('Response includes add chunks for ' + list + ': ' + addChunk);
+    log("Response includes add chunks for " + list + ": " + addChunk);
     if (dataLength % COMPLETE_LENGTH != 0 ||
         dataLength == 0 ||
         dataLength > body.length - (newlineIndex + 1)) {
       throw errorWithStack();
     }
 
     let data = body.substr(newlineIndex + 1, dataLength);
     for (let i = 0; i < (dataLength / COMPLETE_LENGTH); i++) {
@@ -756,17 +755,17 @@ HashCompleterRequest.prototype = {
       let channel = aRequest.QueryInterface(Ci.nsIHttpChannel);
       let success = channel.requestSucceeded;
       httpStatus = channel.responseStatus;
       if (!success) {
         aStatusCode = Cr.NS_ERROR_ABORT;
       }
     }
     let success = Components.isSuccessCode(aStatusCode);
-    log('Received a ' + httpStatus + ' status code from the gethash server (success=' + success + ').');
+    log("Received a " + httpStatus + " status code from the gethash server (success=" + success + ").");
 
     Services.telemetry.getKeyedHistogramById("URLCLASSIFIER_COMPLETE_REMOTE_STATUS2").
       add(this.telemetryProvider, httpStatusToBucket(httpStatus));
     if (httpStatus == 400) {
       dump("Safe Browsing server returned a 400 during completion: request= " +
            this.actualGethashUrl + "\n");
     }
 
@@ -774,18 +773,17 @@ HashCompleterRequest.prototype = {
       add(this.telemetryProvider, 0);
 
     // Notify the RequestBackoff once a response is received.
     this._completer.finishRequest(this.gethashUrl, httpStatus);
 
     if (success) {
       try {
         this.handleResponse();
-      }
-      catch (err) {
+      } catch (err) {
         log(err.stack);
         aStatusCode = err.value;
         success = false;
       }
     }
 
     if (success) {
       this.notifySuccess();
--- a/toolkit/components/url-classifier/nsUrlClassifierLib.js
+++ b/toolkit/components/url-classifier/nsUrlClassifierLib.js
@@ -54,17 +54,17 @@ this.BindToObject = function BindToObjec
   return newfn;
 }
 
 // This implements logic for stopping requests if the server starts to return
 // too many errors.  If we get MAX_ERRORS errors in ERROR_PERIOD minutes, we
 // back off for TIMEOUT_INCREMENT minutes.  If we get another error
 // immediately after we restart, we double the timeout and add
 // TIMEOUT_INCREMENT minutes, etc.
-// 
+//
 // This is similar to the logic used by the search suggestion service.
 
 // HTTP responses that count as an error.  We also include any 5xx response
 // as an error.
 this.HTTP_FOUND                 = 302;
 this.HTTP_SEE_OTHER             = 303;
 this.HTTP_TEMPORARY_REDIRECT    = 307;
 
--- a/toolkit/components/url-classifier/nsUrlClassifierListManager.js
+++ b/toolkit/components/url-classifier/nsUrlClassifierListManager.js
@@ -207,31 +207,29 @@ PROT_ListManager.prototype.requireTableU
   }
 
   return false;
 }
 
 /**
  *  Set timer to check update after delay
  */
-PROT_ListManager.prototype.setUpdateCheckTimer = function (updateUrl,
-                                                           delay)
-{
+PROT_ListManager.prototype.setUpdateCheckTimer = function(updateUrl,
+                                                          delay) {
   this.updateCheckers_[updateUrl] = Cc["@mozilla.org/timer;1"]
                                     .createInstance(Ci.nsITimer);
   this.updateCheckers_[updateUrl].initWithCallback(() => {
     this.updateCheckers_[updateUrl] = null;
     this.checkForUpdates(updateUrl);
   }, delay, Ci.nsITimer.TYPE_ONE_SHOT);
 }
 /**
  * Acts as a nsIUrlClassifierCallback for getTables.
  */
-PROT_ListManager.prototype.kickoffUpdate_ = function (onDiskTableData)
-{
+PROT_ListManager.prototype.kickoffUpdate_ = function(onDiskTableData) {
   this.startingUpdate_ = false;
   var initialUpdateDelay = 3000;
   // Add a fuzz of 0-1 minutes for both v2 and v4 according to Bug 1305478.
   initialUpdateDelay += Math.floor(Math.random() * (1 * 60 * 1000));
 
   // If the user has never downloaded tables, do the check now.
   log("needsUpdate: " + JSON.stringify(this.needsUpdate_, undefined, 2));
   for (var updateUrl in this.needsUpdate_) {
@@ -366,23 +364,23 @@ PROT_ListManager.prototype.makeUpdateReq
     // Skip tables not matching this update url
     if (this.tablesData[tableName].updateUrl != updateUrl) {
       continue;
     }
 
     // Check if |updateURL| is for 'proto'. (only v4 uses protobuf for now.)
     // We use the table name 'goog-*-proto' and an additional provider "google4"
     // to describe the v4 settings.
-    let isCurTableProto = tableName.endsWith('-proto');
+    let isCurTableProto = tableName.endsWith("-proto");
     if (!onceThru) {
       useProtobuf = isCurTableProto;
       onceThru = true;
     } else if (useProtobuf !== isCurTableProto) {
       log('ERROR: Cannot mix "proto" tables with other types ' +
-          'within the same provider.');
+          "within the same provider.");
     }
 
     if (this.needsUpdate_[this.tablesData[tableName].updateUrl][tableName]) {
       streamerMap.tableNames[tableName] = true;
     }
     if (!streamerMap.tableList) {
       streamerMap.tableList = tableName;
     } else {
@@ -643,23 +641,22 @@ function Init() {
               .getService().wrappedJSObject;
   modScope.BindToObject = jslib.BindToObject;
   modScope.RequestBackoffV4 = jslib.RequestBackoffV4;
 
   // We only need to call Init once.
   modScope.Init = function() {};
 }
 
-function RegistrationData()
-{
+function RegistrationData() {
 }
 RegistrationData.prototype = {
     classID: Components.ID("{ca168834-cc00-48f9-b83c-fd018e58cae3}"),
     _xpcom_factory: {
-        createInstance: function(outer, iid) {
+        createInstance(outer, iid) {
             if (outer != null)
                 throw Components.results.NS_ERROR_NO_AGGREGATION;
             Init();
             return (new PROT_ListManager()).QueryInterface(iid);
         }
     },
 };
 
--- a/toolkit/components/url-classifier/tests/UrlClassifierTestUtils.jsm
+++ b/toolkit/components/url-classifier/tests/UrlClassifierTestUtils.jsm
@@ -92,27 +92,27 @@ this.UrlClassifierTestUtils = {
               iid.equals(Ci.nsIUrlClassifierUpdateObserver))
             return listener;
 
           throw Cr.NS_ERROR_NO_INTERFACE;
         },
         updateUrlRequested: url => { },
         streamFinished: status => { },
         updateError: errorCode => {
-          reject('Got updateError when updating ' + table.name);
+          reject("Got updateError when updating " + table.name);
         },
         updateSuccess: requestedTimeout => {
           resolve();
         }
       };
 
       try {
         dbService.beginUpdate(listener, table.name, "");
         dbService.beginStream("", "");
         dbService.updateStream(table.update);
         dbService.finishStream();
         dbService.finishUpdate();
       } catch (e) {
-        reject('Failed to update with dbService: ' + table.name);
+        reject("Failed to update with dbService: " + table.name);
       }
     });
   },
 };
--- a/toolkit/components/url-classifier/tests/browser/classifierHelper.js
+++ b/toolkit/components/url-classifier/tests/browser/classifierHelper.js
@@ -12,19 +12,19 @@ let dbService = Cc["@mozilla.org/url-cla
 
 if (typeof(classifierHelper) == "undefined") {
   var classifierHelper = {};
 }
 
 const HASHLEN = 32;
 
 const PREFS = {
-  PROVIDER_LISTS : "browser.safebrowsing.provider.mozilla.lists",
-  DISALLOW_COMPLETIONS : "urlclassifier.disallow_completions",
-  PROVIDER_GETHASHURL : "browser.safebrowsing.provider.mozilla.gethashURL"
+  PROVIDER_LISTS: "browser.safebrowsing.provider.mozilla.lists",
+  DISALLOW_COMPLETIONS: "urlclassifier.disallow_completions",
+  PROVIDER_GETHASHURL: "browser.safebrowsing.provider.mozilla.gethashURL"
 };
 
 classifierHelper._curAddChunkNum = 1;
 
 // Keep urls added to database, those urls should be automatically
 // removed after test complete.
 classifierHelper._updatesToCleanup = [];
 
@@ -48,26 +48,24 @@ classifierHelper.waitForInit = function(
     iosvc.newURI(url), {});
 
   return new Promise(function(resolve, reject) {
     observerService.addObserver(function() {
       resolve();
     }, "mozentries-update-finished");
 
     let listener = {
-      QueryInterface: function(iid)
-      {
+      QueryInterface(iid) {
         if (iid.equals(Ci.nsISupports) ||
           iid.equals(Ci.nsIUrlClassifierUpdateObserver))
           return this;
         throw Cr.NS_ERROR_NO_INTERFACE;
       },
 
-      handleEvent: function(value)
-      {
+      handleEvent(value) {
         if (value === table) {
           resolve();
         }
       },
     };
     dbService.lookup(principal, table, listener);
   });
 }
@@ -141,41 +139,40 @@ classifierHelper._update = function(upda
   return (async function() {
     // beginUpdate may fail if there's an existing update in progress
     // retry until success or testcase timeout.
     let success = false;
     while (!success) {
       try {
         await new Promise((resolve, reject) => {
           let listener = {
-            QueryInterface: function(iid)
-            {
+            QueryInterface(iid) {
               if (iid.equals(Ci.nsISupports) ||
                   iid.equals(Ci.nsIUrlClassifierUpdateObserver))
                 return this;
 
               throw Cr.NS_ERROR_NO_INTERFACE;
             },
-            updateUrlRequested: function(url) { },
-            streamFinished: function(status) { },
-            updateError: function(errorCode) {
+            updateUrlRequested(url) { },
+            streamFinished(status) { },
+            updateError(errorCode) {
               reject(errorCode);
             },
-            updateSuccess: function(requestedTimeout) {
+            updateSuccess(requestedTimeout) {
               resolve();
             }
           };
           dbService.beginUpdate(listener, "", "");
           dbService.beginStream("", "");
           dbService.updateStream(update);
           dbService.finishStream();
           dbService.finishUpdate();
         });
         success = true;
-      } catch(e) {
+      } catch (e) {
         // Wait 1 second before trying again.
         await new Promise(resolve => setTimeout(resolve, 1000));
       }
     }
   })();
 };
 
 classifierHelper._cleanup = function() {
--- a/toolkit/components/url-classifier/tests/browser/classifierTester.js
+++ b/toolkit/components/url-classifier/tests/browser/classifierTester.js
@@ -43,17 +43,17 @@ var classifierTester = {
     },
     {
       url: "exception.subdocument.example.com/",
       db: "testexcept-flashsubdoc-simple",
       pref: "urlclassifier.flashSubDocExceptTable"
     }
   ],
 
-  setPrefs: function ({setDBs = true, flashBlockEnable = true, flashSetting = classifierTester.ALWAYS_ACTIVATE_PREF_VALUE} = {}) {
+  setPrefs({setDBs = true, flashBlockEnable = true, flashSetting = classifierTester.ALWAYS_ACTIVATE_PREF_VALUE} = {}) {
     if (setDBs) {
       let DBs = [];
 
       for (let dbData of classifierTester.dbUrls) {
         Services.prefs.setCharPref(dbData.pref, dbData.db);
         DBs.push(dbData.db);
       }
 
@@ -64,17 +64,17 @@ var classifierTester = {
 
     Services.prefs.setBoolPref(classifierTester.FLASHBLOCK_ENABLE_PREF,
                                flashBlockEnable);
     Services.prefs.setIntPref(classifierTester.FLASH_PLUGIN_USER_SETTING_PREF,
                               flashSetting);
     Services.prefs.setBoolPref(classifierTester.ALLOW_CTA_PREF, true);
   },
 
-  unsetPrefs: function () {
+  unsetPrefs() {
     for (let dbData of classifierTester.dbUrls) {
       Services.prefs.clearUserPref(dbData.pref);
     }
 
     Services.prefs.clearUserPref(classifierTester.URLCLASSIFIER_DISALLOW_COMPLETIONS_PREF);
     Services.prefs.clearUserPref(classifierTester.FLASHBLOCK_ENABLE_PREF);
     Services.prefs.clearUserPref(classifierTester.FLASH_PLUGIN_USER_SETTING_PREF);
     Services.prefs.clearUserPref(classifierTester.ALLOW_CTA_PREF);
@@ -179,18 +179,18 @@ var classifierTester = {
       name: "Sub-document blocked domain exception",
       domains: ["http://example.com", "http://exception.subdocument.example.com"],
       expectedFlashClassification: "unknown"
     }
   ],
 
   // Returns null if this value should not be verified given the combination
   // of inputs
-  expectedPluginFallbackType: function (classification, flashSetting) {
-    switch(classification) {
+  expectedPluginFallbackType(classification, flashSetting) {
+    switch (classification) {
       case "unknown":
         if (flashSetting == classifierTester.ALWAYS_ACTIVATE_PREF_VALUE) {
           return null;
         } else if (flashSetting == classifierTester.ASK_TO_ACTIVATE_PREF_VALUE) {
           return Ci.nsIObjectLoadingContent.PLUGIN_CLICK_TO_PLAY;
         } else if (flashSetting == classifierTester.NEVER_ACTIVATE_PREF_VALUE) {
           return Ci.nsIObjectLoadingContent.PLUGIN_DISABLED;
         }
@@ -203,92 +203,92 @@ var classifierTester = {
       case "denied":
         return Ci.nsIObjectLoadingContent.PLUGIN_USER_DISABLED;
     }
     throw new Error("Invalid classification or flash setting");
   },
 
   // Returns null if this value should not be verified given the combination
   // of inputs
-  expectedActivated: function (classification, flashSetting) {
-    switch(classification) {
+  expectedActivated(classification, flashSetting) {
+    switch (classification) {
       case "unknown":
         return (flashSetting == classifierTester.ALWAYS_ACTIVATE_PREF_VALUE);
       case "allowed":
         return (flashSetting != classifierTester.NEVER_ACTIVATE_PREF_VALUE);
       case "denied":
         return false;
     }
     throw new Error("Invalid classification or flash setting");
   },
 
   // Returns null if this value should not be verified given the combination
   // of inputs
-  expectedHasRunningPlugin: function (classification, flashSetting) {
-    switch(classification) {
+  expectedHasRunningPlugin(classification, flashSetting) {
+    switch (classification) {
       case "unknown":
         return (flashSetting == classifierTester.ALWAYS_ACTIVATE_PREF_VALUE);
       case "allowed":
         return (flashSetting != classifierTester.NEVER_ACTIVATE_PREF_VALUE);
       case "denied":
         return false;
     }
     throw new Error("Invalid classification or flash setting");
   },
 
   // Returns null if this value should not be verified given the combination
   // of inputs
-  expectedPluginListed: function (classification, flashSetting) {
+  expectedPluginListed(classification, flashSetting) {
     if (flashSetting == classifierTester.ASK_TO_ACTIVATE_PREF_VALUE &&
-        Services.prefs.getCharPref('plugins.navigator.hidden_ctp_plugin') == "Shockwave Flash") {
+        Services.prefs.getCharPref("plugins.navigator.hidden_ctp_plugin") == "Shockwave Flash") {
       return false;
     }
-    switch(classification) {
+    switch (classification) {
       case "unknown":
       case "allowed":
         return (flashSetting != classifierTester.NEVER_ACTIVATE_PREF_VALUE);
       case "denied":
         return false;
     }
     throw new Error("Invalid classification or flash setting");
   },
 
-  buildTestCaseInNewTab: function (browser, testCase) {
+  buildTestCaseInNewTab(browser, testCase) {
     return (async function() {
       let iframeDomains = testCase.domains.slice();
       let pageDomain = iframeDomains.shift();
       let tab = await BrowserTestUtils.openNewForegroundTab(browser,
                                                             pageDomain + classifierTester.URL_PATH);
 
       let depth = 0;
       for (let domain of iframeDomains) {
         // Firefox does not like to load the same page in its own iframe. Put some
         // bogus query strings in the URL to make it happy.
         let url = domain + classifierTester.URL_PATH + "?date=" + Date.now() + "rand=" + Math.random();
         let domainLoaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser, true, url);
 
-        ContentTask.spawn(tab.linkedBrowser, {iframeId: classifierTester.IFRAME_ID, url: url, depth: depth},
+        ContentTask.spawn(tab.linkedBrowser, {iframeId: classifierTester.IFRAME_ID, url, depth},
                           async function({iframeId, url, depth}) {
           let doc = content.document;
           for (let i = 0; i < depth; ++i) {
             doc = doc.getElementById(iframeId).contentDocument;
           }
           doc.getElementById(iframeId).src = url;
         });
 
         await domainLoaded;
         ++depth;
       }
       return tab;
     })();
   },
 
-  getPluginInfo: function (browser, depth) {
+  getPluginInfo(browser, depth) {
     return ContentTask.spawn(browser,
-                             {iframeId: classifierTester.IFRAME_ID, depth: depth},
+                             {iframeId: classifierTester.IFRAME_ID, depth},
                              async function({iframeId, depth}) {
       let doc = content.document;
       let win = content.window;
       for (let i = 0; i < depth; ++i) {
         let frame = doc.getElementById(iframeId);
         doc = frame.contentDocument;
         win = frame.contentWindow;
       }
@@ -302,17 +302,17 @@ var classifierTester = {
         activated: pluginObj.activated,
         hasRunningPlugin: pluginObj.hasRunningPlugin,
         listed: ("Shockwave Flash" in win.navigator.plugins),
         flashClassification: doc.documentFlashClassification
       };
     });
   },
 
-  checkPluginInfo: function (pluginInfo, expectedClassification, flashSetting) {
+  checkPluginInfo(pluginInfo, expectedClassification, flashSetting) {
     is(pluginInfo.flashClassification, expectedClassification,
        "Page's classification should match expected");
 
     let expectedPluginFallbackType =
       classifierTester.expectedPluginFallbackType(pluginInfo.flashClassification,
                                                   flashSetting);
     if (expectedPluginFallbackType != null) {
       is(pluginInfo.pluginFallbackType, expectedPluginFallbackType,
--- a/toolkit/components/url-classifier/tests/mochitest/allowlistAnnotatedFrame.html
+++ b/toolkit/components/url-classifier/tests/mochitest/allowlistAnnotatedFrame.html
@@ -83,31 +83,31 @@ v.addEventListener("error", function() {
     loaded("video");
 }, true);
 
 // Try loading from a tracking script URI (2) - The loader may follow a
 // different path depending on whether the resource is loaded from JS or HTML.
 var newScript = document.createElement("script");
 newScript.id = "badscript2";
 newScript.src = "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js";
-newScript.addEventListener("load", function onload() {scriptItem2 = 'spoiled';});
+newScript.addEventListener("load", function onload() { scriptItem2 = "spoiled"; });
 document.body.appendChild(newScript);
 
-/// Try loading from a tracking image URI (2)
+// / Try loading from a tracking image URI (2)
 var newImage = document.createElement("img");
 newImage.id = "badimage2";
 newImage.src = "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/raptor.jpg";
-newImage.addEventListener("load", function onload() {imageItem2 = 'spoiled'});
+newImage.addEventListener("load", function onload() { imageItem2 = "spoiled" });
 document.body.appendChild(newImage);
 
 // Try loading from a tracking iframe URI (2)
 var newFrame = document.createElement("iframe");
 newFrame.id = "badframe2";
 newFrame.src = "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/track.html"
-newFrame.addEventListener("load", function onload() {frameItem2 = 'spoiled'});
+newFrame.addEventListener("load", function onload() { frameItem2 = "spoiled" });
 document.body.appendChild(newFrame);
 
 // Try doing an XHR against a tracking domain (bug 1216793)
 function reqListener() {
     xhrItem = "loaded";
     loaded("xhr");
 }
 function transferFailed() {
@@ -122,17 +122,17 @@ var oReq = new XMLHttpRequest();
 oReq.addEventListener("load", reqListener);
 oReq.addEventListener("error", transferFailed);
 oReq.addEventListener("abort", transferCanceled);
 oReq.open("GET", "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js");
 oReq.send();
 
 // Fetch from a tracking domain
 fetch("http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js").then(function(response) {
-    if(response.ok) {
+    if (response.ok) {
         fetchItem = "loaded";
         loaded("fetch");
     } else {
         fetchItem = "badresponse";
         loaded("fetch");
     }
  }).catch(function(error) {
      fetchItem = "error";
--- a/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html
+++ b/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html
@@ -149,31 +149,31 @@ v.addEventListener("error", function() {
     mediaItem1 = "error";
     loaded("video");
 }, true);
 
 // Try loading from a tracking script URI (2) - The loader may follow a different path depending on whether the resource is loaded from JS or HTML.
 var newScript = document.createElement("script");
 newScript.id = "badscript2";
 newScript.src = "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js";
-newScript.addEventListener("load", function() {scriptItem2 = scriptItem;});
+newScript.addEventListener("load", function() { scriptItem2 = scriptItem; });
 document.body.appendChild(newScript);
 
-/// Try loading from a tracking image URI (2)
+// Try loading from a tracking image URI (2)
 var newImage = document.createElement("img");
 newImage.id = "badimage2";
 newImage.src = "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/raptor.jpg?reload=true";
-newImage.addEventListener("load", function() {imageItem2 = 'spoiled'});
+newImage.addEventListener("load", function() { imageItem2 = "spoiled" });
 document.body.appendChild(newImage);
 
 // Try loading from a tracking iframe URI (2)
 var newFrame = document.createElement("iframe");
 newFrame.id = "badframe2";
 newFrame.src = "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/track.html"
-newFrame.addEventListener("load", function() {frameItem2 = 'spoiled'});
+newFrame.addEventListener("load", function() { frameItem2 = "spoiled" });
 document.body.appendChild(newFrame);
 
 // Try doing an XHR against a tracking domain (bug 1216793)
 function reqListener() {
     xhrItem = "loaded";
     loaded("xhr");
 }
 function transferFailed() {
@@ -188,17 +188,17 @@ var oReq = new XMLHttpRequest();
 oReq.addEventListener("load", reqListener);
 oReq.addEventListener("error", transferFailed);
 oReq.addEventListener("abort", transferCanceled);
 oReq.open("GET", "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js");
 oReq.send();
 
 // Fetch from a tracking domain
 fetch("http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js").then(function(response) {
-    if(response.ok) {
+    if (response.ok) {
         fetchItem = "loaded";
         loaded("fetch");
     } else {
         fetchItem = "badresponse";
         loaded("fetch");
     }
  }).catch(function(error) {
      fetchItem = "error";
--- a/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js
+++ b/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js
@@ -11,55 +11,54 @@ function setTimeout(callback, delay) {
   timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
   timer.initWithCallback({ notify: callback },
                            delay,
                            Ci.nsITimer.TYPE_ONE_SHOT);
 }
 
 function doUpdate(update) {
   let listener = {
-    QueryInterface: function(iid)
-    {
+    QueryInterface(iid) {
       if (iid.equals(Ci.nsISupports) ||
           iid.equals(Ci.nsIUrlClassifierUpdateObserver))
         return this;
 
       throw Cr.NS_ERROR_NO_INTERFACE;
     },
-    updateUrlRequested: function(url) { },
-    streamFinished: function(status) { },
-    updateError: function(errorCode) {
+    updateUrlRequested(url) { },
+    streamFinished(status) { },
+    updateError(errorCode) {
       sendAsyncMessage("updateError", errorCode);
     },
-    updateSuccess: function(requestedTimeout) {
+    updateSuccess(requestedTimeout) {
       sendAsyncMessage("updateSuccess");
     }
   };
 
   let dbService = Cc["@mozilla.org/url-classifier/dbservice;1"]
                   .getService(Ci.nsIUrlClassifierDBService);
 
   try {
     dbService.beginUpdate(listener, "test-malware-simple,test-unwanted-simple", "");
     dbService.beginStream("", "");
     dbService.updateStream(update);
     dbService.finishStream();
     dbService.finishUpdate();
-  } catch(e) {
+  } catch (e) {
     // beginUpdate may fail if there's an existing update in progress
     // retry until success or testcase timeout.
     setTimeout(() => { doUpdate(update); }, 1000);
   }
 }
 
 function doReload() {
   try {
     dbService.reloadDatabase();
     sendAsyncMessage("reloadSuccess");
-  } catch(e) {
+  } catch (e) {
     setTimeout(() => { doReload(); }, 1000);
   }
 }
 
 // SafeBrowsing.jsm is initialized after mozEntries are added. Add observer
 // to receive "finished" event. For the case when this function is called
 // after the event had already been notified, we lookup entries to see if
 // they are already added to database.
@@ -79,26 +78,24 @@ function waitForInit() {
                .getService(Ci.nsIScriptSecurityManager);
   let iosvc = Cc["@mozilla.org/network/io-service;1"]
               .getService(Ci.nsIIOService);
 
   let principal = secMan.createCodebasePrincipal(
     iosvc.newURI(url), {});
 
   let listener = {
-    QueryInterface: function(iid)
-    {
+    QueryInterface(iid) {
       if (iid.equals(Ci.nsISupports) ||
         iid.equals(Ci.nsIUrlClassifierUpdateObserver))
         return this;
       throw Cr.NS_ERROR_NO_INTERFACE;
     },
 
-    handleEvent: function(value)
-    {
+    handleEvent(value) {
       if (value === table) {
         sendAsyncMessage("safeBrowsingInited");
       }
     },
   };
   dbService.lookup(principal, table, listener);
 }
 
--- a/toolkit/components/url-classifier/tests/mochitest/classifierFrame.html
+++ b/toolkit/components/url-classifier/tests/mochitest/classifierFrame.html
@@ -28,17 +28,17 @@ function checkLoads() {
   if (window.parent.firstLoad) {
     window.parent.info("Reloading from cache...");
     window.parent.firstLoad = false;
     window.parent.loadTestFrame();
     return;
   }
 
   let dwu = window.parent.SpecialPowers.getDOMWindowUtils(window);
-  let timer1 = window.setTimeout(function(){}, 0);
+  let timer1 = window.setTimeout(function() {}, 0);
   window.parent.ok(!dwu.isTimeoutTracking(timer1),
                    "Timeout set from main script should not be considered as tracking");
   let timer2 = getTrackerTimeout();
   window.parent.ok(dwu.isTimeoutTracking(timer2),
                    "Timeout set from included script should be considered as tracking");
   window.clearTimeout(timer1);
   window.clearTimeout(timer2);
 
--- a/toolkit/components/url-classifier/tests/mochitest/classifierHelper.js
+++ b/toolkit/components/url-classifier/tests/mochitest/classifierHelper.js
@@ -3,19 +3,19 @@ if (typeof(classifierHelper) == "undefin
 }
 
 const CLASSIFIER_COMMON_URL = SimpleTest.getTestFileURL("classifierCommon.js");
 var gScript = SpecialPowers.loadChromeScript(CLASSIFIER_COMMON_URL);
 
 const HASHLEN = 32;
 
 const PREFS = {
-  PROVIDER_LISTS : "browser.safebrowsing.provider.mozilla.lists",
-  DISALLOW_COMPLETIONS : "urlclassifier.disallow_completions",
-  PROVIDER_GETHASHURL : "browser.safebrowsing.provider.mozilla.gethashURL"
+  PROVIDER_LISTS: "browser.safebrowsing.provider.mozilla.lists",
+  DISALLOW_COMPLETIONS: "urlclassifier.disallow_completions",
+  PROVIDER_GETHASHURL: "browser.safebrowsing.provider.mozilla.gethashURL"
 };
 
 classifierHelper._curAddChunkNum = 1;
 
 // addUrlToDB is asynchronous, queue the task to ensure
 // the callback follow correct order.
 classifierHelper._updates = [];
 
@@ -104,17 +104,17 @@ classifierHelper.resetDatabase = functio
   return Promise.resolve()
     .then(removeDatabase)
     .then(classifierHelper.reloadDatabase);
 };
 
 classifierHelper.reloadDatabase = function() {
   return new Promise(function(resolve, reject) {
     gScript.addMessageListener("reloadSuccess", function handler() {
-      gScript.removeMessageListener('reloadSuccess', handler);
+      gScript.removeMessageListener("reloadSuccess", handler);
       resolve();
     });
 
     gScript.sendAsyncMessage("doReload");
   });
 }
 
 classifierHelper._update = function(testUpdate, onsuccess, onerror) {
@@ -145,17 +145,17 @@ classifierHelper._updateError = function
 
   if (classifierHelper._updates.length) {
     var testUpdate = classifierHelper._updates[0].data;
     gScript.sendAsyncMessage("doUpdate", { testUpdate });
   }
 };
 
 classifierHelper._inited = function() {
-  classifierHelper._initsCB.forEach(function (cb) {
+  classifierHelper._initsCB.forEach(function(cb) {
     cb();
   });
   classifierHelper._initsCB = [];
 };
 
 classifierHelper._setup = function() {
   gScript.addMessageListener("updateSuccess", classifierHelper._updateSuccess);
   gScript.addMessageListener("updateError", classifierHelper._updateError);
--- a/toolkit/components/url-classifier/tests/mochitest/cleanWorker.js
+++ b/toolkit/components/url-classifier/tests/mochitest/cleanWorker.js
@@ -1,10 +1,10 @@
 onmessage = function() {
   try {
     importScripts("evilWorker.js");
-  } catch(ex) {
+  } catch (ex) {
     postMessage("success");
     return;
   }
 
   postMessage("failure");
 };
--- a/toolkit/components/url-classifier/tests/mochitest/dnt.html
+++ b/toolkit/components/url-classifier/tests/mochitest/dnt.html
@@ -1,17 +1,17 @@
 <html>
 <head>
 <title></title>
 
 <script type="text/javascript">
 
 function makeXHR(url, callback) {
   var xhr = new XMLHttpRequest();
-  xhr.open('GET', url, true);
+  xhr.open("GET", url, true);
   xhr.onload = function() {
     callback(xhr.response);
   };
   xhr.send();
 }
 
 function loaded(type) {
   window.parent.postMessage("navigator.doNotTrack=" + navigator.doNotTrack, "*");
--- a/toolkit/components/url-classifier/tests/mochitest/test_advisory_link.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_advisory_link.html
@@ -77,17 +77,17 @@ function setupTestData(data) {
       activeTable += "," + data.list;
   promises.push(pushPrefs([activeTablePref, activeTable]));
 
   promises.push(addUrlToDB(data.list, data.url));
   return Promise.all(promises);
 }
 
 function testOnWindow(aTestData) {
-  return new Promise(resolve  => {
+  return new Promise(resolve => {
     let win = mainWindow.OpenBrowserWindow();
 
     (async function() {
       await new Promise(resolve => whenDelayedStartupFinished(win, resolve));
 
       let browser = win.gBrowser.selectedBrowser;
       await BrowserTestUtils.loadURI(browser, aTestData.url);
       await BrowserTestUtils.waitForContentEvent(browser, "DOMContentLoaded")
@@ -112,17 +112,17 @@ function testOnWindow(aTestData) {
 
       win.close();
       resolve();
     })();
   });
 }
 
 SpecialPowers.pushPrefEnv(
-  {"set" : [["browser.safebrowsing.phishing.enabled", true]]},
+  {"set": [["browser.safebrowsing.phishing.enabled", true]]},
   test);
 
 function test() {
   (async function() {
     await classifierHelper.waitForInit();
 
     for (let testData of testDatas) {
       await setupTestData(testData);
--- a/toolkit/components/url-classifier/tests/mochitest/test_allowlisted_annotations.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_allowlisted_annotations.html
@@ -28,19 +28,19 @@ function clearPermissions() {
   SpecialPowers.removePermission("trackingprotection",
                                  { url: "https://allowlisted.example.com" });
   ok(!SpecialPowers.testPermission("trackingprotection",
                                    Ci.nsIPermissionManager.ALLOW_ACTION,
                                    { url: "https://allowlisted.example.com" }));
 }
 
 SpecialPowers.pushPrefEnv(
-  {"set" : [["urlclassifier.trackingTable", "test-track-simple"],
-            ["privacy.trackingprotection.enabled", true],
-            ["channelclassifier.allowlist_example", true]]},
+  {"set": [["urlclassifier.trackingTable", "test-track-simple"],
+           ["privacy.trackingprotection.enabled", true],
+           ["channelclassifier.allowlist_example", true]]},
   test);
 
 function test() {
   SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
   UrlClassifierTestUtils.addTestTrackers().then(() => {
     document.getElementById("testFrame").src = "allowlistAnnotatedFrame.html";
   });
 }
--- a/toolkit/components/url-classifier/tests/mochitest/test_bug1254766.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_bug1254766.html
@@ -134,90 +134,99 @@ function update(prefix = false) {
 //    either cache or DB.
 // 4. Load test frame again, since completions is stored in cache now, no gethash
 //    request should be triggered.
 function testGethash() {
   return Promise.resolve()
     .then(addPrefixToDB)
     .then(loadTestFrame)
     .then(() => {
-       ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered."); })
+       ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered.");
+})
     .then(loadTestFrame)
     .then(() => {
-      ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered."); })
+      ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered.");
+})
     .then(reset);
 }
 
 // This testcae is to make sure completions in update works:
 // 1. Add completions to DB.
 // 2. Load test frame, since completions is stored in DB, gethash request should
 //    not be triggered.
 function testUpdate() {
   return Promise.resolve()
     .then(addCompletionToDB)
     .then(loadTestFrame)
     .then(() => {
-      ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered."); })
+      ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered.");
+})
     .then(reset);
 }
 
 // This testcase is to make sure an update request will not clear completions in DB:
 // 1. Add completions to DB.
 // 2. Load test frame to make sure completions is stored in database, in this case, gethash
 //    should not be triggered.
 // 3. Trigger an update, cache is cleared, but completions in DB should still remain.
 // 4. Load test frame again, since completions is in DB, gethash request should not be triggered.
 function testUpdateNotClearCompletions() {
   return Promise.resolve()
     .then(addCompletionToDB)
     .then(loadTestFrame)
     .then(() => {
-      ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered."); })
+      ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered.");
+})
     .then(updateUnusedUrl)
     .then(loadTestFrame)
     .then(() => {
-      ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered."); })
+      ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered.");
+})
     .then(reset);
 }
 
 // This testcase is to make sure completion store in DB will properly load after restarting.
 // 1. Add completions to DB.
 // 2. Simulate firefox restart by calling reloadDatabase.
 // 3. Load test frame, since completions should be loaded from DB, no gethash request should
 //    be triggered.
 function testUpdateCompletionsAfterReload() {
   return Promise.resolve()
     .then(addCompletionToDB)
     .then(classifierHelper.reloadDatabase)
     .then(loadTestFrame)
     .then(() => {
-      ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered."); })
+      ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered.");
+})
     .then(reset);
 }
 
 // This testcase is to make sure cache will be cleared after restarting
 // 1. Add prefixes to DB.
 // 2. Load test frame, this should trigger a gethash request and completions will be stored in
 //    cache.
 // 3. Load test frame again, no gethash should be triggered because of cache.
 // 4. Simulate firefox restart by calling reloadDatabase.
 // 5. Load test frame again, since cache is cleared, gethash request should be triggered.
 function testGethashCompletionsAfterReload() {
   return Promise.resolve()
     .then(addPrefixToDB)
     .then(loadTestFrame)
     .then(() => {
-       ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered."); })
+       ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered.");
+})
     .then(loadTestFrame)
     .then(() => {
-      ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered."); })
+      ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered.");
+})
     .then(classifierHelper.reloadDatabase)
     .then(loadTestFrame)
     .then(() => {
-       ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered."); })
+       ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered.");
+})
     .then(reset);
 }
 
 function runTest() {
   Promise.resolve()
     .then(classifierHelper.waitForInit)
     .then(setup)
     .then(testGethash)
--- a/toolkit/components/url-classifier/tests/mochitest/test_cachemiss.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_cachemiss.html
@@ -56,17 +56,17 @@ function getGethashCounter() {
     };
     xhr.send();
   });
 }
 
 // add 4-bytes prefixes to local database, so when we access the url,
 // it will trigger gethash request.
 function addPrefixToDB(list, url) {
-  var testData = [{ db: list, url: url, len: 4 }];
+  var testData = [{ db: list, url, len: 4 }];
 
   return classifierHelper.addUrlToDB(testData)
     .catch(function(err) {
       ok(false, "Couldn't update classifier. Error code: " + err);
       // Abort test.
       SimpleTest.finish();
     });
 }
@@ -91,21 +91,23 @@ function testNegativeCache() {
       addPrefixToDB(UNWANTED_LIST, UNWANTED_HOST),
     ]);
   }
 
   return Promise.resolve()
     .then(setup)
     .then(() => loadTestFrame())
     .then(() => {
-       ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered."); })
+       ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered.");
+})
     // Second load should not trigger gethash request because cache.
     .then(() => loadTestFrame())
     .then(() => {
-       ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is nottriggered."); })
+       ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is nottriggered.");
+})
     .then(reset);
 }
 
 function testPositiveCache() {
   shouldLoad = false;
 
   function setup() {
     classifierHelper.allowCompletion([MALWARE_LIST, UNWANTED_LIST], GETHASH_URL);
@@ -117,21 +119,23 @@ function testPositiveCache() {
       addCompletionToServer(UNWANTED_LIST, UNWANTED_HOST, GETHASH_URL)
     ]);
   }
 
   return Promise.resolve()
     .then(setup)
     .then(() => loadTestFrame())
     .then(() => {
-       ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered."); })
+       ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered.");
+})
     // Second load should not trigger gethash request because cache.
     .then(() => loadTestFrame())
     .then(() => {
-       ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is nottriggered."); })
+       ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is nottriggered.");
+})
     .then(reset);
 }
 
 function runTest() {
   Promise.resolve()
     // This test resources get blocked when gethash returns successfully
     .then(classifierHelper.waitForInit)
     .then(testNegativeCache)
--- a/toolkit/components/url-classifier/tests/mochitest/test_classified_annotations.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classified_annotations.html
@@ -20,17 +20,17 @@ var Ci = SpecialPowers.Ci;
 Components.utils.import("resource://testing-common/UrlClassifierTestUtils.jsm");
 
 function cleanup() {
   SpecialPowers.clearUserPref("privacy.trackingprotection.enabled");
   SpecialPowers.clearUserPref("channelclassifier.allowlist_example");
 }
 
 SpecialPowers.pushPrefEnv(
-  {"set" : [["urlclassifier.trackingTable", "test-track-simple"]]},
+  {"set": [["urlclassifier.trackingTable", "test-track-simple"]]},
   test);
 
 function test() {
   UrlClassifierTestUtils.addTestTrackers().then(() => {
     SpecialPowers.setBoolPref("privacy.trackingprotection.enabled", true);
     // Make sure chrome:// URIs are processed. This does not white-list
     // any URIs unless 'https://allowlisted.example.com' is added in the
     // permission manager (see test_allowlisted_annotations.html)
--- a/toolkit/components/url-classifier/tests/mochitest/test_classifier.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classifier.html
@@ -120,17 +120,17 @@ function loadTestFrame() {
   document.getElementById("testFrame").src = "classifierFrame.html";
 }
 
 // Expected finish() call is in "classifierFrame.html".
 SimpleTest.waitForExplicitFinish();
 
 function updateSuccess() {
   return SpecialPowers.pushPrefEnv(
-    {"set" : [["browser.safebrowsing.malware.enabled", true]]});
+    {"set": [["browser.safebrowsing.malware.enabled", true]]});
 }
 
 function updateError(errorCode) {
   ok(false, "Couldn't update classifier. Error code: " + errorCode);
   // Abort test.
   SimpleTest.finish();
 }
 
@@ -166,22 +166,22 @@ function testService() {
 
       });
     }
     runNextTest(resolve);
   });
 }
 
 SpecialPowers.pushPrefEnv(
-  {"set" : [["urlclassifier.malwareTable", "test-malware-simple,test-unwanted-simple,test-harmful-simple"],
-            ["urlclassifier.phishTable", "test-phish-simple"],
-            ["urlclassifier.downloadBlockTable", "test-block-simple"],
-            ["urlclassifier.trackingTable", "test-track-simple"],
-            ["browser.safebrowsing.debug", true],
-            ["privacy.trackingprotection.annotate_channels", true]]},
+  {"set": [["urlclassifier.malwareTable", "test-malware-simple,test-unwanted-simple,test-harmful-simple"],
+           ["urlclassifier.phishTable", "test-phish-simple"],
+           ["urlclassifier.downloadBlockTable", "test-block-simple"],
+           ["urlclassifier.trackingTable", "test-track-simple"],
+           ["browser.safebrowsing.debug", true],
+           ["privacy.trackingprotection.annotate_channels", true]]},
   function() {
     classifierHelper.waitForInit()
       .then(() => classifierHelper.addUrlToDB(testData))
       .then(updateSuccess)
       .catch(err => {
         updateError(err);
       })
       .then(testService)
--- a/toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html
@@ -73,37 +73,37 @@ function waitForUpdateSuccess(callback) 
 }
 
 function runTest() {
   /**
    * In this test we try to modify only urlclassifier.*Table preference to see if
    * url specified in the table will be blocked after update.
    */
   var pushPrefPromise = SpecialPowers.pushPrefEnv(
-    {"set" : [["urlclassifier.trackingTable", testTable]]});
+    {"set": [["urlclassifier.trackingTable", testTable]]});
 
   // To make sure url is not blocked by an already blocked url.
   // Here we use non-tracking.example.com as a tracked url.
   // Since this table is only used in this bug, so it won't affect other testcases.
   var addCompletePromise =
     addCompletionToServer(testTable, "bug1281083.example.com/", UPDATE_URL);
 
   Promise.all([pushPrefPromise, addCompletePromise])
     .then(() => {
       loadTestFrame();
     });
 }
 
 // Set nextupdatetime to 1 to trigger an update
 SpecialPowers.pushPrefEnv(
-  {"set" : [["privacy.trackingprotection.enabled", true],
-            ["channelclassifier.allowlist_example", true],
-            ["browser.safebrowsing.provider.mozilla.nextupdatetime", "1"],
-            ["browser.safebrowsing.provider.mozilla.lists", testTable],
-            ["browser.safebrowsing.provider.mozilla.updateURL", UPDATE_URL]]},
+  {"set": [["privacy.trackingprotection.enabled", true],
+           ["channelclassifier.allowlist_example", true],
+           ["browser.safebrowsing.provider.mozilla.nextupdatetime", "1"],
+           ["browser.safebrowsing.provider.mozilla.lists", testTable],
+           ["browser.safebrowsing.provider.mozilla.updateURL", UPDATE_URL]]},
   runTest);
 
 // Expected finish() call is in "bug_1281083.html".
 SimpleTest.waitForExplicitFinish();
 
 </script>
 </pre>
 <iframe id="testFrame" width="100%" height="100%" onload=""></iframe>
--- a/toolkit/components/url-classifier/tests/mochitest/test_classifier_match.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classifier_match.html
@@ -67,47 +67,47 @@ function hashPrefix(str) {
 }
 
 var testDatas = [
   // Match empty provider
   { url: "http://malware.example.com",
     expect: { error: Cr.NS_ERROR_BLOCKED_URI,
               table: "mochi-block-simple",
               provider: "",
-              prefix: (function(){
+              prefix: (function() {
                 return hashPrefix("malware.example.com/");
               })(),
             }
   },
   // Match multiple tables, only one has valid provider
   { url: "http://malware1.example.com",
     expect: { error: Cr.NS_ERROR_MALWARE_URI,
               table: "mochi1-malware-simple",
               provider: "mozilla",
-              prefix: (function(){
+              prefix: (function() {
                 return hashPrefix("malware1.example.com/");
               })(),
             }
   },
   // Match multiple tables, handle order
   { url: "http://malware2.example.com",
     expect: { error: Cr.NS_ERROR_MALWARE_URI,
               table: "mochi2-malware-simple",
               provider: "mozilla",
-              prefix: (function(){
+              prefix: (function() {
                 return hashPrefix("malware2.example.com/");
               })(),
             }
   },
   // Match multiple tables, handle order
   { url: "http://malware3.example.com",
     expect: { error: Cr.NS_ERROR_MALWARE_URI,
               table: "mochig3-malware-simple",
               provider: "google",
-              prefix: (function(){
+              prefix: (function() {
                 return hashPrefix("malware3.example.com/");
               })(),
             }
   },
 
 ];
 
 SimpleTest.waitForExplicitFinish();
@@ -166,17 +166,17 @@ function runTest() {
         runNextTest();
       });
     }
     runNextTest();
   });
 }
 
 SpecialPowers.pushPrefEnv(
-  {"set" : [["browser.safebrowsing.malware.enabled", true]]},
+  {"set": [["browser.safebrowsing.malware.enabled", true]]},
   function() {
     classifierHelper.waitForInit()
       .then(() => setupTestData(inputDatas))
       .then(() => classifierHelper.addUrlToDB(inputDatas))
       .then(runTest)
       .then(function() {
         SimpleTest.finish();
       }).catch(function(e) {
--- a/toolkit/components/url-classifier/tests/mochitest/test_classifier_worker.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classifier_worker.html
@@ -24,42 +24,41 @@ var testData = [
   }
 ];
 
 function loadTestFrame() {
   document.getElementById("testFrame").src =
     "http://example.com/tests/toolkit/components/url-classifier/tests/mochitest/workerFrame.html";
 }
 
-function onmessage(event)
-{
-  var pieces = event.data.split(':');
+function onmessage(event) {
+  var pieces = event.data.split(":");
   if (pieces[0] == "finish") {
     SimpleTest.finish();
     return;
   }
 
   is(pieces[0], "success", pieces[1]);
 }
 
 function updateSuccess() {
   SpecialPowers.pushPrefEnv(
-    {"set" : [["browser.safebrowsing.malware.enabled", true]]},
+    {"set": [["browser.safebrowsing.malware.enabled", true]]},
     loadTestFrame);
 }
 
 function updateError(errorCode) {
   ok(false, "Couldn't update classifier. Error code: " + errorCode);
   // Abort test.
   SimpleTest.finish();
-};
+}
 
 SpecialPowers.pushPrefEnv(
-  {"set" : [["urlclassifier.malwareTable", "test-malware-simple,test-unwanted-simple"],
-            ["urlclassifier.phishTable", "test-phish-simple"]]},
+  {"set": [["urlclassifier.malwareTable", "test-malware-simple,test-unwanted-simple"],
+           ["urlclassifier.phishTable", "test-phish-simple"]]},
   function() {
     classifierHelper.waitForInit()
       .then(() => classifierHelper.addUrlToDB(testData))
       .then(updateSuccess)
       .catch(err => {
         updateError(err);
       });
   });
--- a/toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html
@@ -69,30 +69,30 @@
       setTimeout(function() {
         isPinged(id, expectPing, msg, resolve);
       }, timeout);
     });
   }
 
   function ping(id, host) {
     var elm = document.createElement("a");
-    elm.setAttribute('ping', host + path_ping + "?id=" + id);
-    elm.setAttribute('href', "#");
+    elm.setAttribute("ping", host + path_ping + "?id=" + id);
+    elm.setAttribute("href", "#");
     document.body.appendChild(elm);
 
     // Trigger ping.
     elm.click();
 
     document.body.removeChild(elm);
   }
 
   function isPingedWithRetry(id, expected, msg, callback, retryCnt) {
     var url = "http://mochi.test:8888/" + path_ping;
     var xhr = new XMLHttpRequest();
-    xhr.open('GET', url + "?id=" + id);
+    xhr.open("GET", url + "?id=" + id);
     xhr.onload = function() {
       var isPinged = xhr.response === "ping";
       let success = isPinged === expected;
       if (success || 0 === retryCnt) {
         is(expected, isPinged, msg);
         callback();
         return;
       }
--- a/toolkit/components/url-classifier/tests/mochitest/test_donottrack.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_donottrack.html
@@ -23,74 +23,74 @@ var mainWindow = window.QueryInterface(C
                     .rootTreeItem
                     .QueryInterface(Ci.nsIInterfaceRequestor)
                     .getInterface(Ci.nsIDOMWindow);
 
 const tests = [
   // DNT turned on and TP turned off, DNT signal sent in both private browsing
   // and normal mode.
   {
-    setting:  {dntPref:true, tpPref:false, tppbPref:false, pbMode:true},
+    setting:  {dntPref: true, tpPref: false, tppbPref: false, pbMode: true},
     expected: {dnt: "1"},
   },
   {
-    setting:  {dntPref:true,  tpPref:false, tppbPref:false, pbMode:false},
+    setting:  {dntPref: true,  tpPref: false, tppbPref: false, pbMode: false},
     expected: {dnt: "1"}
   },
   // DNT turned off and TP turned on globally, DNT signal sent in both private
   // browsing and normal mode.
   {
-    setting:  {dntPref:false, tpPref:true,  tppbPref:false, pbMode:true},
+    setting:  {dntPref: false, tpPref: true,  tppbPref: false, pbMode: true},
     expected: {dnt: "1"}
   },
   {
-    setting:  {dntPref:false, tpPref:true,  tppbPref:false, pbMode:false},
+    setting:  {dntPref: false, tpPref: true,  tppbPref: false, pbMode: false},
     expected: {dnt: "1"}
   },
   // DNT turned off and TP in Private Browsing only, DNT signal sent in private
   // browsing mode only.
   {
-    setting:  {dntPref:false, tpPref:false, tppbPref:true,  pbMode:true},
+    setting:  {dntPref: false, tpPref: false, tppbPref: true,  pbMode: true},
     expected: {dnt: "1"}
   },
   {
-    setting:  {dntPref:false, tpPref:false, tppbPref:true,  pbMode:false},
+    setting:  {dntPref: false, tpPref: false, tppbPref: true,  pbMode: false},
     expected: {dnt: "unspecified"}
   },
   // DNT turned off and TP turned off, DNT signal is never sent.
   {
-    setting:  {dntPref:false, tpPref:false, tppbPref:false, pbMode:true},
+    setting:  {dntPref: false, tpPref: false, tppbPref: false, pbMode: true},
     expected: {dnt: "unspecified"}
   },
   {
-    setting:  {dntPref:false, tpPref:false, tppbPref:false, pbMode:false},
+    setting:  {dntPref: false, tpPref: false, tppbPref: false, pbMode: false},
     expected: {dnt: "unspecified"}
   },
 ]
 
-const DNT_PREF = 'privacy.donottrackheader.enabled';
-const TP_PREF = 'privacy.trackingprotection.enabled';
-const TP_PB_PREF = 'privacy.trackingprotection.pbmode.enabled';
+const DNT_PREF = "privacy.donottrackheader.enabled";
+const TP_PREF = "privacy.trackingprotection.enabled";
+const TP_PB_PREF = "privacy.trackingprotection.pbmode.enabled";
 
 const contentPage =
   "http://mochi.test:8888/tests/toolkit/components/url-classifier/tests/mochitest/dnt.html";
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 
 function whenDelayedStartupFinished(aWindow, aCallback) {
   Services.obs.addObserver(function observer(aSubject, aTopic) {
     if (aWindow == aSubject) {
       Services.obs.removeObserver(observer, aTopic);
       setTimeout(aCallback, 0);
     }
   }, "browser-delayed-startup-finished");
 }
 
 function executeTest(test) {
-  SpecialPowers.pushPrefEnv({"set" : [
+  SpecialPowers.pushPrefEnv({"set": [
    [DNT_PREF, test.setting.dntPref],
    [TP_PREF, test.setting.tpPref],
    [TP_PB_PREF, test.setting.tppbPref]
   ]});
 
   var win = mainWindow.OpenBrowserWindow({private: test.setting.pbMode});
 
   return new Promise(function(resolve, reject) {
@@ -99,17 +99,17 @@ function executeTest(test) {
         win.addEventListener("DOMContentLoaded", function onInnerLoad() {
           if (win.content.location.href != contentPage) {
             win.gBrowser.loadURI(contentPage);
             return;
           }
 
           win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
 
-          win.content.addEventListener('message', function (event) {
+          win.content.addEventListener("message", function(event) {
             let [key, value] = event.data.split("=");
             if (key == "finish") {
               win.close();
               resolve();
             } else if (key == "navigator.doNotTrack") {
               is(value, test.expected.dnt, "navigator.doNotTrack should be " + test.expected.dnt);
             } else if (key == "DNT") {
               let msg = test.expected.dnt == "1" ? "" : "not ";
--- a/toolkit/components/url-classifier/tests/mochitest/test_gethash.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_gethash.html
@@ -42,17 +42,17 @@ function loadTestFrame(id) {
       resolve();
     };
   });
 }
 
 // add 4-bytes prefixes to local database, so when we access the url,
 // it will trigger gethash request.
 function addPrefixToDB(list, url) {
-  var testData = [{ db: list, url: url, len: 4 }];
+  var testData = [{ db: list, url, len: 4 }];
 
   return classifierHelper.addUrlToDB(testData)
     .catch(function(err) {
       ok(false, "Couldn't update classifier. Error code: " + err);
       // Abort test.
       SimpleTest.finish();
     });
 }
--- a/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
@@ -45,18 +45,18 @@ function testOnWindow(aPrivate, aCallbac
     whenDelayedStartupFinished(win, function() {
       win.addEventListener("DOMContentLoaded", function onInnerLoad() {
         if (win.content.location.href != contentPage) {
           win.gBrowser.loadURI(contentPage);
           return;
         }
         win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
 
-        win.content.addEventListener('load', function innerLoad2() {
-          win.content.removeEventListener('load', innerLoad2);
+        win.content.addEventListener("load", function innerLoad2() {
+          win.content.removeEventListener("load", innerLoad2);
           SimpleTest.executeSoon(function() { aCallback(win); });
         }, false, true);
       }, true);
       SimpleTest.executeSoon(function() { win.gBrowser.loadURI(contentPage); });
     });
   }, {capture: true, once: true});
 }
 
@@ -107,17 +107,17 @@ function checkLoads(aWindow, aBlocked) {
     }
 
     allNodeMatch = allNodeMatch && nodeMatch;
   }
   is(allNodeMatch, aBlocked, "All tracking nodes are expected to be annotated as such");
 }
 
 SpecialPowers.pushPrefEnv(
-  {"set" : [["urlclassifier.trackingTable", "test-track-simple"],
+  {"set": [["urlclassifier.trackingTable", "test-track-simple"],
             ["privacy.trackingprotection.enabled", false],
             ["privacy.trackingprotection.pbmode.enabled", true],
             ["channelclassifier.allowlist_example", true]]},
   test);
 
 function test() {
   SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
   UrlClassifierTestUtils.addTestTrackers().then(() => {
--- a/toolkit/components/url-classifier/tests/mochitest/test_reporturl.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_reporturl.html
@@ -70,17 +70,17 @@ function whenDelayedStartupFinished(aWin
     if (aWindow == aSubject) {
       Services.obs.removeObserver(observer, aTopic);
       setTimeout(aCallback, 0);
     }
   }, "browser-delayed-startup-finished");
 }
 
 function testOnWindow(aTestData, aCallback, aTestCreater) {
-  return new Promise(resolve  => {
+  return new Promise(resolve => {
     let win = mainWindow.OpenBrowserWindow();
 
     (async function() {
       await new Promise(resolve => whenDelayedStartupFinished(win, resolve));
 
       let browser = win.gBrowser.selectedBrowser;
       aTestCreater(win, browser, aTestData.topUrl, aTestData.testUrl);
 
@@ -111,26 +111,26 @@ function testOnWindow(aTestData, aCallba
 var createBlockedIframe = function(aWindow, aBrowser, aTopUrl, aUrl) {
   (async function() {
     await BrowserTestUtils.loadURI(aBrowser, aTopUrl);
     await BrowserTestUtils.browserLoaded(aBrowser);
 
     await ContentTask.spawn(aBrowser, aUrl, async function(aUrl) {
       return new Promise(resolve => {
         let listener = e => {
-          removeEventListener('AboutBlockedLoaded', listener, false, true);
+          removeEventListener("AboutBlockedLoaded", listener, false, true);
           resolve();
         };
-        addEventListener('AboutBlockedLoaded', listener, false, true);
+        addEventListener("AboutBlockedLoaded", listener, false, true);
         let frame = content.document.getElementById("phishingFrame");
-        frame.setAttribute('src', "http://" + aUrl);
+        frame.setAttribute("src", "http://" + aUrl);
       });
     });
 
-    let doc = aWindow.gBrowser.contentDocument.getElementsByTagName('iframe')[0].contentDocument;
+    let doc = aWindow.gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument;
     let ignoreButton = doc.getElementById("ignoreWarningButton");
     ok(ignoreButton, "ignoreWarningButton should exist");
     ignoreButton.click();
   })();
 };
 
 var createBlockedPage = function(aWindow, aBrowser, aTopUrl, aUrl) {
   (async function() {
@@ -149,62 +149,62 @@ function checkReportURL(aReportBrowser, 
     is(aReportBrowser.contentDocument.location.href, expectedReportUrl, "Correct report URL");
 }
 
 var testDatas = [
   { topUrl: "http://itisaphishingsite.org/phishing.html",
     testUrl: "itisaphishingsite.org/phishing.html",
     list: "mochi1-phish-simple",
     provider: "google",
-    blockCreater : createBlockedPage,
+    blockCreater: createBlockedPage,
     expectedReportUri: "http://itisaphishingsite.org/phishing.html"
   },
 
   // Non-google provider, no report button is showed.
   // Test provider needs a valid update URL (mozilla for example) otherwise
   // the updates inserting the test data will fail.
   { topUrl: "http://fakeitisaphishingsite.org/phishing.html",
     testUrl: "fakeitisaphishingsite.org/phishing.html",
     list: "fake-phish-simple",
     provider: "mozilla",
-    blockCreater : createBlockedPage
+    blockCreater: createBlockedPage
   },
 
   // Iframe case:
   // A top level page at
   // http://mochi.test:8888/chrome/toolkit/components/url-classifier/tests/mochitest/report.sjs?action=create-blocked-iframe
   // contains an iframe to http://phishing.example.com/test.html (blocked).
 
   { topUrl: "http://mochi.test:8888/chrome/toolkit/components/url-classifier/tests/mochitest/report.sjs?action=create-blocked-iframe",
     testUrl: "phishing.example.com/test.html",
     list: "mochi2-phish-simple",
     provider: "google4",
-    blockCreater : createBlockedIframe,
+    blockCreater: createBlockedIframe,
     expectedReportUri: "http://phishing.example.com/test.html"
   },
 
   // Redirect case:
   // A top level page at
   // http://prefixexample.com/chrome/toolkit/components/url-classifier/tests/mochitest/report.sjs?action=create-blocked-redirect (blocked)
   // will get redirected to
   // https://mochi.test:8888/chrome/toolkit/components/url-classifier/tests/mochitest/report.sjs?action=create-blocked-redirect.
   { topUrl: "http://prefixexample.com/chrome/toolkit/components/url-classifier/tests/mochitest/report.sjs?action=create-blocked-redirect",
     testUrl: "prefixexample.com/chrome/toolkit/components/url-classifier/tests/mochitest/report.sjs?action=create-blocked-redirect",
     list: "mochi3-phish-simple",
     provider: "google4",
-    blockCreater : createBlockedPage,
+    blockCreater: createBlockedPage,
     expectedReportUri: "http://prefixexample.com/chrome/toolkit/components/url-classifier/tests/mochitest/report.sjs"
   },
 
 ];
 
 SpecialPowers.pushPrefEnv(
-  {"set" : [["browser.safebrowsing.provider.google.reportPhishMistakeURL", BASE_URL + "action=reporturl&reporturl="],
-            ["browser.safebrowsing.provider.google4.reportPhishMistakeURL", BASE_URL + "action=reporturl&reporturl="],
-            ["browser.safebrowsing.phishing.enabled", true]]},
+  {"set": [["browser.safebrowsing.provider.google.reportPhishMistakeURL", BASE_URL + "action=reporturl&reporturl="],
+           ["browser.safebrowsing.provider.google4.reportPhishMistakeURL", BASE_URL + "action=reporturl&reporturl="],
+           ["browser.safebrowsing.phishing.enabled", true]]},
   test);
 
 function test() {
   (async function() {
     await classifierHelper.waitForInit();
 
     for (let testData of testDatas) {
       await setupTestData(testData);
--- a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1157081.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1157081.html
@@ -45,18 +45,18 @@ function testOnWindow(aCallback) {
     whenDelayedStartupFinished(win, function() {
       win.addEventListener("DOMContentLoaded", function onInnerLoad() {
         if (win.content.location.href != contentPage) {
           win.gBrowser.loadURI(contentPage);
           return;
         }
         win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
 
-        win.content.addEventListener('load', function innerLoad2() {
-          win.content.removeEventListener('load', innerLoad2);
+        win.content.addEventListener("load", function innerLoad2() {
+          win.content.removeEventListener("load", innerLoad2);
           SimpleTest.executeSoon(function() { aCallback(win); });
         }, false, true);
       }, true);
       SimpleTest.executeSoon(function() { win.gBrowser.loadURI(contentPage); });
     });
   }, {capture: true, once: true});
 }
 
@@ -65,21 +65,21 @@ var badids = [
 ];
 
 function checkLoads(aWindow, aBlocked) {
   var win = aWindow.content;
   is(win.document.getElementById("badscript").dataset.touched, aBlocked ? "no" : "yes", "Should not load tracking javascript");
 }
 
 SpecialPowers.pushPrefEnv(
-  {"set" : [["urlclassifier.trackingTable", "test-track-simple"],
-            ["privacy.trackingprotection.enabled", true],
-            ["browser.safebrowsing.malware.enabled", false],
-            ["browser.safebrowsing.phishing.enabled", false],
-            ["channelclassifier.allowlist_example", true]]},
+  {"set": [["urlclassifier.trackingTable", "test-track-simple"],
+           ["privacy.trackingprotection.enabled", true],
+           ["browser.safebrowsing.malware.enabled", false],
+           ["browser.safebrowsing.phishing.enabled", false],
+           ["channelclassifier.allowlist_example", true]]},
   test);
 
 function test() {
   SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
   UrlClassifierTestUtils.addTestTrackers().then(() => {
     // Safe Browsing turned OFF, tracking protection should work nevertheless
     testOnWindow(function(aWindow) {
       checkLoads(aWindow, true);
--- a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1312515.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1312515.html
@@ -45,18 +45,18 @@ function testOnWindow(aPrivate, aCallbac
     whenDelayedStartupFinished(win, function() {
       win.addEventListener("DOMContentLoaded", function onInnerLoad() {
         if (win.content.location.href != contentPage) {
           win.gBrowser.loadURI(contentPage);
           return;
         }
         win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
 
-        win.content.addEventListener('load', function innerLoad2() {
-          win.content.removeEventListener('load', innerLoad2);
+        win.content.addEventListener("load", function innerLoad2() {
+          win.content.removeEventListener("load", innerLoad2);
           SimpleTest.executeSoon(function() { aCallback(win); });
         }, false, true);
       }, true);
       SimpleTest.executeSoon(function() { win.gBrowser.loadURI(contentPage); });
     });
   }, {capture: true, once: true});
 }
 
@@ -98,20 +98,20 @@ function testFetch() {
 
 function endTest() {
   testWindow.close();
   testWindow = null;
   SimpleTest.finish();
 }
 
 SpecialPowers.pushPrefEnv(
-  {"set" : [["urlclassifier.trackingTable", "test-track-simple"],
-            ["privacy.trackingprotection.annotate_channels", true],
-            ["privacy.trackingprotection.lower_network_priority", true],
-            ["channelclassifier.allowlist_example", true]]},
+  {"set": [["urlclassifier.trackingTable", "test-track-simple"],
+           ["privacy.trackingprotection.annotate_channels", true],
+           ["privacy.trackingprotection.lower_network_priority", true],
+           ["channelclassifier.allowlist_example", true]]},
   test);
 
 function test() {
   SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
   UrlClassifierTestUtils.addTestTrackers().then(() => {
     testOnWindow(false, function(aWindow) {
       testWindow = aWindow;
       testXHR().
--- a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html
@@ -46,18 +46,18 @@ function testOnWindow(contentPage, aCall
     whenDelayedStartupFinished(win, function() {
       win.addEventListener("DOMContentLoaded", function onInnerLoad() {
         if (win.content.location.href != contentPage) {
           win.gBrowser.loadURI(contentPage);
           return;
         }
         win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
 
-        win.content.addEventListener('load', function innerLoad2() {
-          win.content.removeEventListener('load', innerLoad2);
+        win.content.addEventListener("load", function innerLoad2() {
+          win.content.removeEventListener("load", innerLoad2);
           SimpleTest.executeSoon(function() { aCallback(win); });
         }, false, true);
       }, true);
       SimpleTest.executeSoon(function() { win.gBrowser.loadURI(contentPage); });
     });
   }, {capture: true, once: true});
 }
 
@@ -105,35 +105,35 @@ function checkLoads(aWindow, aWhiteliste
     }
 
     allNodeMatch = allNodeMatch && nodeMatch;
   }
   is(allNodeMatch, true, "All tracking nodes are expected to be annotated as such");
 }
 
 SpecialPowers.pushPrefEnv(
-  {"set" : [["privacy.trackingprotection.enabled", true],
-            ["channelclassifier.allowlist_example", true]]},
+  {"set": [["privacy.trackingprotection.enabled", true],
+           ["channelclassifier.allowlist_example", true]]},
   test);
 
 function test() {
   SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
   UrlClassifierTestUtils.addTestTrackers().then(() => {
     // Load the test from a URL on the whitelist
     testOnWindow(contentPage1, function(aWindow) {
       checkLoads(aWindow, true);
       aWindow.close();
 
       // Load the test from a URL that's NOT on the whitelist
       testOnWindow(contentPage2, function(aWindow) {
         checkLoads(aWindow, false);
         aWindow.close();
 
         // Load the test from a URL on the whitelist but without the whitelist
-        SpecialPowers.pushPrefEnv({"set" : [["urlclassifier.trackingWhitelistTable", ""]]},
+        SpecialPowers.pushPrefEnv({"set": [["urlclassifier.trackingWhitelistTable", ""]]},
           function() {
             testOnWindow(contentPage1, function(aWindow) {
               checkLoads(aWindow, false);
               aWindow.close();
               SimpleTest.finish();
             });
           });
 
--- a/toolkit/components/url-classifier/tests/mochitest/tracker.js
+++ b/toolkit/components/url-classifier/tests/mochitest/tracker.js
@@ -1,3 +1,3 @@
 function getTrackerTimeout() {
-  return window.setTimeout(function(){}, 0);
+  return window.setTimeout(function() {}, 0);
 }
--- a/toolkit/components/url-classifier/tests/mochitest/trackingRequest.js
+++ b/toolkit/components/url-classifier/tests/mochitest/trackingRequest.js
@@ -1,11 +1,10 @@
 
 window.addEventListener("message", function onMessage(evt) {
   if (evt.data.type === "doXHR") {
     var request = new XMLHttpRequest();
     request.open("GET", evt.data.url, true);
     request.send(null);
-  }
-  else if (evt.data.type === "doFetch") {
+  } else if (evt.data.type === "doFetch") {
     fetch(evt.data.url);
   }
 });
--- a/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
+++ b/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
@@ -36,21 +36,21 @@ prefBranch.setBoolPref("browser.safebrow
 prefBranch.setCharPref("urlclassifier.disallow_completions", "");
 
 // Hash completion timeout
 prefBranch.setIntPref("urlclassifier.gethash.timeout_ms", 5000);
 
 function delFile(name) {
   try {
     // Delete a previously created sqlite file
-    var file = dirSvc.get('ProfLD', Ci.nsIFile);
+    var file = dirSvc.get("ProfLD", Ci.nsIFile);
     file.append(name);
     if (file.exists())
       file.remove(false);
-  } catch(e) {
+  } catch (e) {
   }
 }
 
 function cleanUp() {
   delFile("urlclassifier3.sqlite");
   delFile("safebrowsing/classifier.hashkey");
   delFile("safebrowsing/test-phish-simple.sbstore");
   delFile("safebrowsing/test-malware-simple.sbstore");
@@ -98,99 +98,97 @@ function buildUpdate(update, hashSize) {
   var updateStr = "n:1000\n";
 
   for (var tableName in update) {
     if (tableName != "")
       updateStr += "i:" + tableName + "\n";
     var chunks = update[tableName];
     for (var j = 0; j < chunks.length; j++) {
       var chunk = chunks[j];
-      var chunkType = chunk.chunkType ? chunk.chunkType : 'a';
+      var chunkType = chunk.chunkType ? chunk.chunkType : "a";
       var chunkNum = chunk.chunkNum ? chunk.chunkNum : j;
-      updateStr += chunkType + ':' + chunkNum + ':' + hashSize;
+      updateStr += chunkType + ":" + chunkNum + ":" + hashSize;
 
       if (chunk.urls) {
         var chunkData = chunk.urls.join("\n");
         updateStr += ":" + chunkData.length + "\n" + chunkData;
       }
 
       updateStr += "\n";
     }
   }
 
   return updateStr;
 }
 
 function buildPhishingUpdate(chunks, hashSize) {
-  return buildUpdate({"test-phish-simple" : chunks}, hashSize);
+  return buildUpdate({"test-phish-simple": chunks}, hashSize);
 }
 
 function buildMalwareUpdate(chunks, hashSize) {
-  return buildUpdate({"test-malware-simple" : chunks}, hashSize);
+  return buildUpdate({"test-malware-simple": chunks}, hashSize);
 }
 
 function buildUnwantedUpdate(chunks, hashSize) {
-  return buildUpdate({"test-unwanted-simple" : chunks}, hashSize);
+  return buildUpdate({"test-unwanted-simple": chunks}, hashSize);
 }
 
 function buildBlockedUpdate(chunks, hashSize) {
-  return buildUpdate({"test-block-simple" : chunks}, hashSize);
+  return buildUpdate({"test-block-simple": chunks}, hashSize);
 }
 
 function buildMozPhishingUpdate(chunks, hashSize) {
-  return buildUpdate({"moz-phish-simple" : chunks}, hashSize);
+  return buildUpdate({"moz-phish-simple": chunks}, hashSize);
 }
 
 function buildBareUpdate(chunks, hashSize) {
-  return buildUpdate({"" : chunks}, hashSize);
+  return buildUpdate({"": chunks}, hashSize);
 }
 
 /**
  * Performs an update of the dbservice manually, bypassing the stream updater
  */
 function doSimpleUpdate(updateText, success, failure) {
   var listener = {
-    QueryInterface: function(iid)
-    {
+    QueryInterface(iid) {
       if (iid.equals(Ci.nsISupports) ||
           iid.equals(Ci.nsIUrlClassifierUpdateObserver))
         return this;
       throw Cr.NS_ERROR_NO_INTERFACE;
     },
 
-    updateUrlRequested: function(url) { },
-    streamFinished: function(status) { },
-    updateError: function(errorCode) { failure(errorCode); },
-    updateSuccess: function(requestedTimeout) { success(requestedTimeout); }
+    updateUrlRequested(url) { },
+    streamFinished(status) { },
+    updateError(errorCode) { failure(errorCode); },
+    updateSuccess(requestedTimeout) { success(requestedTimeout); }
   };
 
   dbservice.beginUpdate(listener, allTables);
   dbservice.beginStream("", "");
   dbservice.updateStream(updateText);
   dbservice.finishStream();
   dbservice.finishUpdate();
 }
 
 /**
  * Simulates a failed database update.
  */
 function doErrorUpdate(tables, success, failure) {
   var listener = {
-    QueryInterface: function(iid)
-    {
+    QueryInterface(iid) {
       if (iid.equals(Ci.nsISupports) ||
           iid.equals(Ci.nsIUrlClassifierUpdateObserver))
         return this;
       throw Cr.NS_ERROR_NO_INTERFACE;
     },
 
-    updateUrlRequested: function(url) { },
-    streamFinished: function(status) { },
-    updateError: function(errorCode) { success(errorCode); },
-    updateSuccess: function(requestedTimeout) { failure(requestedTimeout); }
+    updateUrlRequested(url) { },
+    streamFinished(status) { },
+    updateError(errorCode) { success(errorCode); },
+    updateSuccess(requestedTimeout) { failure(requestedTimeout); }
   };
 
   dbservice.beginUpdate(listener, tables, null);
   dbservice.beginStream("", "");
   dbservice.cancelUpdate();
 }
 
 /**
@@ -205,34 +203,32 @@ function doStreamUpdate(updateText, succ
   }
 
   streamUpdater.downloadUpdates(allTables, "", true,
                                 dataUpdate, success, failure, downloadFailure);
 }
 
 var gAssertions = {
 
-tableData : function(expectedTables, cb)
-{
+tableData(expectedTables, cb) {
   dbservice.getTables(function(tables) {
       // rebuild the tables in a predictable order.
       var parts = tables.split("\n");
-      while (parts[parts.length - 1] == '') {
+      while (parts[parts.length - 1] == "") {
         parts.pop();
       }
       parts.sort();
       tables = parts.join("\n");
 
       do_check_eq(tables, expectedTables);
       cb();
     });
 },
 
-checkUrls: function(urls, expected, cb, useMoz = false)
-{
+checkUrls(urls, expected, cb, useMoz = false) {
   // work with a copy of the list.
   urls = urls.slice(0);
   var doLookup = function() {
     if (urls.length > 0) {
       var tables = useMoz ? mozTables : allTables;
       var fragment = urls.shift();
       var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + fragment), {});
       dbservice.lookup(principal, tables,
@@ -242,102 +238,90 @@ checkUrls: function(urls, expected, cb, 
                                 }, true);
     } else {
       cb();
     }
   };
   doLookup();
 },
 
-checkTables: function(url, expected, cb)
-{
+checkTables(url, expected, cb) {
   var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + url), {});
   dbservice.lookup(principal, allTables, function(tables) {
     // Rebuild tables in a predictable order.
     var parts = tables.split(",");
-    while (parts[parts.length - 1] == '') {
+    while (parts[parts.length - 1] == "") {
       parts.pop();
     }
     parts.sort();
     tables = parts.join(",");
     do_check_eq(tables, expected);
     cb();
   }, true);
 },
 
-urlsDontExist: function(urls, cb)
-{
-  this.checkUrls(urls, '', cb);
+urlsDontExist(urls, cb) {
+  this.checkUrls(urls, "", cb);
 },
 
-urlsExist: function(urls, cb)
-{
-  this.checkUrls(urls, 'test-phish-simple', cb);
+urlsExist(urls, cb) {
+  this.checkUrls(urls, "test-phish-simple", cb);
 },
 
-malwareUrlsExist: function(urls, cb)
-{
-  this.checkUrls(urls, 'test-malware-simple', cb);
+malwareUrlsExist(urls, cb) {
+  this.checkUrls(urls, "test-malware-simple", cb);
 },
 
-unwantedUrlsExist: function(urls, cb)
-{
-  this.checkUrls(urls, 'test-unwanted-simple', cb);
+unwantedUrlsExist(urls, cb) {
+  this.checkUrls(urls, "test-unwanted-simple", cb);
 },
 
-blockedUrlsExist: function(urls, cb)
-{
-  this.checkUrls(urls, 'test-block-simple', cb);
+blockedUrlsExist(urls, cb) {
+  this.checkUrls(urls, "test-block-simple", cb);
 },
 
-mozPhishingUrlsExist: function(urls, cb)
-{
-  this.checkUrls(urls, 'moz-phish-simple', cb, true);
+mozPhishingUrlsExist(urls, cb) {
+  this.checkUrls(urls, "moz-phish-simple", cb, true);
 },
 
-subsDontExist: function(urls, cb)
-{
+subsDontExist(urls, cb) {
   // XXX: there's no interface for checking items in the subs table
   cb();
 },
 
-subsExist: function(urls, cb)
-{
+subsExist(urls, cb) {
   // XXX: there's no interface for checking items in the subs table
   cb();
 },
 
-urlExistInMultipleTables: function(data, cb)
-{
-  this.checkTables(data["url"], data["tables"], cb);
+urlExistInMultipleTables(data, cb) {
+  this.checkTables(data.url, data.tables, cb);
 }
 
 };
 
 /**
  * Check a set of assertions against the gAssertions table.
  */
-function checkAssertions(assertions, doneCallback)
-{
+function checkAssertions(assertions, doneCallback) {
   var checkAssertion = function() {
     for (var i in assertions) {
       var data = assertions[i];
       delete assertions[i];
       gAssertions[i](data, checkAssertion);
       return;
     }
 
     doneCallback();
   }
 
   checkAssertion();
 }
 
-function updateError(arg)
-{
+function updateError(arg) {
   do_throw(arg);
 }
 
 // Runs a set of updates, and then checks a set of assertions.
 function doUpdateTest(updates, assertions, successCallback, errorCallback) {
   var errorUpdate = function() {
     checkAssertions(assertions, errorCallback);
   }
@@ -352,54 +336,52 @@ function doUpdateTest(updates, assertion
   }
 
   runUpdate();
 }
 
 var gTests;
 var gNextTest = 0;
 
-function runNextTest()
-{
+function runNextTest() {
   if (gNextTest >= gTests.length) {
     do_test_finished();
     return;
   }
 
   dbservice.resetDatabase();
-  dbservice.setHashCompleter('test-phish-simple', null);
+  dbservice.setHashCompleter("test-phish-simple", null);
 
   let test = gTests[gNextTest++];
   dump("running " + test.name + "\n");
   test();
 }
 
-function runTests(tests)
-{
+function runTests(tests) {
   gTests = tests;
   runNextTest();
 }
 
 var timerArray = [];
 
 function Timer(delay, cb) {
   this.cb = cb;
   var timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
   timer.initWithCallback(this, delay, timer.TYPE_ONE_SHOT);
   timerArray.push(timer);
 }
 
 Timer.prototype = {
-QueryInterface: function(iid) {
+QueryInterface(iid) {
     if (!iid.equals(Ci.nsISupports) && !iid.equals(Ci.nsITimerCallback)) {
       throw Cr.NS_ERROR_NO_INTERFACE;
     }
     return this;
   },
-notify: function(timer) {
+notify(timer) {
     this.cb();
   }
 }
 
 // LFSRgenerator is a 32-bit linear feedback shift register random number
 // generator. It is highly predictable and is not intended to be used for
 // cryptography but rather to allow easier debugging than a test that uses
 // Math.random().
@@ -409,17 +391,17 @@ function LFSRgenerator(seed) {
   // LFSR generators do not work with a value of 0.
   if (seed == 0)
     seed = 1;
 
   this._value = seed;
 }
 LFSRgenerator.prototype = {
   // nextNum returns a random unsigned integer of in the range [0,2^|bits|].
-  nextNum: function(bits) {
+  nextNum(bits) {
     if (!bits)
       bits = 32;
 
     let val = this._value;
     // Taps are 32, 22, 2 and 1.
     let bit = ((val >>> 0) ^ (val >>> 10) ^ (val >>> 30) ^ (val >>> 31)) & 1;
     val = (val >>> 1) | (bit << 31);
     this._value = val;
@@ -441,23 +423,23 @@ function waitUntilMetaDataSaved(expected
       if (-1 === p) {
         return false; // continue.
       }
       let tableName = line.substring(0, p);
       let metadata = line.substring(p + 1).split(":");
       let stateBase64 = metadata[0];
       let checksumBase64 = metadata[1];
 
-      if (tableName !== 'test-phish-proto') {
+      if (tableName !== "test-phish-proto") {
         return false; // continue.
       }
 
       if (stateBase64 === btoa(expectedState) &&
           checksumBase64 === btoa(expectedChecksum)) {
-        do_print('State has been saved to disk!');
+        do_print("State has been saved to disk!");
 
         // We slightly defer the callback to see if the in-memory
         // |getTables| caching works correctly.
         dbService.getTables(cachedMetadata => {
           equal(cachedMetadata, metaData);
           callback();
         });
 
--- a/toolkit/components/url-classifier/tests/unit/test_addsub.js
+++ b/toolkit/components/url-classifier/tests/unit/test_addsub.js
@@ -1,478 +1,466 @@
 
-function doTest(updates, assertions)
-{
+function doTest(updates, assertions) {
   doUpdateTest(updates, assertions, runNextTest, updateError);
 }
 
 // Test an add of two urls to a fresh database
 function testSimpleAdds() {
   var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : addUrls
+          { "chunkNum": 1,
+            "urls": addUrls
           }]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsExist" : addUrls
+    "tableData": "test-phish-simple;a:1",
+    "urlsExist": addUrls
   };
 
   doTest([update], assertions);
 }
 
 // Same as testSimpleAdds, but make the same-domain URLs come from different
 // chunks.
 function testMultipleAdds() {
   var add1Urls = [ "foo.com/a", "bar.com/c" ];
   var add2Urls = [ "foo.com/b" ];
 
   var update = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
-       "urls" : add1Urls },
-      { "chunkNum" : 2,
-        "urls" : add2Urls }]);
+    [{ "chunkNum": 1,
+       "urls": add1Urls },
+      { "chunkNum": 2,
+        "urls": add2Urls }]);
   var assertions = {
-    "tableData" : "test-phish-simple;a:1-2",
-    "urlsExist" : add1Urls.concat(add2Urls)
+    "tableData": "test-phish-simple;a:1-2",
+    "urlsExist": add1Urls.concat(add2Urls)
   };
 
   doTest([update], assertions);
 }
 
 // Test that a sub will remove an existing add
-function testSimpleSub()
-{
+function testSimpleSub() {
   var addUrls = ["foo.com/a", "bar.com/b"];
   var subUrls = ["1:foo.com/a"];
 
   var addUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 1, // adds and subtracts don't share a chunk numbering space
+    [{ "chunkNum": 1, // adds and subtracts don't share a chunk numbering space
        "urls": addUrls }]);
 
   var subUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 50,
-       "chunkType" : "s",
+    [{ "chunkNum": 50,
+       "chunkType": "s",
        "urls": subUrls }]);
 
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1:s:50",
-    "urlsExist" : [ "bar.com/b" ],
+    "tableData": "test-phish-simple;a:1:s:50",
+    "urlsExist": [ "bar.com/b" ],
     "urlsDontExist": ["foo.com/a" ],
-    "subsDontExist" : [ "foo.com/a" ]
+    "subsDontExist": [ "foo.com/a" ]
   }
 
   doTest([addUpdate, subUpdate], assertions);
 
 }
 
 // Same as testSimpleSub(), but the sub comes in before the add.
-function testSubEmptiesAdd()
-{
+function testSubEmptiesAdd() {
   var subUrls = ["1:foo.com/a"];
   var addUrls = ["foo.com/a", "bar.com/b"];
 
   var subUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 50,
-       "chunkType" : "s",
+    [{ "chunkNum": 50,
+       "chunkType": "s",
        "urls": subUrls }]);
 
   var addUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
+    [{ "chunkNum": 1,
        "urls": addUrls }]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1:s:50",
-    "urlsExist" : [ "bar.com/b" ],
+    "tableData": "test-phish-simple;a:1:s:50",
+    "urlsExist": [ "bar.com/b" ],
     "urlsDontExist": ["foo.com/a" ],
-    "subsDontExist" : [ "foo.com/a" ] // this sub was found, it shouldn't exist anymore
+    "subsDontExist": [ "foo.com/a" ] // this sub was found, it shouldn't exist anymore
   }
 
   doTest([subUpdate, addUpdate], assertions);
 }
 
 // Very similar to testSubEmptiesAdd, except that the domain entry will
 // still have an item left over that needs to be synced.
-function testSubPartiallyEmptiesAdd()
-{
+function testSubPartiallyEmptiesAdd() {
   var subUrls = ["1:foo.com/a"];
   var addUrls = ["foo.com/a", "foo.com/b", "bar.com/b"];
 
   var subUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
-       "chunkType" : "s",
+    [{ "chunkNum": 1,
+       "chunkType": "s",
        "urls": subUrls }]);
 
   var addUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 1, // adds and subtracts don't share a chunk numbering space
+    [{ "chunkNum": 1, // adds and subtracts don't share a chunk numbering space
        "urls": addUrls }]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1:s:1",
-    "urlsExist" : [ "foo.com/b", "bar.com/b" ],
-    "urlsDontExist" : ["foo.com/a" ],
-    "subsDontExist" : [ "foo.com/a" ] // this sub was found, it shouldn't exist anymore
+    "tableData": "test-phish-simple;a:1:s:1",
+    "urlsExist": [ "foo.com/b", "bar.com/b" ],
+    "urlsDontExist": ["foo.com/a" ],
+    "subsDontExist": [ "foo.com/a" ] // this sub was found, it shouldn't exist anymore
   }
 
   doTest([subUpdate, addUpdate], assertions);
 }
 
 // We SHOULD be testing that pending subs are removed using
 // subsDontExist assertions.  Since we don't have a good interface for getting
 // at sub entries, we'll verify it by side-effect.  Subbing a url once
 // then adding it twice should leave the url intact.
-function testPendingSubRemoved()
-{
+function testPendingSubRemoved() {
   var subUrls = ["1:foo.com/a", "2:foo.com/b"];
   var addUrls = ["foo.com/a", "foo.com/b"];
 
   var subUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
-       "chunkType" : "s",
+    [{ "chunkNum": 1,
+       "chunkType": "s",
        "urls": subUrls }]);
 
   var addUpdate1 = buildPhishingUpdate(
-    [{ "chunkNum" : 1, // adds and subtracts don't share a chunk numbering space
+    [{ "chunkNum": 1, // adds and subtracts don't share a chunk numbering space
        "urls": addUrls }]);
 
   var addUpdate2 = buildPhishingUpdate(
-    [{ "chunkNum" : 2,
+    [{ "chunkNum": 2,
        "urls": addUrls }]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1-2:s:1",
-    "urlsExist" : [ "foo.com/a", "foo.com/b" ],
-    "subsDontExist" : [ "foo.com/a", "foo.com/b" ] // this sub was found, it shouldn't exist anymore
+    "tableData": "test-phish-simple;a:1-2:s:1",
+    "urlsExist": [ "foo.com/a", "foo.com/b" ],
+    "subsDontExist": [ "foo.com/a", "foo.com/b" ] // this sub was found, it shouldn't exist anymore
   }
 
   doTest([subUpdate, addUpdate1, addUpdate2], assertions);
 }
 
 // Make sure that a saved sub is removed when the sub chunk is expired.
-function testPendingSubExpire()
-{
+function testPendingSubExpire() {
   var subUrls = ["1:foo.com/a", "1:foo.com/b"];
   var addUrls = ["foo.com/a", "foo.com/b"];
 
   var subUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
-       "chunkType" : "s",
+    [{ "chunkNum": 1,
+       "chunkType": "s",
        "urls": subUrls }]);
 
   var expireUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
-       "chunkType" : "sd" }]);
+    [{ "chunkNum": 1,
+       "chunkType": "sd" }]);
 
   var addUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 1, // adds and subtracts don't share a chunk numbering space
+    [{ "chunkNum": 1, // adds and subtracts don't share a chunk numbering space
        "urls": addUrls }]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsExist" : [ "foo.com/a", "foo.com/b" ],
-    "subsDontExist" : [ "foo.com/a", "foo.com/b" ] // this sub was expired
+    "tableData": "test-phish-simple;a:1",
+    "urlsExist": [ "foo.com/a", "foo.com/b" ],
+    "subsDontExist": [ "foo.com/a", "foo.com/b" ] // this sub was expired
   }
 
   doTest([subUpdate, expireUpdate, addUpdate], assertions);
 }
 
 // Make sure that the sub url removes from only the chunk that it specifies
-function testDuplicateAdds()
-{
+function testDuplicateAdds() {
   var urls = ["foo.com/a"];
 
   var addUpdate1 = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
+    [{ "chunkNum": 1,
        "urls": urls }]);
   var addUpdate2 = buildPhishingUpdate(
-    [{ "chunkNum" : 2,
+    [{ "chunkNum": 2,
        "urls": urls }]);
   var subUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 3,
-       "chunkType" : "s",
+    [{ "chunkNum": 3,
+       "chunkType": "s",
        "urls": ["2:foo.com/a"]}]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1-2:s:3",
-    "urlsExist" : [ "foo.com/a"],
-    "subsDontExist" : [ "foo.com/a"]
+    "tableData": "test-phish-simple;a:1-2:s:3",
+    "urlsExist": [ "foo.com/a"],
+    "subsDontExist": [ "foo.com/a"]
   }
 
   doTest([addUpdate1, addUpdate2, subUpdate], assertions);
 }
 
 // Tests a sub which matches some existing adds but leaves others.
-function testSubPartiallyMatches()
-{
+function testSubPartiallyMatches() {
   var subUrls = ["foo.com/a"];
   var addUrls = ["1:foo.com/a", "2:foo.com/b"];
 
   var addUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
-       "urls" : addUrls }]);
+    [{ "chunkNum": 1,
+       "urls": addUrls }]);
 
   var subUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
-       "chunkType" : "s",
-       "urls" : addUrls }]);
+    [{ "chunkNum": 1,
+       "chunkType": "s",
+       "urls": addUrls }]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1:s:1",
-    "urlsDontExist" : ["foo.com/a"],
-    "subsDontExist" : ["foo.com/a"],
-    "subsExist" : ["foo.com/b"]
+    "tableData": "test-phish-simple;a:1:s:1",
+    "urlsDontExist": ["foo.com/a"],
+    "subsDontExist": ["foo.com/a"],
+    "subsExist": ["foo.com/b"]
   };
 
   doTest([addUpdate, subUpdate], assertions);
 }
 
 // XXX: because subsExist isn't actually implemented, this is the same
 // test as above but with a second add chunk that should fail to be added
 // because of a pending sub chunk.
-function testSubPartiallyMatches2()
-{
+function testSubPartiallyMatches2() {
   var addUrls = ["foo.com/a"];
   var subUrls = ["1:foo.com/a", "2:foo.com/b"];
   var addUrls2 = ["foo.com/b"];
 
   var addUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
-       "urls" : addUrls }]);
+    [{ "chunkNum": 1,
+       "urls": addUrls }]);
 
   var subUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
-       "chunkType" : "s",
-       "urls" : subUrls }]);
+    [{ "chunkNum": 1,
+       "chunkType": "s",
+       "urls": subUrls }]);
 
   var addUpdate2 = buildPhishingUpdate(
-    [{ "chunkNum" : 2,
-       "urls" : addUrls2 }]);
+    [{ "chunkNum": 2,
+       "urls": addUrls2 }]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1-2:s:1",
-    "urlsDontExist" : ["foo.com/a", "foo.com/b"],
-    "subsDontExist" : ["foo.com/a", "foo.com/b"]
+    "tableData": "test-phish-simple;a:1-2:s:1",
+    "urlsDontExist": ["foo.com/a", "foo.com/b"],
+    "subsDontExist": ["foo.com/a", "foo.com/b"]
   };
 
   doTest([addUpdate, subUpdate, addUpdate2], assertions);
 }
 
 // Verify that two subs for the same domain but from different chunks
 // match (tests that existing sub entries are properly updated)
 function testSubsDifferentChunks() {
   var subUrls1 = [ "3:foo.com/a" ];
   var subUrls2 = [ "3:foo.com/b" ];
 
   var addUrls = [ "foo.com/a", "foo.com/b", "foo.com/c" ];
 
   var subUpdate1 = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
-       "chunkType" : "s",
+    [{ "chunkNum": 1,
+       "chunkType": "s",
        "urls": subUrls1 }]);
   var subUpdate2 = buildPhishingUpdate(
-    [{ "chunkNum" : 2,
-       "chunkType" : "s",
-       "urls" : subUrls2 }]);
+    [{ "chunkNum": 2,
+       "chunkType": "s",
+       "urls": subUrls2 }]);
   var addUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 3,
-       "urls" : addUrls }]);
+    [{ "chunkNum": 3,
+       "urls": addUrls }]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:3:s:1-2",
-    "urlsExist" : [ "foo.com/c" ],
-    "urlsDontExist" : [ "foo.com/a", "foo.com/b" ],
-    "subsDontExist" : [ "foo.com/a", "foo.com/b" ]
+    "tableData": "test-phish-simple;a:3:s:1-2",
+    "urlsExist": [ "foo.com/c" ],
+    "urlsDontExist": [ "foo.com/a", "foo.com/b" ],
+    "subsDontExist": [ "foo.com/a", "foo.com/b" ]
   };
 
   doTest([subUpdate1, subUpdate2, addUpdate], assertions);
 }
 
 // for bug 534079
 function testSubsDifferentChunksSameHostId() {
   var subUrls1 = [ "1:foo.com/a" ];
   var subUrls2 = [ "1:foo.com/b", "2:foo.com/c" ];
 
   var addUrls = [ "foo.com/a", "foo.com/b" ];
   var addUrls2 = [ "foo.com/c" ];
 
   var subUpdate1 = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
-       "chunkType" : "s",
+    [{ "chunkNum": 1,
+       "chunkType": "s",
        "urls": subUrls1 }]);
   var subUpdate2 = buildPhishingUpdate(
-    [{ "chunkNum" : 2,
-       "chunkType" : "s",
-       "urls" : subUrls2 }]);
+    [{ "chunkNum": 2,
+       "chunkType": "s",
+       "urls": subUrls2 }]);
 
   var addUpdate = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
-       "urls" : addUrls }]);
+    [{ "chunkNum": 1,
+       "urls": addUrls }]);
   var addUpdate2 = buildPhishingUpdate(
-    [{ "chunkNum" : 2,
-       "urls" : addUrls2 }]);
+    [{ "chunkNum": 2,
+       "urls": addUrls2 }]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1-2:s:1-2",
-    "urlsDontExist" : [ "foo.com/c", "foo.com/b", "foo.com/a", ],
+    "tableData": "test-phish-simple;a:1-2:s:1-2",
+    "urlsDontExist": [ "foo.com/c", "foo.com/b", "foo.com/a", ],
   };
 
   doTest([addUpdate, addUpdate2, subUpdate1, subUpdate2], assertions);
 }
 
 // Test lists of expired chunks
 function testExpireLists() {
   var addUpdate = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : [ "foo.com/a" ]
+          { "chunkNum": 1,
+            "urls": [ "foo.com/a" ]
           },
-          { "chunkNum" : 3,
-            "urls" : [ "bar.com/a" ]
+          { "chunkNum": 3,
+            "urls": [ "bar.com/a" ]
           },
-          { "chunkNum" : 4,
-            "urls" : [ "baz.com/a" ]
+          { "chunkNum": 4,
+            "urls": [ "baz.com/a" ]
           },
-          { "chunkNum" : 5,
-            "urls" : [ "blah.com/a" ]
+          { "chunkNum": 5,
+            "urls": [ "blah.com/a" ]
           },
           ]);
   var subUpdate = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "chunkType" : "s",
-            "urls" : [ "50:foo.com/1" ]
+          { "chunkNum": 1,
+            "chunkType": "s",
+            "urls": [ "50:foo.com/1" ]
           },
-          { "chunkNum" : 2,
-            "chunkType" : "s",
-            "urls" : [ "50:bar.com/1" ]
+          { "chunkNum": 2,
+            "chunkType": "s",
+            "urls": [ "50:bar.com/1" ]
           },
-          { "chunkNum" : 3,
-            "chunkType" : "s",
-            "urls" : [ "50:baz.com/1" ]
+          { "chunkNum": 3,
+            "chunkType": "s",
+            "urls": [ "50:baz.com/1" ]
           },
-          { "chunkNum" : 5,
-            "chunkType" : "s",
-            "urls" : [ "50:blah.com/1" ]
+          { "chunkNum": 5,
+            "chunkType": "s",
+            "urls": [ "50:blah.com/1" ]
           },
           ]);
 
   var expireUpdate = buildPhishingUpdate(
-    [ { "chunkType" : "ad:1,3-5" },
-      { "chunkType" : "sd:1-3,5" }]);
+    [ { "chunkType": "ad:1,3-5" },
+      { "chunkType": "sd:1-3,5" }]);
 
   var assertions = {
     //    "tableData" : "test-phish-simple;"
     "tableData": ""
   };
 
   doTest([addUpdate, subUpdate, expireUpdate], assertions);
 }
 
 // Test a duplicate add chunk.
 function testDuplicateAddChunks() {
   var addUrls1 = [ "foo.com/a" ];
   var addUrls2 = [ "bar.com/b" ];
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : addUrls1
+          { "chunkNum": 1,
+            "urls": addUrls1
           },
-          { "chunkNum" : 1,
-            "urls" : addUrls2
+          { "chunkNum": 1,
+            "urls": addUrls2
           }]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsExist" : addUrls1,
-    "urlsDontExist" : addUrls2
+    "tableData": "test-phish-simple;a:1",
+    "urlsExist": addUrls1,
+    "urlsDontExist": addUrls2
   };
 
   doTest([update], assertions);
 }
 
 // This test is a bit tricky.  We want to test that an add removes all
 // subs with the same add chunk id, even if there is no match.  To do
 // that we need to add the same add chunk twice, with an expiration
 // in the middle.  This would be easier if subsDontExist actually
 // worked...
-function testExpireWholeSub()
-{
+function testExpireWholeSub() {
   var subUrls = ["1:foo.com/a"];
 
   var update = buildPhishingUpdate(
-        [{ "chunkNum" : 5,
-           "chunkType" : "s",
-           "urls" : subUrls
+        [{ "chunkNum": 5,
+           "chunkType": "s",
+           "urls": subUrls
           },
           // empty add chunk should still cause foo.com/a to go away.
-          { "chunkNum" : 1,
-            "urls" : []
+          { "chunkNum": 1,
+            "urls": []
           },
           // and now adding chunk 1 again with foo.com/a should succeed,
           // because the sub should have been expired with the empty
           // add chunk.
 
           // we need to expire this chunk to let us add chunk 1 again.
           {
-            "chunkType" : "ad:1"
+            "chunkType": "ad:1"
           },
-          { "chunkNum" : 1,
-            "urls" : [ "foo.com/a" ]
+          { "chunkNum": 1,
+            "urls": [ "foo.com/a" ]
           }]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1:s:5",
-    "urlsExist" : ["foo.com/a"]
+    "tableData": "test-phish-simple;a:1:s:5",
+    "urlsExist": ["foo.com/a"]
   };
 
   doTest([update], assertions);
 }
 
 
 // This test is roughly the opposite of testExpireWholeSub().  We add
 // the empty add first, and make sure that it prevents a sub for that
 // add from being applied.
-function testPreventWholeSub()
-{
+function testPreventWholeSub() {
   var subUrls = ["1:foo.com/a"];
 
   var update = buildPhishingUpdate(
         [  // empty add chunk should cause foo.com/a to not be saved
-          { "chunkNum" : 1,
-            "urls" : []
+          { "chunkNum": 1,
+            "urls": []
           },
-          { "chunkNum" : 5,
-           "chunkType" : "s",
-           "urls" : subUrls
+          { "chunkNum": 5,
+           "chunkType": "s",
+           "urls": subUrls
           },
           // and now adding chunk 1 again with foo.com/a should succeed,
           // because the sub should have been expired with the empty
           // add chunk.
 
           // we need to expire this chunk to let us add chunk 1 again.
           {
-            "chunkType" : "ad:1"
+            "chunkType": "ad:1"
           },
-          { "chunkNum" : 1,
-            "urls" : [ "foo.com/a" ]
+          { "chunkNum": 1,
+            "urls": [ "foo.com/a" ]
           }]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1:s:5",
-    "urlsExist" : ["foo.com/a"]
+    "tableData": "test-phish-simple;a:1:s:5",
+    "urlsExist": ["foo.com/a"]
   };
 
   doTest([update], assertions);
 }
 
-function run_test()
-{
+function run_test() {
   runTests([
     testSimpleAdds,
     testMultipleAdds,
     testSimpleSub,
     testSubEmptiesAdd,
     testSubPartiallyEmptiesAdd,
     testPendingSubRemoved,
     testPendingSubExpire,
--- a/toolkit/components/url-classifier/tests/unit/test_bug1274685_unowned_list.js
+++ b/toolkit/components/url-classifier/tests/unit/test_bug1274685_unowned_list.js
@@ -8,25 +8,25 @@ Cu.import("resource://testing-common/App
 updateAppInfo();
 
 function run_test() {
   SafeBrowsing.init();
 
   let origList = Services.prefs.getCharPref("browser.safebrowsing.provider.google.lists");
 
   // Remove 'goog-malware-shavar' from the original.
-  let trimmedList = origList.replace('goog-malware-shavar,', '');
+  let trimmedList = origList.replace("goog-malware-shavar,", "");
   Services.prefs.setCharPref("browser.safebrowsing.provider.google.lists", trimmedList);
 
   try {
     // Bug 1274685 - Unowned Safe Browsing tables break list updates
     //
     // If SafeBrowsing.registerTableWithURLs() doesn't check if
     // a provider is found before registering table, an exception
     // will be thrown while accessing a null object.
     //
     SafeBrowsing.registerTables();
   } catch (e) {
-    ok(false, 'Exception thrown due to ' + e.toString());
+    ok(false, "Exception thrown due to " + e.toString());
   }
 
   Services.prefs.setCharPref("browser.safebrowsing.provider.google.lists", origList);
 }
--- a/toolkit/components/url-classifier/tests/unit/test_dbservice.js
+++ b/toolkit/components/url-classifier/tests/unit/test_dbservice.js
@@ -100,53 +100,50 @@ phishExpected["foo.bar.baz.com/foo"] = t
 phishExpected["bar.baz.com/"] = true;
 
 var numExpecting;
 
 function testFailure(arg) {
   do_throw(arg);
 }
 
-function checkNoHost()
-{
+function checkNoHost() {
   // Looking up a no-host uri such as a data: uri should throw an exception.
   var exception;
   try {
     var principal = secMan.createCodebasePrincipal(iosvc.newURI("data:text/html,<b>test</b>"), {});
     dbservice.lookup(principal, allTables);
 
     exception = false;
-  } catch(e) {
+  } catch (e) {
     exception = true;
   }
   do_check_true(exception);
 
   do_test_finished();
 }
 
-function tablesCallbackWithoutSub(tables)
-{
+function tablesCallbackWithoutSub(tables) {
   var parts = tables.split("\n");
   parts.sort();
 
   // there's a leading \n here because splitting left an empty string
   // after the trailing newline, which will sort first
   do_check_eq(parts.join("\n"),
               "\ntest-block-simple;a:1\ntest-malware-simple;a:1\ntest-phish-simple;a:2\ntest-unwanted-simple;a:1");
 
   checkNoHost();
 }
 
 
 function expireSubSuccess(result) {
   dbservice.getTables(tablesCallbackWithoutSub);
 }
 
-function tablesCallbackWithSub(tables)
-{
+function tablesCallbackWithSub(tables) {
   var parts = tables.split("\n");
   parts.sort();
 
   // there's a leading \n here because splitting left an empty string
   // after the trailing newline, which will sort first
   do_check_eq(parts.join("\n"),
               "\ntest-block-simple;a:1\ntest-malware-simple;a:1\ntest-phish-simple;a:2:s:3\ntest-unwanted-simple;a:1");
 
@@ -154,18 +151,17 @@ function tablesCallbackWithSub(tables)
   var data =
     "n:1000\n" +
     "i:test-phish-simple\n" +
     "sd:3\n";
 
   doSimpleUpdate(data, expireSubSuccess, testFailure);
 }
 
-function checkChunksWithSub()
-{
+function checkChunksWithSub() {
   dbservice.getTables(tablesCallbackWithSub);
 }
 
 function checkDone() {
   if (--numExpecting == 0)
     checkChunksWithSub();
 }
 
@@ -212,18 +208,17 @@ function blockedExists(result) {
 
   try {
     do_check_true(result.indexOf("test-block-simple") != -1);
   } finally {
     checkDone();
   }
 }
 
-function checkState()
-{
+function checkState() {
   numExpecting = 0;
 
 
   for (var key in phishExpected) {
     var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key), {});
     dbservice.lookup(principal, allTables, phishExists, true);
     numExpecting++;
   }
@@ -248,18 +243,17 @@ function checkState()
 
   for (var key in blockedExpected) {
     var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key), {});
     dbservice.lookup(principal, allTables, blockedExists, true);
     numExpecting++;
   }
 }
 
-function testSubSuccess(result)
-{
+function testSubSuccess(result) {
   do_check_eq(result, "1000");
   checkState();
 }
 
 function do_subs() {
   var data =
     "n:1000\n" +
     "i:test-phish-simple\n" +
--- a/toolkit/components/url-classifier/tests/unit/test_hashcompleter.js
+++ b/toolkit/components/url-classifier/tests/unit/test_hashcompleter.js
@@ -189,17 +189,17 @@ function getRandomCompletionSet(forceSer
     // convert it to a string.
     let hash;
     let prefix;
     do {
       hash = "";
       let length = 1 + rand.nextNum(5);
       for (let i = 0; i < length; i++)
         hash += String.fromCharCode(rand.nextNum(8));
-      prefix = hash.substring(0,4);
+      prefix = hash.substring(0, 4);
     } while (hashPrefixes.indexOf(prefix) != -1);
 
     hashPrefixes.push(prefix);
     completion.hash = hash;
 
     if (!forceServerError) {
       completion.expectCompletion = rand.nextNum(1) == 1;
     } else {
@@ -256,18 +256,17 @@ function run_test() {
   for (let completionSet of completionSets) {
     for (let completion of completionSet) {
       // Pad the right of each |hash| so that the length is COMPLETE_LENGTH.
       if (completion.multipleCompletions) {
         for (let responseCompletion of completion.completions) {
           let numChars = COMPLETE_LENGTH - responseCompletion.hash.length;
           responseCompletion.hash += (new Array(numChars + 1)).join("\u0000");
         }
-      }
-      else {
+      } else {
         let numChars = COMPLETE_LENGTH - completion.hash.length;
         completion.hash += (new Array(numChars + 1)).join("\u0000");
       }
     }
   }
   do_test_pending();
 
   server = new HttpServer();
@@ -290,17 +289,17 @@ function runNextCompletion() {
     return;
   }
 
   dump("Now on completion set index " + currentCompletionSet + ", length " +
        completionSets[currentCompletionSet].length + "\n");
   // Number of finished completions for this set.
   finishedCompletions = 0;
   for (let completion of completionSets[currentCompletionSet]) {
-    completer.complete(completion.hash.substring(0,4), gethashUrl,
+    completer.complete(completion.hash.substring(0, 4), gethashUrl,
                        "test-phish-shavar", // Could be arbitrary v2 table name.
                        (new callback(completion)));
   }
 }
 
 function hashCompleterServer(aRequest, aResponse) {
   let stream = aRequest.bodyInputStream;
   let wrapperStream = Cc["@mozilla.org/binaryinputstream;1"].
@@ -367,18 +366,17 @@ callback.prototype = {
           completion._completed = true;
 
           if (this._completion.completions.every(x => x._completed))
             this._completed = true;
 
           break;
         }
       }
-    }
-    else {
+    } else {
       // Hashes are not actually strings and can contain arbitrary data.
       do_check_eq(JSON.stringify(hash), JSON.stringify(this._completion.hash));
       do_check_eq(table, this._completion.table);
       do_check_eq(chunkId, this._completion.chunkId);
 
       this._completed = true;
     }
   },
--- a/toolkit/components/url-classifier/tests/unit/test_listmanager.js
+++ b/toolkit/components/url-classifier/tests/unit/test_listmanager.js
@@ -63,18 +63,18 @@ let gExpectedQueryV4 = "";
 // Handles request for TEST_TABLE_DATA_V4.
 let gHttpServV4 = null;
 
 // These two variables are used to synchronize the last two racing updates
 // (in terms of "update URL") in test_update_all_tables().
 let gUpdatedCntForTableData = 0; // For TEST_TABLE_DATA_LIST.
 let gIsV4Updated = false;   // For TEST_TABLE_DATA_V4.
 
-const NEW_CLIENT_STATE = 'sta\0te';
-const CHECKSUM = '\x30\x67\xc7\x2c\x5e\x50\x1c\x31\xe3\xfe\xca\x73\xf0\x47\xdc\x34\x1a\x95\x63\x99\xec\x70\x5e\x0a\xee\x9e\xfb\x17\xa1\x55\x35\x78';
+const NEW_CLIENT_STATE = "sta\0te";
+const CHECKSUM = "\x30\x67\xc7\x2c\x5e\x50\x1c\x31\xe3\xfe\xca\x73\xf0\x47\xdc\x34\x1a\x95\x63\x99\xec\x70\x5e\x0a\xee\x9e\xfb\x17\xa1\x55\x35\x78";
 
 prefBranch.setBoolPref("browser.safebrowsing.debug", true);
 
 // The "\xFF\xFF" is to generate a base64 string with "/".
 prefBranch.setCharPref("browser.safebrowsing.id", "Firefox\xFF\xFF");
 
 // Register tables.
 TEST_TABLE_DATA_LIST.forEach(function(t) {
@@ -179,17 +179,17 @@ add_test(function test_partialUpdateV4()
                                                 1);
   gExpectedQueryV4 = "&$req=" + requestV4;
 
   forceTableUpdate();
 });
 
 // Tests nsIUrlListManager.getGethashUrl.
 add_test(function test_getGethashUrl() {
-  TEST_TABLE_DATA_LIST.forEach(function (t) {
+  TEST_TABLE_DATA_LIST.forEach(function(t) {
     equal(gListManager.getGethashUrl(t.tableName), t.gethashUrl);
   });
   equal(gListManager.getGethashUrl(TEST_TABLE_DATA_V4.tableName),
         TEST_TABLE_DATA_V4.gethashUrl);
   run_next_test();
 });
 
 function run_test() {
@@ -240,18 +240,18 @@ function run_test() {
     // Not on the spec. Found in Chromium source code...
     equal(request.getHeader("X-HTTP-Method-Override"), "POST");
 
     // V4 update request uses GET.
     equal(request.method, "GET");
 
     // V4 append the base64 encoded request to the query string.
     equal(request.queryString, gExpectedQueryV4);
-    equal(request.queryString.indexOf('+'), -1);
-    equal(request.queryString.indexOf('/'), -1);
+    equal(request.queryString.indexOf("+"), -1);
+    equal(request.queryString.indexOf("/"), -1);
 
     // Respond a V2 compatible content for now. In the future we can
     // send a meaningful response to test Bug 1284178 to see if the
     // update is successfully stored to database.
     response.setHeader("Content-Type",
                        "application/vnd.google.safebrowsing-update", false);
     response.setStatusLine(request.httpVersion, 200, "OK");
 
--- a/toolkit/components/url-classifier/tests/unit/test_partial.js
+++ b/toolkit/components/url-classifier/tests/unit/test_partial.js
@@ -6,27 +6,25 @@
 function DummyCompleter() {
   this.fragments = {};
   this.queries = [];
   this.tableName = "test-phish-simple";
 }
 
 DummyCompleter.prototype =
 {
-QueryInterface: function(iid)
-{
+QueryInterface(iid) {
   if (!iid.equals(Ci.nsISupports) &&
       !iid.equals(Ci.nsIUrlClassifierHashCompleter)) {
     throw Cr.NS_ERROR_NO_INTERFACE;
   }
   return this;
 },
 
-complete: function(partialHash, gethashUrl, tableName, cb)
-{
+complete(partialHash, gethashUrl, tableName, cb) {
   this.queries.push(partialHash);
   var fragments = this.fragments;
   var self = this;
   var doCallback = function() {
       if (self.alwaysFail) {
         cb.completionFinished(Cr.NS_ERROR_FAILURE);
         return;
       }
@@ -38,70 +36,64 @@ complete: function(partialHash, gethashU
           cb.completionV2(hash, self.tableName, chunkId);
         }
       }
     cb.completionFinished(0);
   }
   var timer = new Timer(0, doCallback);
 },
 
-getHash: function(fragment)
-{
+getHash(fragment) {
   var converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
   createInstance(Ci.nsIScriptableUnicodeConverter);
   converter.charset = "UTF-8";
   var data = converter.convertToByteArray(fragment);
   var ch = Cc["@mozilla.org/security/hash;1"].createInstance(Ci.nsICryptoHash);
   ch.init(ch.SHA256);
   ch.update(data, data.length);
   var hash = ch.finish(false);
   return hash.slice(0, 32);
 },
 
-addFragment: function(chunkId, fragment)
-{
+addFragment(chunkId, fragment) {
   this.addHash(chunkId, this.getHash(fragment));
 },
 
 // This method allows the caller to generate complete hashes that match the
 // prefix of a real fragment, but have different complete hashes.
-addConflict: function(chunkId, fragment)
-{
+addConflict(chunkId, fragment) {
   var realHash = this.getHash(fragment);
   var invalidHash = this.getHash("blah blah blah blah blah");
   this.addHash(chunkId, realHash.slice(0, 4) + invalidHash.slice(4, 32));
 },
 
-addHash: function(chunkId, hash)
-{
+addHash(chunkId, hash) {
   var partial = hash.slice(0, 4);
   if (this.fragments[partial]) {
     this.fragments[partial].push([chunkId, hash]);
   } else {
     this.fragments[partial] = [[chunkId, hash]];
   }
 },
 
-compareQueries: function(fragments)
-{
+compareQueries(fragments) {
   var expectedQueries = [];
   for (var i = 0; i < fragments.length; i++) {
     expectedQueries.push(this.getHash(fragments[i]).slice(0, 4));
   }
   do_check_eq(this.queries.length, expectedQueries.length);
   expectedQueries.sort();
   this.queries.sort();
   for (var i = 0; i < this.queries.length; i++) {
     do_check_eq(this.queries[i], expectedQueries[i]);
   }
 }
 };
 
-function setupCompleter(table, hits, conflicts)
-{
+function setupCompleter(table, hits, conflicts) {
   var completer = new DummyCompleter();
   completer.tableName = table;
   for (var i = 0; i < hits.length; i++) {
     var chunkId = hits[i][0];
     var fragments = hits[i][1];
     for (var j = 0; j < fragments.length; j++) {
       completer.addFragment(chunkId, fragments[j]);
     }
@@ -114,103 +106,100 @@ function setupCompleter(table, hits, con
     }
   }
 
   dbservice.setHashCompleter(table, completer);
 
   return completer;
 }
 
-function installCompleter(table, fragments, conflictFragments)
-{
+function installCompleter(table, fragments, conflictFragments) {
   return setupCompleter(table, fragments, conflictFragments);
 }
 
 function installFailingCompleter(table) {
   var completer = setupCompleter(table, [], []);
   completer.alwaysFail = true;
   return completer;
 }
 
 // Helper assertion for checking dummy completer queries
-gAssertions.completerQueried = function(data, cb)
-{
+gAssertions.completerQueried = function(data, cb) {
   var completer = data[0];
   completer.compareQueries(data[1]);
   cb();
 }
 
-function doTest(updates, assertions)
-{
+function doTest(updates, assertions) {
   doUpdateTest(updates, assertions, runNextTest, updateError);
 }
 
 // Test an add of two partial urls to a fresh database
 function testPartialAdds() {
   var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : addUrls
+          { "chunkNum": 1,
+            "urls": addUrls
           }],
     4);
 
 
-  var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
+  var completer = installCompleter("test-phish-simple", [[1, addUrls]], []);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsExist" : addUrls,
-    "completerQueried" : [completer, addUrls]
+    "tableData": "test-phish-simple;a:1",
+    "urlsExist": addUrls,
+    "completerQueried": [completer, addUrls]
   };
 
 
   doTest([update], assertions);
 }
 
 function testPartialAddsWithConflicts() {
   var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : addUrls
+          { "chunkNum": 1,
+            "urls": addUrls
           }],
     4);
 
   // Each result will have both a real match and a conflict
-  var completer = installCompleter('test-phish-simple',
+  var completer = installCompleter("test-phish-simple",
                                    [[1, addUrls]],
                                    [[1, addUrls]]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsExist" : addUrls,
-    "completerQueried" : [completer, addUrls]
+    "tableData": "test-phish-simple;a:1",
+    "urlsExist": addUrls,
+    "completerQueried": [completer, addUrls]
   };
 
   doTest([update], assertions);
 }
 
 // Test whether the fragmenting code does not cause duplicated completions
 function testFragments() {
   var addUrls = [ "foo.com/a/b/c", "foo.net/", "foo.com/c/" ];
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : addUrls
+          { "chunkNum": 1,
+            "urls": addUrls
           }],
     4);
 
 
-  var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
+  var completer = installCompleter("test-phish-simple", [[1, addUrls]], []);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsExist" : addUrls,
-    "completerQueried" : [completer, addUrls]
+    "tableData": "test-phish-simple;a:1",
+    "urlsExist": addUrls,
+    "completerQueried": [completer, addUrls]
   };
 
 
   doTest([update], assertions);
 }
 
 // Test http://code.google.com/p/google-safe-browsing/wiki/Protocolv2Spec
 // section 6.2 example 1
@@ -223,28 +212,28 @@ function testSpecFragments() {
                   "b.c/1/2.html?param=1",
                   "b.c/1/2.html",
                   "b.c/",
                   "b.c/1/",
                   "a.b.c/1/2.html?param=1" ];
 
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : addUrls
+          { "chunkNum": 1,
+            "urls": addUrls
           }],
     4);
 
 
-  var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
+  var completer = installCompleter("test-phish-simple", [[1, addUrls]], []);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsExist" : probeUrls,
-    "completerQueried" : [completer, addUrls]
+    "tableData": "test-phish-simple;a:1",
+    "urlsExist": probeUrls,
+    "completerQueried": [completer, addUrls]
   };
 
   doTest([update], assertions);
 
 }
 
 // Test http://code.google.com/p/google-safe-browsing/wiki/Protocolv2Spec
 // section 6.2 example 2
@@ -259,431 +248,423 @@ function testMoreSpecFragments() {
                   "d.e.f.g/",
                   "e.f.g/1.html",
                   "e.f.g/",
                   "f.g/1.html",
                   "f.g/" ];
 
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : addUrls
+          { "chunkNum": 1,
+            "urls": addUrls
           }],
     4);
 
-  var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
+  var completer = installCompleter("test-phish-simple", [[1, addUrls]], []);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsExist" : probeUrls,
-    "completerQueried" : [completer, addUrls]
+    "tableData": "test-phish-simple;a:1",
+    "urlsExist": probeUrls,
+    "completerQueried": [completer, addUrls]
   };
 
   doTest([update], assertions);
 
 }
 
 function testFalsePositives() {
   var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : addUrls
+          { "chunkNum": 1,
+            "urls": addUrls
           }],
     4);
 
   // Each result will have no matching complete hashes and a non-matching
   // conflict
-  var completer = installCompleter('test-phish-simple', [], [[1, addUrls]]);
+  var completer = installCompleter("test-phish-simple", [], [[1, addUrls]]);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsDontExist" : addUrls,
-    "completerQueried" : [completer, addUrls]
+    "tableData": "test-phish-simple;a:1",
+    "urlsDontExist": addUrls,
+    "completerQueried": [completer, addUrls]
   };
 
   doTest([update], assertions);
 }
 
 function testEmptyCompleter() {
   var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : addUrls
+          { "chunkNum": 1,
+            "urls": addUrls
           }],
     4);
 
   // Completer will never return full hashes
-  var completer = installCompleter('test-phish-simple', [], []);
+  var completer = installCompleter("test-phish-simple", [], []);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsDontExist" : addUrls,
-    "completerQueried" : [completer, addUrls]
+    "tableData": "test-phish-simple;a:1",
+    "urlsDontExist": addUrls,
+    "completerQueried": [completer, addUrls]
   };
 
   doTest([update], assertions);
 }
 
 function testCompleterFailure() {
   var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : addUrls
+          { "chunkNum": 1,
+            "urls": addUrls
           }],
     4);
 
   // Completer will never return full hashes
-  var completer = installFailingCompleter('test-phish-simple');
+  var completer = installFailingCompleter("test-phish-simple");
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsDontExist" : addUrls,
-    "completerQueried" : [completer, addUrls]
+    "tableData": "test-phish-simple;a:1",
+    "urlsDontExist": addUrls,
+    "completerQueried": [completer, addUrls]
   };
 
   doTest([update], assertions);
 }
 
 function testMixedSizesSameDomain() {
   var add1Urls = [ "foo.com/a" ];
   var add2Urls = [ "foo.com/b" ];
 
   var update1 = buildPhishingUpdate(
     [
-      { "chunkNum" : 1,
-        "urls" : add1Urls }],
+      { "chunkNum": 1,
+        "urls": add1Urls }],
     4);
   var update2 = buildPhishingUpdate(
     [
-      { "chunkNum" : 2,
-        "urls" : add2Urls }],
+      { "chunkNum": 2,
+        "urls": add2Urls }],
     32);
 
   // We should only need to complete the partial hashes
-  var completer = installCompleter('test-phish-simple', [[1, add1Urls]], []);
+  var completer = installCompleter("test-phish-simple", [[1, add1Urls]], []);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1-2",
+    "tableData": "test-phish-simple;a:1-2",
     // both urls should match...
-    "urlsExist" : add1Urls.concat(add2Urls),
+    "urlsExist": add1Urls.concat(add2Urls),
     // ... but the completer should only be queried for the partial entry
-    "completerQueried" : [completer, add1Urls]
+    "completerQueried": [completer, add1Urls]
   };
 
   doTest([update1, update2], assertions);
 }
 
 function testMixedSizesDifferentDomains() {
   var add1Urls = [ "foo.com/a" ];
   var add2Urls = [ "bar.com/b" ];
 
   var update1 = buildPhishingUpdate(
     [
-      { "chunkNum" : 1,
-        "urls" : add1Urls }],
+      { "chunkNum": 1,
+        "urls": add1Urls }],
     4);
   var update2 = buildPhishingUpdate(
     [
-      { "chunkNum" : 2,
-        "urls" : add2Urls }],
+      { "chunkNum": 2,
+        "urls": add2Urls }],
     32);
 
   // We should only need to complete the partial hashes
-  var completer = installCompleter('test-phish-simple', [[1, add1Urls]], []);
+  var completer = installCompleter("test-phish-simple", [[1, add1Urls]], []);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1-2",
+    "tableData": "test-phish-simple;a:1-2",
     // both urls should match...
-    "urlsExist" : add1Urls.concat(add2Urls),
+    "urlsExist": add1Urls.concat(add2Urls),
     // ... but the completer should only be queried for the partial entry
-    "completerQueried" : [completer, add1Urls]
+    "completerQueried": [completer, add1Urls]
   };
 
   doTest([update1, update2], assertions);
 }
 
-function testInvalidHashSize()
-{
+function testInvalidHashSize() {
   var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : addUrls
+          { "chunkNum": 1,
+            "urls": addUrls
           }],
         12); // only 4 and 32 are legal hash sizes
 
   var addUrls2 = [ "zaz.com/a", "xyz.com/b" ];
   var update2 = buildPhishingUpdate(
         [
-          { "chunkNum" : 2,
-            "urls" : addUrls2
+          { "chunkNum": 2,
+            "urls": addUrls2
           }],
         4);
 
-  var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
+  var completer = installCompleter("test-phish-simple", [[1, addUrls]], []);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:2",
-    "urlsDontExist" : addUrls
+    "tableData": "test-phish-simple;a:2",
+    "urlsDontExist": addUrls
   };
 
   // A successful update will trigger an error
   doUpdateTest([update2, update], assertions, updateError, runNextTest);
 }
 
-function testWrongTable()
-{
+function testWrongTable() {
   var addUrls = [ "foo.com/a" ];
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : addUrls
+          { "chunkNum": 1,
+            "urls": addUrls
           }],
         4);
-  var completer = installCompleter('test-malware-simple', // wrong table
+  var completer = installCompleter("test-malware-simple", // wrong table
                                    [[1, addUrls]], []);
 
   // The above installCompleter installs the completer for test-malware-simple,
   // we want it to be used for test-phish-simple too.
   dbservice.setHashCompleter("test-phish-simple", completer);
 
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
+    "tableData": "test-phish-simple;a:1",
     // The urls were added as phishing urls, but the completer is claiming
     // that they are malware urls, and we trust the completer in this case.
     // The result will be discarded, so we can only check for non-existence.
-    "urlsDontExist" : addUrls,
+    "urlsDontExist": addUrls,
     // Make sure the completer was actually queried.
-    "completerQueried" : [completer, addUrls]
+    "completerQueried": [completer, addUrls]
   };
 
   doUpdateTest([update], assertions,
                function() {
                  // Give the dbservice a chance to (not) cache the result.
                  var timer = new Timer(3000, function() {
                      // The miss earlier will have caused a miss to be cached.
                      // Resetting the completer does not count as an update,
                      // so we will not be probed again.
-                     var newCompleter = installCompleter('test-malware-simple', [[1, addUrls]], []);                     dbservice.setHashCompleter("test-phish-simple",
+                     var newCompleter = installCompleter("test-malware-simple", [[1, addUrls]], []); dbservice.setHashCompleter("test-phish-simple",
                                                 newCompleter);
 
                      var assertions = {
-                       "urlsDontExist" : addUrls
+                       "urlsDontExist": addUrls
                      };
                      checkAssertions(assertions, runNextTest);
                    });
                }, updateError);
 }
 
-function setupCachedResults(addUrls, part2)
-{
+function setupCachedResults(addUrls, part2) {
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : addUrls
+          { "chunkNum": 1,
+            "urls": addUrls
           }],
         4);
 
-  var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
+  var completer = installCompleter("test-phish-simple", [[1, addUrls]], []);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
+    "tableData": "test-phish-simple;a:1",
     // Request the add url.  This should cause the completion to be cached.
-    "urlsExist" : addUrls,
+    "urlsExist": addUrls,
     // Make sure the completer was actually queried.
-    "completerQueried" : [completer, addUrls]
+    "completerQueried": [completer, addUrls]
   };
 
   doUpdateTest([update], assertions,
                function() {
                  // Give the dbservice a chance to cache the result.
                  var timer = new Timer(3000, part2);
                }, updateError);
 }
 
-function testCachedResults()
-{
+function testCachedResults() {
   setupCachedResults(["foo.com/a"], function(add) {
       // This is called after setupCachedResults().  Verify that
       // checking the url again does not cause a completer request.
 
       // install a new completer, this one should never be queried.
-      var newCompleter = installCompleter('test-phish-simple', [[1, []]], []);
+      var newCompleter = installCompleter("test-phish-simple", [[1, []]], []);
 
       var assertions = {
-        "urlsExist" : ["foo.com/a"],
-        "completerQueried" : [newCompleter, []]
+        "urlsExist": ["foo.com/a"],
+        "completerQueried": [newCompleter, []]
       };
       checkAssertions(assertions, runNextTest);
     });
 }
 
 function testCachedResultsWithSub() {
   setupCachedResults(["foo.com/a"], function() {
       // install a new completer, this one should never be queried.
-      var newCompleter = installCompleter('test-phish-simple', [[1, []]], []);
+      var newCompleter = installCompleter("test-phish-simple", [[1, []]], []);
 
       var removeUpdate = buildPhishingUpdate(
-        [ { "chunkNum" : 2,
-            "chunkType" : "s",
+        [ { "chunkNum": 2,
+            "chunkType": "s",
             "urls": ["1:foo.com/a"] }],
         4);
 
       var assertions = {
-        "urlsDontExist" : ["foo.com/a"],
-        "completerQueried" : [newCompleter, []]
+        "urlsDontExist": ["foo.com/a"],
+        "completerQueried": [newCompleter, []]
       }
 
       doTest([removeUpdate], assertions);
     });
 }
 
 function testCachedResultsWithExpire() {
   setupCachedResults(["foo.com/a"], function() {
       // install a new completer, this one should never be queried.
-      var newCompleter = installCompleter('test-phish-simple', [[1, []]], []);
+      var newCompleter = installCompleter("test-phish-simple", [[1, []]], []);
 
       var expireUpdate =
         "n:1000\n" +
         "i:test-phish-simple\n" +
         "ad:1\n";
 
       var assertions = {
-        "urlsDontExist" : ["foo.com/a"],
-        "completerQueried" : [newCompleter, []]
+        "urlsDontExist": ["foo.com/a"],
+        "completerQueried": [newCompleter, []]
       }
       doTest([expireUpdate], assertions);
     });
 }
 
-function testCachedResultsFailure()
-{
+function testCachedResultsFailure() {
   var existUrls = ["foo.com/a"];
   setupCachedResults(existUrls, function() {
     // This is called after setupCachedResults().  Verify that
     // checking the url again does not cause a completer request.
 
     // install a new completer, this one should never be queried.
-    var newCompleter = installCompleter('test-phish-simple', [[1, []]], []);
+    var newCompleter = installCompleter("test-phish-simple", [[1, []]], []);
 
     var assertions = {
-      "urlsExist" : existUrls,
-      "completerQueried" : [newCompleter, []]
+      "urlsExist": existUrls,
+      "completerQueried": [newCompleter, []]
     };
 
     var addUrls = ["foobar.org/a"];
 
     var update2 = buildPhishingUpdate(
         [
-          { "chunkNum" : 2,
-            "urls" : addUrls
+          { "chunkNum": 2,
+            "urls": addUrls
           }],
         4);
 
     checkAssertions(assertions, function() {
       // Apply the update. The cached completes should be gone.
       doErrorUpdate("test-phish-simple,test-malware-simple", function() {
         // Now the completer gets queried again.
-        var newCompleter2 = installCompleter('test-phish-simple', [[1, existUrls]], []);
+        var newCompleter2 = installCompleter("test-phish-simple", [[1, existUrls]], []);
         var assertions2 = {
-          "tableData" : "test-phish-simple;a:1",
-          "urlsExist" : existUrls,
-          "completerQueried" : [newCompleter2, existUrls]
+          "tableData": "test-phish-simple;a:1",
+          "urlsExist": existUrls,
+          "completerQueried": [newCompleter2, existUrls]
         };
         checkAssertions(assertions2, runNextTest);
       }, updateError);
     });
   });
 }
 
-function testErrorList()
-{
+function testErrorList() {
   var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : addUrls
+          { "chunkNum": 1,
+            "urls": addUrls
           }],
     4);
   // The update failure should will kill the completes, so the above
   // must be a prefix to get any hit at all past the update failure.
 
-  var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
+  var completer = installCompleter("test-phish-simple", [[1, addUrls]], []);
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsExist" : addUrls,
+    "tableData": "test-phish-simple;a:1",
+    "urlsExist": addUrls,
     // These are complete urls, and will only be completed if the
     // list is stale.
-    "completerQueried" : [completer, addUrls]
+    "completerQueried": [completer, addUrls]
   };
 
   // Apply the update.
   doStreamUpdate(update, function() {
       // Now the test-phish-simple and test-malware-simple tables are marked
       // as fresh.  Fake an update failure to mark them stale.
       doErrorUpdate("test-phish-simple,test-malware-simple", function() {
           // Now the lists should be marked stale.  Check assertions.
           checkAssertions(assertions, runNextTest);
         }, updateError);
     }, updateError);
 }
 
 
 // Verify that different lists (test-phish-simple,
 // test-malware-simple) maintain their freshness separately.
-function testErrorListIndependent()
-{
+function testErrorListIndependent() {
   var phishUrls = [ "phish.com/a" ];
   var malwareUrls = [ "attack.com/a" ];
   var update = buildPhishingUpdate(
         [
-          { "chunkNum" : 1,
-            "urls" : phishUrls
+          { "chunkNum": 1,
+            "urls": phishUrls
           }],
     4);
   // These have to persist past the update failure, so they must be prefixes,
   // not completes.
 
   update += buildMalwareUpdate(
         [
-          { "chunkNum" : 2,
-            "urls" : malwareUrls
+          { "chunkNum": 2,
+            "urls": malwareUrls
           }],
     32);
 
-  var completer = installCompleter('test-phish-simple', [[1, phishUrls]], []);
+  var completer = installCompleter("test-phish-simple", [[1, phishUrls]], []);
 
   var assertions = {
-    "tableData" : "test-malware-simple;a:2\ntest-phish-simple;a:1",
-    "urlsExist" : phishUrls,
-    "malwareUrlsExist" : malwareUrls,
+    "tableData": "test-malware-simple;a:2\ntest-phish-simple;a:1",
+    "urlsExist": phishUrls,
+    "malwareUrlsExist": malwareUrls,
     // Only this phishing urls should be completed, because only the phishing
     // urls will be stale.
-    "completerQueried" : [completer, phishUrls]
+    "completerQueried": [completer, phishUrls]
   };
 
   // Apply the update.
   doStreamUpdate(update, function() {
       // Now the test-phish-simple and test-malware-simple tables are
       // marked as fresh.  Fake an update failure to mark *just*
       // phishing data as stale.
       doErrorUpdate("test-phish-simple", function() {
           // Now the lists should be marked stale.  Check assertions.
           checkAssertions(assertions, runNextTest);
         }, updateError);
     }, updateError);
 }
 
-function run_test()
-{
+function run_test() {
   runTests([
       testPartialAdds,
       testPartialAddsWithConflicts,
       testFragments,
       testSpecFragments,
       testMoreSpecFragments,
       testFalsePositives,
       testEmptyCompleter,
--- a/toolkit/components/url-classifier/tests/unit/test_pref.js
+++ b/toolkit/components/url-classifier/tests/unit/test_pref.js
@@ -6,9 +6,9 @@ function run_test() {
   // by default.
   equal(urlUtils.getProtocolVersion("google"), "2.2");
 
   // Mozilla protocol version will stick to "2.2".
   equal(urlUtils.getProtocolVersion("mozilla"), "2.2");
 
   // Unknown provider version will be "2.2".
   equal(urlUtils.getProtocolVersion("unknown-provider"), "2.2");
-}
\ No newline at end of file
+}
--- a/toolkit/components/url-classifier/tests/unit/test_prefixset.js
+++ b/toolkit/components/url-classifier/tests/unit/test_prefixset.js
@@ -13,44 +13,44 @@ function arrContains(arr, target) {
   let end = arr.length - 1;
   let i = 0;
 
   while (end > start) {
     i = start + (end - start >> 1);
     let value = arr[i];
 
     if (value < target)
-      start = i+1;
+      start = i + 1;
     else if (value > target)
-      end = i-1;
+      end = i - 1;
     else
       break;
   }
   if (start == end)
     i = start;
 
   return (!(i < 0 || i >= arr.length) && arr[i] == target);
 }
 
 // checkContents: Check whether the PrefixSet pset contains
 // the prefixes in the passed array.
 function checkContents(pset, prefixes) {
   var outcount = {}, outset = {};
   outset = pset.getPrefixes(outcount);
   let inset = prefixes;
   do_check_eq(inset.length, outset.length);
-  inset.sort((x,y) => x - y);
+  inset.sort((x, y) => x - y);
   for (let i = 0; i < inset.length; i++) {
     do_check_eq(inset[i], outset[i]);
   }
 }
 
 function wrappedProbe(pset, prefix) {
   return pset.contains(prefix);
-};
+}
 
 // doRandomLookups: we use this to test for false membership with random input
 // over the range of prefixes (unsigned 32-bits integers).
 //    pset: a nsIUrlClassifierPrefixSet to test.
 //    prefixes: an array of prefixes supposed to make up the prefix set.
 //    N: number of random lookups to make.
 function doRandomLookups(pset, prefixes, N) {
   for (let i = 0; i < N; i++) {
@@ -62,61 +62,61 @@ function doRandomLookups(pset, prefixes,
   }
 }
 
 // doExpectedLookups: we use this to test expected membership.
 //    pset: a nsIUrlClassifierPrefixSet to test.
 //    prefixes:
 function doExpectedLookups(pset, prefixes, N) {
   for (let i = 0; i < N; i++) {
-    prefixes.forEach(function (x) {
+    prefixes.forEach(function(x) {
       dump("Checking " + x + "\n");
       do_check_true(wrappedProbe(pset, x));
     });
   }
 }
 
 // testBasicPset: A very basic test of the prefix set to make sure that it
 // exists and to give a basic example of its use.
 function testBasicPset() {
   let pset = Cc["@mozilla.org/url-classifier/prefixset;1"]
                .createInstance(Ci.nsIUrlClassifierPrefixSet);
-  let prefixes = [2,50,100,2000,78000,1593203];
+  let prefixes = [2, 50, 100, 2000, 78000, 1593203];
   pset.setPrefixes(prefixes, prefixes.length);
 
   do_check_true(wrappedProbe(pset, 100));
   do_check_false(wrappedProbe(pset, 100000));
   do_check_true(wrappedProbe(pset, 1593203));
   do_check_false(wrappedProbe(pset, 999));
   do_check_false(wrappedProbe(pset, 0));
 
 
   checkContents(pset, prefixes);
 }
 
 function testDuplicates() {
   let pset = Cc["@mozilla.org/url-classifier/prefixset;1"]
                .createInstance(Ci.nsIUrlClassifierPrefixSet);
-  let prefixes = [1,1,2,2,2,3,3,3,3,3,3,5,6,6,7,7,9,9,9];
+  let prefixes = [1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 5, 6, 6, 7, 7, 9, 9, 9];
   pset.setPrefixes(prefixes, prefixes.length);
 
   do_check_true(wrappedProbe(pset, 1));
   do_check_true(wrappedProbe(pset, 2));
   do_check_true(wrappedProbe(pset, 5));
   do_check_true(wrappedProbe(pset, 9));
   do_check_false(wrappedProbe(pset, 4));
   do_check_false(wrappedProbe(pset, 8));
 
 
   checkContents(pset, prefixes);
 }
 
 function testSimplePset() {
   let pset = newPset();
-  let prefixes = [1,2,100,400,123456789];
+  let prefixes = [1, 2, 100, 400, 123456789];
   pset.setPrefixes(prefixes, prefixes.length);
 
   doRandomLookups(pset, prefixes, 100);
   doExpectedLookups(pset, prefixes, 1);
 
 
   checkContents(pset, prefixes);
 }
@@ -144,28 +144,28 @@ function testLoadSaveLargeSet() {
   let N = 1000;
   let arr = [];
 
   for (let i = 0; i < N; i++) {
     let randInt = Math.floor(Math.random() * Math.pow(2, 32));
     arr.push(randInt);
   }
 
-  arr.sort((x,y) => x - y);
+  arr.sort((x, y) => x - y);
 
   let pset = newPset();
   pset.setPrefixes(arr, arr.length);
 
   doExpectedLookups(pset, arr, 1);
   doRandomLookups(pset, arr, 1000);
 
   checkContents(pset, arr);
 
   // Now try to save, restore, and redo the lookups
-  var file = dirSvc.get('ProfLD', Ci.nsIFile);
+  var file = dirSvc.get("ProfLD", Ci.nsIFile);
   file.append("testLarge.pset");
 
   pset.storeToFile(file);
 
   let psetLoaded = newPset();
   psetLoaded.loadFromFile(file);
 
   doExpectedLookups(psetLoaded, arr, 1);
@@ -200,17 +200,17 @@ function testLoadSaveNoDelta() {
     arr.push(((1 << 16) + 1) * i);
   }
 
   let pset = newPset();
   pset.setPrefixes(arr, arr.length);
 
   doExpectedLookups(pset, arr, 1);
 
-  var file = dirSvc.get('ProfLD', Ci.nsIFile);
+  var file = dirSvc.get("ProfLD", Ci.nsIFile);
   file.append("testNoDelta.pset");
 
   pset.storeToFile(file);
   pset.loadFromFile(file);
 
   doExpectedLookups(pset, arr, 1);
 }
 
--- a/toolkit/components/url-classifier/tests/unit/test_safebrowsing_protobuf.js
+++ b/toolkit/components/url-classifier/tests/unit/test_safebrowsing_protobuf.js
@@ -15,9 +15,9 @@ function run_test() {
 
   // One valid and one invalid list name.
   let requestOneInvalidOneValid =
     urlUtils.makeUpdateRequestV4(["goog-phish-proto", "bad-list-name"],
                                  ["AAAAAA", "AAAAAA"], 2);
 
   equal(requestNoList, requestOneInvalid);
   equal(requestOneValid, requestOneInvalidOneValid);
-}
\ No newline at end of file
+}
--- a/toolkit/components/url-classifier/tests/unit/test_streamupdater.js
+++ b/toolkit/components/url-classifier/tests/unit/test_streamupdater.js
@@ -1,284 +1,281 @@
-function doTest(updates, assertions, expectError)
-{
+function doTest(updates, assertions, expectError) {
   if (expectError) {
     doUpdateTest(updates, assertions, updateError, runNextTest);
   } else {
     doUpdateTest(updates, assertions, runNextTest, updateError);
   }
 }
 
 // Never use the same URLs for multiple tests, because we aren't guaranteed
 // to reset the database between tests.
 function testFillDb() {
   var add1Urls = [ "zaz.com/a", "yxz.com/c" ];
 
   var update = "n:1000\n";
   update += "i:test-phish-simple\n";
 
   var update1 = buildBareUpdate(
-    [{ "chunkNum" : 1,
-       "urls" : add1Urls }]);
+    [{ "chunkNum": 1,
+       "urls": add1Urls }]);
   update += "u:data:," + encodeURIComponent(update1) + "\n";
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsExist" : add1Urls
+    "tableData": "test-phish-simple;a:1",
+    "urlsExist": add1Urls
   };
 
   doTest([update], assertions, false);
 }
 
 function testSimpleForward() {
   var add1Urls = [ "foo-simple.com/a", "bar-simple.com/c" ];
   var add2Urls = [ "foo-simple.com/b" ];
   var add3Urls = [ "bar-simple.com/d" ];
 
   var update = "n:1000\n";
   update += "i:test-phish-simple\n";
 
   var update1 = buildBareUpdate(
-    [{ "chunkNum" : 1,
-       "urls" : add1Urls }]);
+    [{ "chunkNum": 1,
+       "urls": add1Urls }]);
   update += "u:data:," + encodeURIComponent(update1) + "\n";
 
   var update2 = buildBareUpdate(
-    [{ "chunkNum" : 2,
-       "urls" : add2Urls }]);
+    [{ "chunkNum": 2,
+       "urls": add2Urls }]);
   update += "u:data:," + encodeURIComponent(update2) + "\n";
 
   var update3 = buildBareUpdate(
-    [{ "chunkNum" : 3,
-       "urls" : add3Urls }]);
+    [{ "chunkNum": 3,
+       "urls": add3Urls }]);
   update += "u:data:," + encodeURIComponent(update3) + "\n";
 
   var assertions = {
-    "tableData" : "test-phish-simple;a:1-3",
-    "urlsExist" : add1Urls.concat(add2Urls).concat(add3Urls)
+    "tableData": "test-phish-simple;a:1-3",
+    "urlsExist": add1Urls.concat(add2Urls).concat(add3Urls)
   };
 
   doTest([update], assertions, false);
 }
 
 // Make sure that a nested forward (a forward within a forward) causes
 // the update to fail.
 function testNestedForward() {
   var add1Urls = [ "foo-nested.com/a", "bar-nested.com/c" ];
   var add2Urls = [ "foo-nested.com/b" ];
 
   var update = "n:1000\n";
   update += "i:test-phish-simple\n";
 
   var update1 = buildBareUpdate(
-    [{ "chunkNum" : 1,
-       "urls" : add1Urls }]);
+    [{ "chunkNum": 1,
+       "urls": add1Urls }]);
   update += "u:data:," + encodeURIComponent(update1) + "\n";
 
   var update2 = buildBareUpdate(
-    [{ "chunkNum" : 2 }]);
+    [{ "chunkNum": 2 }]);
   var update3 = buildBareUpdate(
-    [{ "chunkNum" : 3,
-       "urls" : add1Urls }]);
+    [{ "chunkNum": 3,
+       "urls": add1Urls }]);
 
   update2 += "u:data:," + encodeURIComponent(update3) + "\n";
 
   update += "u:data:," + encodeURIComponent(update2) + "\n";
 
   var assertions = {
-    "tableData" : "",
-    "urlsDontExist" : add1Urls.concat(add2Urls)
+    "tableData": "",
+    "urlsDontExist": add1Urls.concat(add2Urls)
   };
 
   doTest([update], assertions, true);
 }
 
 // An invalid URL forward causes the update to fail.
 function testInvalidUrlForward() {
   var add1Urls = [ "foo-invalid.com/a", "bar-invalid.com/c" ];
 
   var update = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
-       "urls" : add1Urls }]);
+    [{ "chunkNum": 1,
+       "urls": add1Urls }]);
   update += "u:asdf://blah/blah\n";  // invalid URL scheme
 
   // add1Urls is present, but that is an artifact of the way we do the test.
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsExist" : add1Urls
+    "tableData": "test-phish-simple;a:1",
+    "urlsExist": add1Urls
   };
 
   doTest([update], assertions, true);
 }
 
 // A failed network request causes the update to fail.
 function testErrorUrlForward() {
   var add1Urls = [ "foo-forward.com/a", "bar-forward.com/c" ];
 
   var update = buildPhishingUpdate(
-    [{ "chunkNum" : 1,
-       "urls" : add1Urls }]);
+    [{ "chunkNum": 1,
+       "urls": add1Urls }]);
   update += "u:http://test.invalid/asdf/asdf\n";  // invalid URL scheme
 
   // add1Urls is present, but that is an artifact of the way we do the test.
   var assertions = {
-    "tableData" : "test-phish-simple;a:1",
-    "urlsExist" : add1Urls
+    "tableData": "test-phish-simple;a:1",
+    "urlsExist": add1Urls
   };
 
   doTest([update], assertions, true);
 }
 
 function testMultipleTables() {
   var add1Urls = [ "foo-multiple.com/a", "bar-multiple.com/c" ];
   var add2Urls = [ "foo-multiple.com/b" ];
   var add3Urls = [ "bar-multiple.com/d" ];
   var add4Urls = [ "bar-multiple.com/e" ];
   var add6Urls = [ "bar-multiple.com/g" ];
 
   var update = "n:1000\n";
   update += "i:test-phish-simple\n";
 
   var update1 = buildBareUpdate(
-    [{ "chunkNum" : 1,
-       "urls" : add1Urls }]);
+    [{ "chunkNum": 1,
+       "urls": add1Urls }]);
   update += "u:data:," + encodeURIComponent(update1) + "\n";
 
   var update2 = buildBareUpdate(
-    [{ "chunkNum" : 2,
-       "urls" : add2Urls }]);
+    [{ "chunkNum": 2,
+       "urls": add2Urls }]);
   update += "u:data:," + encodeURIComponent(update2) + "\n";
 
   update += "i:test-malware-simple\n";
 
   var update3 = buildBareUpdate(
-    [{ "chunkNum" : 3,
-       "urls" : add3Urls }]);
+    [{ "chunkNum": 3,
+       "urls": add3Urls }]);
   update += "u:data:," + encodeURIComponent(update3) + "\n";
 
   update += "i:test-unwanted-simple\n";
   var update4 = buildBareUpdate(
-    [{ "chunkNum" : 4,
-       "urls" : add4Urls }]);
+    [{ "chunkNum": 4,
+       "urls": add4Urls }]);
   update += "u:data:," + encodeURIComponent(update4) + "\n";
 
   update += "i:test-block-simple\n";
   var update6 = buildBareUpdate(
-    [{ "chunkNum" : 6,
-       "urls" : add6Urls }]);
+    [{ "chunkNum": 6,
+       "urls": add6Urls }]);
   update += "u:data:," + encodeURIComponent(update6) + "\n";
 
   var assertions = {
-    "tableData" : "test-block-simple;a:6\ntest-malware-simple;a:3\ntest-phish-simple;a:1-2\ntest-unwanted-simple;a:4",
-    "urlsExist" : add1Urls.concat(add2Urls),
-    "malwareUrlsExist" : add3Urls,
-    "unwantedUrlsExist" : add4Urls,
-    "blockedUrlsExist" : add6Urls
+    "tableData": "test-block-simple;a:6\ntest-malware-simple;a:3\ntest-phish-simple;a:1-2\ntest-unwanted-simple;a:4",
+    "urlsExist": add1Urls.concat(add2Urls),
+    "malwareUrlsExist": add3Urls,
+    "unwantedUrlsExist": add4Urls,
+    "blockedUrlsExist": add6Urls
   };
 
   doTest([update], assertions, false);
 }
 
 function testUrlInMultipleTables() {
   var add1Urls = [ "foo-forward.com/a" ];
 
   var update = "n:1000\n";
   update += "i:test-phish-simple\n";
 
   var update1 = buildBareUpdate(
-    [{ "chunkNum" : 1,
-       "urls" : add1Urls }]);
+    [{ "chunkNum": 1,
+       "urls": add1Urls }]);
   update += "u:data:," + encodeURIComponent(update1) + "\n";
 
   update += "i:test-malware-simple\n";
   var update2 = buildBareUpdate(
-    [{ "chunkNum" : 2,
-       "urls" : add1Urls }]);
+    [{ "chunkNum": 2,
+       "urls": add1Urls }]);
   update += "u:data:," + encodeURIComponent(update2) + "\n";
 
   update += "i:test-unwanted-simple\n";
   var update3 = buildBareUpdate(
-    [{ "chunkNum" : 3,
-       "urls" : add1Urls }]);
+    [{ "chunkNum": 3,
+       "urls": add1Urls }]);
   update += "u:data:," + encodeURIComponent(update3) + "\n";
 
   var assertions = {
-    "tableData" : "test-malware-simple;a:2\ntest-phish-simple;a:1\ntest-unwanted-simple;a:3",
-    "urlExistInMultipleTables" : { url: add1Urls,
+    "tableData": "test-malware-simple;a:2\ntest-phish-simple;a:1\ntest-unwanted-simple;a:3",
+    "urlExistInMultipleTables": { url: add1Urls,
                                    tables: "test-malware-simple,test-phish-simple,test-unwanted-simple" }
   };
 
   doTest([update], assertions, false);
 }
 
 function Observer(callback) {
   this.observe = callback;
 }
 
 Observer.prototype =
 {
-QueryInterface: function(iid)
-{
+QueryInterface(iid) {
   if (!iid.equals(Ci.nsISupports) &&
       !iid.equals(Ci.nsIObserver)) {
     throw Cr.NS_ERROR_NO_INTERFACE;
   }
   return this;
 }
 };
 
 // Tests a database reset request.
 function testReset() {
   // The moz-phish-simple table is populated separately from the other update in
   // a separate update request. Therefore it should not be reset when we run the
   // updates later in this function.
   var mozAddUrls = [ "moz-reset.com/a" ];
   var mozUpdate = buildMozPhishingUpdate(
     [
-      { "chunkNum" : 1,
-        "urls" : mozAddUrls
+      { "chunkNum": 1,
+        "urls": mozAddUrls
       }]);
 
   var dataUpdate = "data:," + encodeURIComponent(mozUpdate);
 
   streamUpdater.downloadUpdates(mozTables, "", true,
                                 dataUpdate, () => {}, updateError, updateError);
 
   var addUrls1 = [ "foo-reset.com/a", "foo-reset.com/b" ];
   var update1 = buildPhishingUpdate(
     [
-      { "chunkNum" : 1,
-        "urls" : addUrls1
+      { "chunkNum": 1,
+        "urls": addUrls1
       }]);
 
   var update2 = "n:1000\nr:pleasereset\n";
 
   var addUrls3 = [ "bar-reset.com/a", "bar-reset.com/b" ];
   var update3 = buildPhishingUpdate(
     [
-      { "chunkNum" : 3,
-        "urls" : addUrls3
+      { "chunkNum": 3,
+        "urls": addUrls3
       }]);
 
   var assertions = {
-    "tableData" : "moz-phish-simple;a:1\ntest-phish-simple;a:3", // tables that should still be there.
-    "mozPhishingUrlsExist" : mozAddUrls,                         // mozAddUrls added prior to the reset
+    "tableData": "moz-phish-simple;a:1\ntest-phish-simple;a:3", // tables that should still be there.
+    "mozPhishingUrlsExist": mozAddUrls,                         // mozAddUrls added prior to the reset
                                                                  // but it should still exist after reset.
-    "urlsExist" : addUrls3,                                      // addUrls3 added after the reset.
-    "urlsDontExist" : addUrls1                                   // addUrls1 added prior to the reset
+    "urlsExist": addUrls3,                                      // addUrls3 added after the reset.
+    "urlsDontExist": addUrls1                                   // addUrls1 added prior to the reset
   };
 
   // Use these update responses in order. The update request only
   // contains test-*-simple tables so the reset will only apply to these.
   doTest([update1, update2, update3], assertions, false);
 }
 
 
-function run_test()
-{
+function run_test() {
   runTests([
     testSimpleForward,
     testNestedForward,
     testInvalidUrlForward,
     testErrorUrlForward,
     testMultipleTables,
     testUrlInMultipleTables,
     testReset
--- a/toolkit/components/url-classifier/tests/unit/test_threat_type_conversion.js
+++ b/toolkit/components/url-classifier/tests/unit/test_threat_type_conversion.js
@@ -31,9 +31,9 @@ function run_test() {
     urlUtils.convertThreatTypeToListNames(0);
     ok(false, "Bad threat type should lead to exception.");
   } catch (e) {}
 
   try {
     urlUtils.convertThreatTypeToListNames(100);
     ok(false, "Bad threat type should lead to exception.");
   } catch (e) {}
-}
\ No newline at end of file
+}