gecko/browser/devtools/debugger/test/browser_dbg_clean-exit.js
Victor Porof 101a25592f Bug 812083 - Implement a SideMenuWidget (add a tree view to the remote debugger's script selector), r=past,rcampbell
--HG--
rename : browser/devtools/debugger/test/browser_dbg_script-switching.js => browser/devtools/debugger/test/browser_dbg_scripts-switching.js
2013-02-21 01:33:36 +02:00

44 lines
1.0 KiB
JavaScript

/*
* 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.
var gPane = null;
var gTab = null;
var gDebugger = null;
const DEBUGGER_TAB_URL = EXAMPLE_URL + "browser_dbg_debuggerstatement.html";
function test() {
debug_tab_pane(DEBUGGER_TAB_URL, function(aTab, aDebuggee, aPane) {
gTab = aTab;
gPane = aPane;
gDebugger = gPane.panelWin;
testCleanExit();
});
}
function testCleanExit() {
gDebugger.DebuggerController.activeThread.addOneTimeListener("framesadded", function() {
Services.tm.currentThread.dispatch({ run: function() {
is(gDebugger.DebuggerController.activeThread.paused, true,
"Should be paused after the debugger statement.");
closeDebuggerAndFinish();
}}, 0);
});
gTab.linkedBrowser.contentWindow.wrappedJSObject.runDebuggerStatement();
}
registerCleanupFunction(function() {
removeTab(gTab);
gPane = null;
gTab = null;
gDebugger = null;
});