mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 00:25:27 +00:00
Bug 581231 - Part 4: Add the Close button to the Web Console and style it on the Mac. r=dietrich a=dietrich
This commit is contained in:
parent
b995a4da65
commit
49ed265ef8
@ -46,6 +46,7 @@ include $(topsrcdir)/config/rules.mk
|
|||||||
_BROWSER_TEST_FILES = \
|
_BROWSER_TEST_FILES = \
|
||||||
browser_HUDServiceTestsAll.js \
|
browser_HUDServiceTestsAll.js \
|
||||||
browser_webconsole_netlogging.js \
|
browser_webconsole_netlogging.js \
|
||||||
|
browser_webconsole_bug_581231_close_button.js \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
_BROWSER_TEST_PAGES = \
|
_BROWSER_TEST_PAGES = \
|
||||||
|
@ -0,0 +1,48 @@
|
|||||||
|
/* vim:set ts=2 sw=2 sts=2 et: */
|
||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Any copyright is dedicated to the Public Domain.
|
||||||
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
|
*
|
||||||
|
* Contributor(s):
|
||||||
|
* Patrick Walton <pcwalton@mozilla.com>
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
// Tests that the Web Console close button functions.
|
||||||
|
|
||||||
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||||
|
Cu.import("resource://gre/modules/HUDService.jsm");
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
|
||||||
|
|
||||||
|
function test() {
|
||||||
|
waitForExplicitFinish();
|
||||||
|
content.location.href = TEST_URI;
|
||||||
|
waitForFocus(onFocus);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onFocus() {
|
||||||
|
let tabBrowser = gBrowser.getBrowserForTab(gBrowser.selectedTab);
|
||||||
|
tabBrowser.addEventListener("DOMContentLoaded", testCloseButton, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
function testCloseButton() {
|
||||||
|
let tabBrowser = gBrowser.getBrowserForTab(gBrowser.selectedTab);
|
||||||
|
tabBrowser.removeEventListener("DOMContentLoaded", testCloseButton, false);
|
||||||
|
|
||||||
|
HUDService.activateHUDForContext(gBrowser.selectedTab);
|
||||||
|
|
||||||
|
let hudId = HUDService.displaysIndex()[0];
|
||||||
|
let hudBox = HUDService.getHeadsUpDisplay(hudId);
|
||||||
|
|
||||||
|
let closeButton = hudBox.querySelector(".jsterm-close-button");
|
||||||
|
ok(closeButton != null, "we have the close button");
|
||||||
|
|
||||||
|
EventUtils.synthesizeMouse(closeButton, 0, 0, {});
|
||||||
|
|
||||||
|
ok(!(hudId in HUDService.windowRegistry), "the console is closed when the " +
|
||||||
|
"close button is pressed");
|
||||||
|
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user