Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 | } |