diff -r 000000000000 -r 6474c204b198 browser/devtools/debugger/test/browser_dbg_clean-exit.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/devtools/debugger/test/browser_dbg_clean-exit.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,39 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Test that closing a tab with the debugger in a paused state exits cleanly. + */ + +let gTab, gDebuggee, gPanel, gDebugger; + +const TAB_URL = EXAMPLE_URL + "doc_inline-debugger-statement.html"; + +function test() { + initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => { + gTab = aTab; + gDebuggee = aDebuggee; + gPanel = aPanel; + gDebugger = gPanel.panelWin; + + testCleanExit(); + }); +} + +function testCleanExit() { + waitForSourceAndCaretAndScopes(gPanel, ".html", 16).then(() => { + is(gDebugger.gThreadClient.paused, true, + "Should be paused after the debugger statement."); + + closeDebuggerAndFinish(gPanel, { whilePaused: true }); + }); + + gDebuggee.runDebuggerStatement(); +} + +registerCleanupFunction(function() { + gTab = null; + gDebuggee = null; + gPanel = null; + gDebugger = null; +});