Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
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 // This file tests the openUnsharedDatabase function of mozIStorageService.
7 function test_openUnsharedDatabase_file_DNE()
8 {
9 // the file should be created after calling
10 var db = getTestDB();
11 do_check_false(db.exists());
12 getService().openUnsharedDatabase(db);
13 do_check_true(db.exists());
14 }
16 function test_openUnsharedDatabase_file_exists()
17 {
18 // it should already exist from our last test
19 var db = getTestDB();
20 do_check_true(db.exists());
21 getService().openUnsharedDatabase(db);
22 do_check_true(db.exists());
23 }
25 var tests = [test_openUnsharedDatabase_file_DNE,
26 test_openUnsharedDatabase_file_exists];
28 function run_test()
29 {
30 for (var i = 0; i < tests.length; i++)
31 tests[i]();
33 cleanup();
34 }