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 /**
5 * Test that setting ignoreCaughtExceptions will cause the debugger to ignore
6 * caught exceptions, but not uncaught ones.
7 */
9 var gDebuggee;
10 var gClient;
11 var gThreadClient;
13 function run_test()
14 {
15 initTestDebuggerServer();
16 gDebuggee = addTestGlobal("test-stack");
17 gClient = new DebuggerClient(DebuggerServer.connectPipe());
18 gClient.connect(function() {
19 attachTestTabAndResume(gClient, "test-stack", function(aResponse, aTabClient, aThreadClient) {
20 gThreadClient = aThreadClient;
21 test_pause_frame();
22 });
23 });
24 do_test_pending();
25 }
27 function test_pause_frame()
28 {
29 gThreadClient.addOneTimeListener("paused", function(aEvent, aPacket) {
30 gThreadClient.addOneTimeListener("paused", function(aEvent, aPacket) {
31 do_check_eq(aPacket.why.type, "exception");
32 do_check_eq(aPacket.why.exception, "bar");
33 gThreadClient.resume(function () {
34 finishClient(gClient);
35 });
36 });
37 gThreadClient.pauseOnExceptions(true, true);
38 gThreadClient.resume();
39 });
41 try {
42 gDebuggee.eval("(" + function() {
43 debugger;
44 try {
45 throw "foo";
46 } catch (e) {}
47 throw "bar";
48 } + ")()");
49 } catch (e) {}
50 }