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 function test () {
2 let loader = makeLoader();
3 let module = Module("./main", gTestPath);
4 let require = Require(loader, module);
6 try {
7 let Model = require("./cant-find-me");
8 ok(false, "requiring a JS module that doesn't exist should throw");
9 }
10 catch (e) {
11 ok(e, "requiring a JS module that doesn't exist should throw");
12 }
15 /*
16 * Relative resource:// URI of JS
17 */
19 let { square } = require("./math");
20 is(square(5), 25, "loads relative URI of JS");
22 /*
23 * Absolute resource:// URI of JS
24 */
26 let { has } = require("resource://gre/modules/commonjs/sdk/util/array");
27 let testArray = ['rock', 'paper', 'scissors'];
29 ok(has(testArray, 'rock'), "loads absolute resource:// URI of JS");
30 ok(!has(testArray, 'dragon'), "loads absolute resource:// URI of JS");
32 finish();
33 }