toolkit/components/places/tests/migration/head_migration.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* Any copyright is dedicated to the Public Domain.
     2    http://creativecommons.org/publicdomain/zero/1.0/ */
     4 const Ci = Components.interfaces;
     5 const Cc = Components.classes;
     6 const Cr = Components.results;
     7 const Cu = Components.utils;
     9 Cu.import("resource://gre/modules/Services.jsm");
    11 // Import common head.
    12 let (commonFile = do_get_file("../head_common.js", false)) {
    13   let uri = Services.io.newFileURI(commonFile);
    14   Services.scriptloader.loadSubScript(uri.spec, this);
    15 }
    17 // Put any other stuff relative to this test folder below.
    19 const kDBName = "places.sqlite";
    21 /**
    22  * Sets the database to use for the given test.  This should be the very first
    23  * thing we do otherwise, this database will not be used!
    24  *
    25  * @param aFileName
    26  *        The filename of the database to use.  This database must exist in
    27  *        toolkit/components/places/tests/migration!
    28  */
    29 function setPlacesDatabase(aFileName)
    30 {
    31   let file = do_get_file(aFileName);
    33   // Ensure that our database doesn't already exist.
    34   let (dbFile = gProfD.clone()) {
    35     dbFile.append(kDBName);
    36     do_check_false(dbFile.exists());
    37   }
    39   file.copyToFollowingLinks(gProfD, kDBName);
    40 }

mercurial