Bug 1306124 - Getting tests outside of webconsole/ to work when the new output area is on by default;r=linclark
MozReview-Commit-ID: Gva7BnXw9PL
--- a/devtools/client/commandline/test/browser_cmd_commands.js
+++ b/devtools/client/commandline/test/browser_cmd_commands.js
@@ -1,16 +1,22 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Test various GCLI commands
const TEST_URI = "data:text/html;charset=utf-8,gcli-commands";
const HUDService = require("devtools/client/webconsole/hudservice");
+// Use the old webconsole since pprint isn't working on new one (Bug 1304794)
+Services.prefs.setBoolPref("devtools.webconsole.new-frontend-enabled", false);
+registerCleanupFunction(function* () {
+ Services.prefs.clearUserPref("devtools.webconsole.new-frontend-enabled");
+});
+
function test() {
return Task.spawn(spawnTest).then(finish, helpers.handleError);
}
function* spawnTest() {
let options = yield helpers.openTab(TEST_URI);
yield helpers.openToolbar(options);
--- a/devtools/client/framework/test/browser_toolbox_select_event.js
+++ b/devtools/client/framework/test/browser_toolbox_select_event.js
@@ -2,16 +2,18 @@
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const PAGE_URL = "data:text/html;charset=utf-8,test select events";
+requestLongerTimeout(2);
+
add_task(function* () {
let tab = yield addTab(PAGE_URL);
let toolbox = yield openToolboxForTab(tab, "webconsole", "bottom");
yield testSelectEvent("inspector");
yield testSelectEvent("webconsole");
yield testSelectEvent("styleeditor");
yield testSelectEvent("inspector");
--- a/devtools/client/inspector/test/browser_inspector_menu-04-use-in-console.js
+++ b/devtools/client/inspector/test/browser_inspector_menu-04-use-in-console.js
@@ -6,16 +6,23 @@ http://creativecommons.org/publicdomain/
// Tests "Use in Console" menu item
const TEST_URL = URL_ROOT + "doc_inspector_menu.html";
registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.toolbox.splitconsoleEnabled");
});
+// Use the old webconsole since the node isn't being rendered as an HTML tag
+// in the new one (Bug 1304794)
+Services.prefs.setBoolPref("devtools.webconsole.new-frontend-enabled", false);
+registerCleanupFunction(function* () {
+ Services.prefs.clearUserPref("devtools.webconsole.new-frontend-enabled");
+});
+
add_task(function* () {
let { inspector, toolbox } = yield openInspectorForURL(TEST_URL);
yield testUseInConsole();
function* testUseInConsole() {
info("Testing 'Use in Console' menu item.");
--- a/devtools/client/scratchpad/test/browser_scratchpad_wrong_window_focus.js
+++ b/devtools/client/scratchpad/test/browser_scratchpad_wrong_window_focus.js
@@ -1,13 +1,18 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/* Bug 661762 */
+// Use the old webconsole since scratchpad focus isn't working on new one (Bug 1304794)
+Services.prefs.setBoolPref("devtools.webconsole.new-frontend-enabled", false);
+registerCleanupFunction(function* () {
+ Services.prefs.clearUserPref("devtools.webconsole.new-frontend-enabled");
+});
function test()
{
waitForExplicitFinish();
// To test for this bug we open a Scratchpad window, save its
// reference and then open another one. This way the first window
// loses its focus.
--- a/devtools/client/shared/test/browser_toolbar_webconsole_errors_count.js
+++ b/devtools/client/shared/test/browser_toolbar_webconsole_errors_count.js
@@ -1,13 +1,21 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that the developer toolbar errors count works properly.
+// Use the old webconsole since this is directly accessing old DOM, and
+// the error count isn't reset when pressing the clear button in new one
+// See Bug 1304794.
+Services.prefs.setBoolPref("devtools.webconsole.new-frontend-enabled", false);
+registerCleanupFunction(function* () {
+ Services.prefs.clearUserPref("devtools.webconsole.new-frontend-enabled");
+});
+
function test() {
const TEST_URI = TEST_URI_ROOT + "browser_toolbar_webconsole_errors_count.html";
let tab1, tab2, webconsole;
Services.prefs.setBoolPref("javascript.options.strict", true);
--- a/devtools/client/webconsole/net/test/mochitest/head.js
+++ b/devtools/client/webconsole/net/test/mochitest/head.js
@@ -20,16 +20,23 @@ const NET_XHR_PREF = "devtools.webconsol
Services.prefs.setBoolPref(NET_INFO_PREF, true);
Services.prefs.setBoolPref(NET_XHR_PREF, true);
registerCleanupFunction(() => {
Services.prefs.clearUserPref(NET_INFO_PREF, true);
Services.prefs.clearUserPref(NET_XHR_PREF, true);
});
+// Use the old webconsole since the new one doesn't yet support
+// XHR spy. See Bug 1304794.
+Services.prefs.setBoolPref("devtools.webconsole.new-frontend-enabled", false);
+registerCleanupFunction(function* () {
+ Services.prefs.clearUserPref("devtools.webconsole.new-frontend-enabled");
+});
+
/**
* Add a new test tab in the browser and load the given url.
* @param {String} url The url to be loaded in the new tab
* @return a promise that resolves to the tab object when the url is loaded
*/
function addTestTab(url) {
info("Adding a new JSON tab with URL: '" + url + "'");