Bug 1083045 - Scratchpad tests shouldn't depend on chrome debugging being disabled by default. r=past
--- a/browser/devtools/scratchpad/test/browser_scratchpad_edit_ui_updates.js
+++ b/browser/devtools/scratchpad/test/browser_scratchpad_edit_ui_updates.js
@@ -1,21 +1,23 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/* Bug 699130 */
"use strict";
let WebConsoleUtils = require("devtools/toolkit/webconsole/utils").Utils;
+let DEVTOOLS_CHROME_ENABLED = "devtools.chrome.enabled";
function test()
{
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
+ Services.prefs.setBoolPref(DEVTOOLS_CHROME_ENABLED, false);
gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
openScratchpad(runTests);
}, true);
content.location = "data:text/html,test Edit menu updates Scratchpad - bug 699130";
}
@@ -170,16 +172,17 @@ function runTests()
closeMenu(hideAfterPaste);
};
let hideAfterPaste = function() {
if (pass == 0) {
pass++;
testContextMenu();
} else {
+ Services.prefs.clearUserPref(DEVTOOLS_CHROME_ENABLED);
finish();
}
};
let testContextMenu = function() {
info("will test the context menu");
editMenu = null;
--- a/browser/devtools/scratchpad/test/browser_scratchpad_initialization.js
+++ b/browser/devtools/scratchpad/test/browser_scratchpad_initialization.js
@@ -1,16 +1,19 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
+let DEVTOOLS_CHROME_ENABLED = "devtools.chrome.enabled";
+
function test()
{
waitForExplicitFinish();
+ Services.prefs.setBoolPref(DEVTOOLS_CHROME_ENABLED, false);
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
ok(window.Scratchpad, "Scratchpad variable exists");
openScratchpad(runTests);
}, true);
@@ -39,10 +42,11 @@ function runTests()
"Error console command is disabled");
let chromeContextCommand = gScratchpadWindow.document.
getElementById("sp-cmd-browserContext");
ok(chromeContextCommand, "Chrome context command element exists");
is(chromeContextCommand.getAttribute("disabled"), "true",
"Chrome context command is disabled");
+ Services.prefs.clearUserPref(DEVTOOLS_CHROME_ENABLED);
finish();
}
--- a/browser/devtools/scratchpad/test/browser_scratchpad_modeline.js
+++ b/browser/devtools/scratchpad/test/browser_scratchpad_modeline.js
@@ -15,16 +15,17 @@ let gFile; // Reference to the temporary
let DEVTOOLS_CHROME_ENABLED = "devtools.chrome.enabled";
// The temporary file content.
let gFileContent = "function main() { return 0; }";
function test() {
waitForExplicitFinish();
+ Services.prefs.setBoolPref(DEVTOOLS_CHROME_ENABLED, false);
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
openScratchpad(runTests);
}, true);
content.location = "data:text/html,<p>test file open and save in Scratchpad";
}