Bug 1301716 - Use old debugger in a few tests in other tools (part 1)
MozReview-Commit-ID: 1mT1lQx6Drp
--- a/devtools/client/webconsole/test/browser_console_optimized_out_vars.js
+++ b/devtools/client/webconsole/test/browser_console_optimized_out_vars.js
@@ -3,16 +3,22 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Check that inspecting an optimized out variable works when execution is
// paused.
"use strict";
+// Force the old debugger UI since it's directly used (see Bug 1301705)
+Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
+registerCleanupFunction(function* () {
+ Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
+})
+
function test() {
Task.spawn(function* () {
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-closure-optimized-out.html";
let {tab} = yield loadTab(TEST_URI);
let hud = yield openConsole(tab);
let { toolbox, panel, panelWin } = yield openDebugger();
--- a/devtools/client/webconsole/test/browser_console_variables_view_while_debugging.js
+++ b/devtools/client/webconsole/test/browser_console_variables_view_while_debugging.js
@@ -7,28 +7,36 @@
// from the js debugger, when changing the value of a property in the variables
// view.
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-eval-in-stackframe.html";
+// Force the old debugger UI since it's directly used (see Bug 1301705)
+Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
+registerCleanupFunction(function* () {
+ Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
+})
+
add_task(function* () {
yield loadTab(TEST_URI);
let hud = yield openConsole();
let dbgPanel = yield openDebugger();
- yield waitForFrameAdded(dbgPanel);
+ yield waitForFrameAdded();
yield openConsole();
yield testVariablesView(hud);
});
-function* waitForFrameAdded(dbgPanel) {
- let thread = dbgPanel.panelWin.DebuggerController.activeThread;
+function* waitForFrameAdded() {
+ let target = TargetFactory.forTab(gBrowser.selectedTab);
+ let toolbox = gDevTools.getToolbox(target);
+ let thread = toolbox.threadClient;
info("Waiting for framesadded");
yield new Promise(resolve => {
thread.addOneTimeListener("framesadded", resolve);
ContentTask.spawn(gBrowser.selectedBrowser, {}, function* () {
content.wrappedJSObject.firstCall();
});
});
--- a/devtools/client/webconsole/test/browser_console_variables_view_while_debugging_and_inspecting.js
+++ b/devtools/client/webconsole/test/browser_console_variables_view_while_debugging_and_inspecting.js
@@ -6,30 +6,38 @@
// Test that makes sure web console eval works while the js debugger paused the
// page, and while the inspector is active. See bug 886137.
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-eval-in-stackframe.html";
+// Force the old debugger UI since it's directly used (see Bug 1301705)
+Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
+registerCleanupFunction(function* () {
+ Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
+})
+
add_task(function* () {
yield loadTab(TEST_URI);
let hud = yield openConsole();
let dbgPanel = yield openDebugger();
yield openInspector();
- yield waitForFrameAdded(dbgPanel);
+ yield waitForFrameAdded();
yield openConsole();
yield testVariablesView(hud);
});
-function* waitForFrameAdded(dbgPanel) {
- let thread = dbgPanel.panelWin.DebuggerController.activeThread;
+function* waitForFrameAdded() {
+ let target = TargetFactory.forTab(gBrowser.selectedTab);
+ let toolbox = gDevTools.getToolbox(target);
+ let thread = toolbox.threadClient;
info("Waiting for framesadded");
yield new Promise(resolve => {
thread.addOneTimeListener("framesadded", resolve);
ContentTask.spawn(gBrowser.selectedBrowser, {}, function* () {
content.wrappedJSObject.firstCall();
});
});
--- a/devtools/client/webconsole/test/browser_eval_in_debugger_stackframe.js
+++ b/devtools/client/webconsole/test/browser_eval_in_debugger_stackframe.js
@@ -9,16 +9,22 @@
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-eval-in-stackframe.html";
var gWebConsole, gJSTerm, gDebuggerWin, gThread, gDebuggerController;
var gStackframes;
+// Force the old debugger UI since it's directly used (see Bug 1301705)
+Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
+registerCleanupFunction(function* () {
+ Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
+})
+
function test() {
loadTab(TEST_URI).then(() => {
openConsole().then(consoleOpened);
});
}
function consoleOpened(hud) {
gWebConsole = hud;
--- a/devtools/client/webconsole/test/browser_eval_in_debugger_stackframe2.js
+++ b/devtools/client/webconsole/test/browser_eval_in_debugger_stackframe2.js
@@ -6,16 +6,23 @@
// Test to make sure that web console commands can fire while paused at a
// breakpoint that was triggered from a JS call. Relies on asynchronous js
// evaluation over the protocol - see Bug 1088861.
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-eval-in-stackframe.html";
+
+// Force the old debugger UI since it's directly used (see Bug 1301705)
+Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
+registerCleanupFunction(function* () {
+ Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
+})
+
add_task(function* () {
yield loadTab(TEST_URI);
info("open the web console");
let hud = yield openConsole();
let {jsterm} = hud;
info("open the debugger");
--- a/devtools/client/webconsole/test/browser_webconsole_autocomplete_in_debugger_stackframe.js
+++ b/devtools/client/webconsole/test/browser_webconsole_autocomplete_in_debugger_stackframe.js
@@ -6,16 +6,22 @@
// Test that makes sure web console autocomplete happens in the user-selected
// stackframe from the js debugger.
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-autocomplete-in-stackframe.html";
+// Force the old debugger UI since it's directly used (see Bug 1301705)
+Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
+registerCleanupFunction(function* () {
+ Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
+})
+
var gStackframes;
registerCleanupFunction(function () {
gStackframes = null;
});
requestLongerTimeout(2);
add_task(function* () {
yield loadTab(TEST_URI);
--- a/devtools/client/webconsole/test/browser_webconsole_bug_1050691_click_function_to_source.js
+++ b/devtools/client/webconsole/test/browser_webconsole_bug_1050691_click_function_to_source.js
@@ -5,16 +5,22 @@
// Tests that clicking on a function displays its source in the debugger.
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-bug_1050691_click_function_to_source.html";
+// Force the old debugger UI since it's directly used (see Bug 1301705)
+Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
+registerCleanupFunction(function* () {
+ Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
+})
+
add_task(function* () {
yield loadTab(TEST_URI);
let hud = yield openConsole();
// Open the Debugger panel.
let debuggerPanel = yield openDebugger();
// And right after come back to the Console panel.
yield openConsole();
--- a/devtools/client/webconsole/test/browser_webconsole_bug_766001_JS_Console_in_Debugger.js
+++ b/devtools/client/webconsole/test/browser_webconsole_bug_766001_JS_Console_in_Debugger.js
@@ -6,16 +6,22 @@
// Test that message source links for js errors and console API calls open in
// the jsdebugger when clicked.
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/test" +
"/test-bug-766001-js-console-links.html";
+// Force the old debugger UI since it's directly used (see Bug 1301705)
+Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
+registerCleanupFunction(function* () {
+ Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
+})
+
function test() {
let hud;
requestLongerTimeout(2);
Task.spawn(runner).then(finishTest);
function* runner() {
// On e10s, the exception is triggered in child process
--- a/devtools/client/webconsole/test/browser_webconsole_closure_inspection.js
+++ b/devtools/client/webconsole/test/browser_webconsole_closure_inspection.js
@@ -8,16 +8,22 @@
"use strict";
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test/test-closures.html";
var gWebConsole, gJSTerm, gVariablesView;
+// Force the old debugger UI since it's directly used (see Bug 1301705)
+Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
+registerCleanupFunction(function* () {
+ Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
+})
+
function test() {
registerCleanupFunction(() => {
gWebConsole = gJSTerm = gVariablesView = null;
});
function fetchScopes(hud, toolbox, panelWin, deferred) {
panelWin.once(panelWin.EVENTS.FETCHED_SCOPES, () => {
ok(true, "Scopes were fetched");
--- a/devtools/client/webconsole/test/browser_webconsole_input_field_focus_on_panel_select.js
+++ b/devtools/client/webconsole/test/browser_webconsole_input_field_focus_on_panel_select.js
@@ -21,14 +21,14 @@ add_task(function* () {
hud.ui.filterBox.focus();
is(hud.ui.filterBox.hasAttribute("focused"), true,
"filterBox should be focused");
is(hud.jsterm.inputNode.hasAttribute("focused"), false,
"inputNode shouldn't be focused");
- yield openDebugger();
+ yield openInspector();
hud = yield openConsole();
is(hud.jsterm.inputNode.hasAttribute("focused"), true,
"inputNode should be focused");
});