Bug 1266134 - fix browser_dbg_on-pause-raise.js r=jryans
MozReview-Commit-ID: C729WEFBy7P
--- a/devtools/client/debugger/test/mochitest/browser_dbg_on-pause-raise.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_on-pause-raise.js
@@ -4,37 +4,16 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that the toolbox is raised when the debugger gets paused.
*/
const TAB_URL = EXAMPLE_URL + "doc_recursion-stack.html";
-function focusMainWindow() {
- // Make sure toolbox is not focused.
- let onFocused = new Promise(done => {
- function onFocus() {
- window.removeEventListener("focus", onFocus, true);
- info("Main window focused.");
- done();
- }
- window.addEventListener("focus", onFocus, true);
- });
- info("Focusing main window.");
-
- // Execute soon to avoid any race conditions between toolbox and main window
- // getting focused.
- executeSoon(() => {
- window.focus();
- });
-
- return onFocused;
-}
-
add_task(function *() {
let options = {
source: TAB_URL,
line: 1
};
let [tab,, panel] = yield initDebugger(TAB_URL, options);
let panelWin = panel.panelWin;
let toolbox = panel._toolbox;
@@ -45,19 +24,21 @@ add_task(function *() {
"The newly added tab is different from the debugger's tab.");
is(gBrowser.selectedTab, newTab,
"Debugger's tab is not the selected tab.");
info("Run tests against bottom host.");
yield testPause();
yield testResume();
+ // testResume selected the console, select back the debugger.
+ yield toolbox.selectTool("jsdebugger");
+
info("Switching to a toolbox window host.");
yield toolbox.switchHost(Toolbox.HostType.WINDOW);
- yield focusMainWindow();
info("Run tests against window host.");
yield testPause();
yield testResume();
info("Cleanup after the test.");
yield toolbox.switchHost(Toolbox.HostType.BOTTOM);
yield closeDebuggerAndFinish(panel);