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.

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

mercurial