toolkit/forgetaboutsite/test/unit/head_forgetaboutsite.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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