toolkit/forgetaboutsite/test/unit/head_forgetaboutsite.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 const Cc = Components.classes;
     6 const Ci = Components.interfaces;
     7 const Cu = Components.utils;
     9 var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
    10 var profileDir = do_get_profile();
    12 /**
    13  * Removes any files that could make our tests fail.
    14  */
    15 function cleanUp()
    16 {
    17   let files = [
    18     "downloads.sqlite",
    19     "places.sqlite",
    20     "cookies.sqlite",
    21     "signons.sqlite",
    22     "permissions.sqlite"
    23   ];
    25   for (let i = 0; i < files.length; i++) {
    26     let file = dirSvc.get("ProfD", Ci.nsIFile);
    27     file.append(files[i]);
    28     if (file.exists())
    29       file.remove(false);
    30   }
    31 }
    32 cleanUp();
    34 function oldDownloadManagerDisabled()
    35 {
    36   try {
    37     // This method throws an exception if the old Download Manager is disabled.
    38     Services.downloads.activeDownloadCount;
    39   } catch (ex) {
    40     return true;
    41   }
    42   return false;
    43 }

mercurial