toolkit/devtools/server/tests/unit/test_pauselifetime-04.js

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:5624af20b5fa
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 /**
5 * Test that requesting a pause actor for the same value multiple
6 * times returns the same actor.
7 */
8
9 var gDebuggee;
10 var gClient;
11 var gThreadClient;
12
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 }
26
27 function test_pause_frame()
28 {
29 gThreadClient.addOneTimeListener("paused", function(aEvent, aPacket) {
30 let args = aPacket.frame.arguments;
31 let objActor1 = args[0].actor;
32
33 gThreadClient.getFrames(0, 1, function(aResponse) {
34 let frame = aResponse.frames[0];
35 do_check_eq(objActor1, frame.arguments[0].actor);
36 gThreadClient.resume(function () {
37 finishClient(gClient);
38 });
39 });
40 });
41
42 gDebuggee.eval("(" + function() {
43 function stopMe(aObject) {
44 debugger;
45 };
46 stopMe({ foo: "bar" });
47 } + ")()");
48 }

mercurial