Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 var gClient;
5 var gDebuggee;
7 function run_test()
8 {
9 initTestDebuggerServer();
10 gDebuggee = testGlobal("test-1");
11 DebuggerServer.addTestGlobal(gDebuggee);
13 let transport = DebuggerServer.connectPipe();
14 gClient = new DebuggerClient(transport);
15 gClient.connect(function(aType, aTraits) {
16 attachTestTab(gClient, "test-1", test_attach);
17 });
18 do_test_pending();
19 }
21 function test_attach(aResponse, aTabClient)
22 {
23 aTabClient.attachThread({}, function(aResponse, aThreadClient) {
24 do_check_eq(aThreadClient.paused, true);
25 aThreadClient.resume(function() {
26 test_interrupt(aThreadClient);
27 });
28 });
29 }
31 function test_interrupt(aThreadClient)
32 {
33 do_check_eq(aThreadClient.paused, false);
34 aThreadClient.interrupt(function(aResponse) {
35 do_check_eq(aThreadClient.paused, true);
36 aThreadClient.resume(function() {
37 do_check_eq(aThreadClient.paused, false);
38 cleanup();
39 });
40 });
41 }
43 function cleanup()
44 {
45 gClient.addListener("closed", function(aEvent) {
46 do_test_finished();
47 });
48 gClient.close();
49 }