Bug 905854 - The browser console shortcut is broken from Scratchpad. r=robcee, a=akeybl

This commit is contained in:
Brandon Benvie 2013-08-19 11:49:18 -07:00
parent aca0172974
commit 54e9d7087c
3 changed files with 39 additions and 1 deletions

View File

@ -1175,7 +1175,7 @@ var Scratchpad = {
*/
openErrorConsole: function SP_openErrorConsole()
{
this.browserWindow.HUDConsoleUI.toggleBrowserConsole();
this.browserWindow.HUDService.toggleBrowserConsole();
},
/**

View File

@ -38,6 +38,7 @@ MOCHITEST_BROWSER_FILES = \
browser_scratchpad_bug_644413_modeline.js \
browser_scratchpad_bug807924_cannot_convert_to_string.js \
browser_scratchpad_long_string.js \
browser_scratchpad_open_error_console.js \
head.js \
# Disable test due to bug 807234 becoming basically permanent

View File

@ -0,0 +1,37 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
function test()
{
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
openScratchpad(runTests);
}, true);
content.location = "data:text/html;charset=utf8,test Scratchpad." +
"openErrorConsole()";
}
function runTests()
{
Services.obs.addObserver(function observer(aSubject) {
Services.obs.removeObserver(observer, "web-console-created");
aSubject.QueryInterface(Ci.nsISupportsString);
let hud = HUDService.getBrowserConsole();
ok(hud, "browser console is open");
is(aSubject.data, hud.hudId, "notification hudId is correct");
HUDService.toggleBrowserConsole().then(finish);
}, "web-console-created", false);
let hud = HUDService.getBrowserConsole();
ok(!hud, "browser console is not open");
info("wait for the browser console to open from Scratchpad");
gScratchpadWindow.Scratchpad.openErrorConsole();
}