Bug 702707 - Web console is buggy in window mode; r=dcamp

This commit is contained in:
Rob Campbell 2011-11-17 09:22:07 -08:00
parent b57ef41b90
commit 30f1888b97
3 changed files with 49 additions and 1 deletions

View File

@ -6201,7 +6201,7 @@ HeadsUpDisplayUICommands = {
if (hudRef && hud) {
if (hudRef.consolePanel) {
HUDService.deactivateHUDForContext(gBrowser.selectedTab, false);
hudRef.consolePanel.hidePopup();
}
else {
HUDService.storeHeight(hudId);

View File

@ -150,6 +150,7 @@ _BROWSER_TEST_FILES = \
browser_gcli_require.js \
browser_gcli_web.js \
browser_webconsole_bug_658368_time_methods.js \
browser_webconsole_window_zombie.js \
head.js \
$(NULL)

View File

@ -0,0 +1,47 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const TEST_URI = "data:text/html,<p>test for bug 577721";
const POSITION_PREF = "devtools.webconsole.position";
function test() {
addTab(TEST_URI);
browser.addEventListener("DOMContentLoaded", onLoad, false);
registerCleanupFunction(testEnd);
}
function testEnd() {
Services.prefs.clearUserPref(POSITION_PREF);
}
function onLoad() {
browser.removeEventListener("DOMContentLoaded", onLoad, false);
openConsole();
let hudId = HUDService.getHudIdByWindow(content);
let hudRef = HUDService.hudReferences[hudId];
let hudBox = hudRef.HUDBox;
// listen for the panel popupshown event.
document.addEventListener("popupshown", function popupShown() {
document.removeEventListener("popupshown", popupShown, false);
ok(hudRef.consolePanel, "console is in a panel");
document.addEventListener("popuphidden", function popupHidden() {
document.removeEventListener("popuphidden", popupHidden, false);
finishTest();
}, false);
// Close the window console via the menu item
let menu = document.getElementById("webConsole");
menu.click();
}, false);
hudRef.positionConsole("window");
}