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.
michael@0 | 1 | /* Any copyright is dedicated to the Public Domain. |
michael@0 | 2 | http://creativecommons.org/publicdomain/zero/1.0/ */ |
michael@0 | 3 | |
michael@0 | 4 | /** |
michael@0 | 5 | * Test that stackframes are added when debugger is paused. |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | const TAB_URL = EXAMPLE_URL + "doc_recursion-stack.html"; |
michael@0 | 9 | |
michael@0 | 10 | let gTab, gDebuggee, gPanel, gDebugger; |
michael@0 | 11 | let gFrames, gClassicFrames; |
michael@0 | 12 | |
michael@0 | 13 | function test() { |
michael@0 | 14 | initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => { |
michael@0 | 15 | gTab = aTab; |
michael@0 | 16 | gDebuggee = aDebuggee; |
michael@0 | 17 | gPanel = aPanel; |
michael@0 | 18 | gDebugger = gPanel.panelWin; |
michael@0 | 19 | gFrames = gDebugger.DebuggerView.StackFrames; |
michael@0 | 20 | gClassicFrames = gDebugger.DebuggerView.StackFramesClassicList; |
michael@0 | 21 | |
michael@0 | 22 | waitForSourceAndCaretAndScopes(gPanel, ".html", 14).then(performTest); |
michael@0 | 23 | gDebuggee.simpleCall(); |
michael@0 | 24 | }); |
michael@0 | 25 | } |
michael@0 | 26 | |
michael@0 | 27 | function performTest() { |
michael@0 | 28 | is(gDebugger.gThreadClient.state, "paused", |
michael@0 | 29 | "Should only be getting stack frames while paused."); |
michael@0 | 30 | is(gFrames.itemCount, 1, |
michael@0 | 31 | "Should have only one frame."); |
michael@0 | 32 | is(gClassicFrames.itemCount, 1, |
michael@0 | 33 | "Should also have only one frame in the mirrored view."); |
michael@0 | 34 | |
michael@0 | 35 | resumeDebuggerThenCloseAndFinish(gPanel); |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | registerCleanupFunction(function() { |
michael@0 | 39 | gTab = null; |
michael@0 | 40 | gDebuggee = null; |
michael@0 | 41 | gPanel = null; |
michael@0 | 42 | gDebugger = null; |
michael@0 | 43 | gFrames = null; |
michael@0 | 44 | gClassicFrames = null; |
michael@0 | 45 | }); |