|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 var gClient; |
|
5 var gDebuggee; |
|
6 |
|
7 function run_test() |
|
8 { |
|
9 initTestDebuggerServer(); |
|
10 gDebuggee = testGlobal("test-1"); |
|
11 DebuggerServer.addTestGlobal(gDebuggee); |
|
12 |
|
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 } |
|
20 |
|
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 } |
|
30 |
|
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 } |
|
42 |
|
43 function cleanup() |
|
44 { |
|
45 gClient.addListener("closed", function(aEvent) { |
|
46 do_test_finished(); |
|
47 }); |
|
48 gClient.close(); |
|
49 } |
|
50 |