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 /**
5 * Test that stackframes are cleared after resume.
6 */
8 const TAB_URL = EXAMPLE_URL + "doc_recursion-stack.html";
10 let gTab, gDebuggee, gPanel, gDebugger;
11 let gFrames, gClassicFrames;
13 function test() {
14 initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
15 gTab = aTab;
16 gDebuggee = aDebuggee;
17 gPanel = aPanel;
18 gDebugger = gPanel.panelWin;
19 gFrames = gDebugger.DebuggerView.StackFrames;
20 gClassicFrames = gDebugger.DebuggerView.StackFramesClassicList;
22 waitForSourceAndCaretAndScopes(gPanel, ".html", 1).then(performTest);
23 gDebuggee.evalCall();
24 });
25 }
27 function performTest() {
28 is(gDebugger.gThreadClient.state, "paused",
29 "Should only be getting stack frames while paused.");
30 is(gFrames.itemCount, 2,
31 "Should have two frames.");
32 is(gClassicFrames.itemCount, 2,
33 "Should also have two frames in the mirrored view.");
35 gDebugger.once(gDebugger.EVENTS.AFTER_FRAMES_CLEARED, () => {
36 is(gFrames.itemCount, 0,
37 "Should have no frames after resume.");
38 is(gClassicFrames.itemCount, 0,
39 "Should also have no frames in the mirrored view after resume.");
41 closeDebuggerAndFinish(gPanel);
42 }, true);
44 gDebugger.gThreadClient.resume();
45 }
47 registerCleanupFunction(function() {
48 gTab = null;
49 gDebuggee = null;
50 gPanel = null;
51 gDebugger = null;
52 gFrames = null;
53 gClassicFrames = null;
54 });