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.
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 }