|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 var gDebuggee; |
|
5 var gClient; |
|
6 var gThreadClient; |
|
7 |
|
8 function run_test() |
|
9 { |
|
10 initTestDebuggerServer(); |
|
11 gDebuggee = addTestGlobal("test-stack"); |
|
12 gClient = new DebuggerClient(DebuggerServer.connectPipe()); |
|
13 gClient.connect(function() { |
|
14 attachTestTabAndResume(gClient, "test-stack", function(aResponse, aTabClient, aThreadClient) { |
|
15 gThreadClient = aThreadClient; |
|
16 test_pause_frame(); |
|
17 }); |
|
18 }); |
|
19 do_test_pending(); |
|
20 } |
|
21 |
|
22 function test_pause_frame() |
|
23 { |
|
24 gThreadClient.addOneTimeListener("paused", function(aEvent, aPacket) { |
|
25 gThreadClient.addOneTimeListener("framesadded", function() { |
|
26 do_check_eq(gThreadClient.cachedFrames.length, 3); |
|
27 do_check_true(gThreadClient.moreFrames); |
|
28 do_check_false(gThreadClient.fillFrames(3)); |
|
29 |
|
30 do_check_true(gThreadClient.fillFrames(30)); |
|
31 gThreadClient.addOneTimeListener("framesadded", function() { |
|
32 do_check_false(gThreadClient.moreFrames); |
|
33 do_check_eq(gThreadClient.cachedFrames.length, 7); |
|
34 gThreadClient.resume(function() { |
|
35 finishClient(gClient); |
|
36 }); |
|
37 }); |
|
38 }); |
|
39 do_check_true(gThreadClient.fillFrames(3)); |
|
40 }); |
|
41 |
|
42 gDebuggee.eval("(" + function() { |
|
43 var recurseLeft = 5; |
|
44 function recurse() { |
|
45 if (--recurseLeft == 0) { |
|
46 debugger; |
|
47 return; |
|
48 } |
|
49 recurse(); |
|
50 }; |
|
51 recurse(); |
|
52 } + ")()"); |
|
53 } |