Bug 597756 - Fx 4 Web Console fails to show javascript errors if a tab is closed and the same document is then re-opened in a new tab; f=rcampbell r=gavin.sharp a=blocking2.0

This commit is contained in:
Mihai Sucan 2010-11-20 15:53:14 -04:00
Родитель 21029a582f
Коммит aeef094291
3 изменённых файлов: 78 добавлений и 0 удалений

Просмотреть файл

@ -103,6 +103,7 @@ _BROWSER_TEST_FILES = \
browser_webconsole_bug_593003_iframe_wrong_hud.js \
browser_webconsole_bug_601909_remember_height.js \
browser_webconsole_bug_613013_console_api_iframe.js \
browser_webconsole_bug_597756_reopen_closed_tab.js \
head.js \
$(NULL)
@ -136,6 +137,7 @@ _BROWSER_TEST_PAGES = \
test-bug-597136-external-script-errors.html \
test-bug-597136-external-script-errors.js \
test-bug-613013-console-api-iframe.html \
test-bug-597756-reopen-closed-tab.html \
$(NULL)
libs:: $(_BROWSER_TEST_FILES)

Просмотреть файл

@ -0,0 +1,59 @@
/* 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):
* Mihai Șucan <mihai.sucan@gmail.com>
*
* ***** END LICENSE BLOCK ***** */
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-597756-reopen-closed-tab.html";
let newTabIsOpen = false;
function tabLoaded(aEvent) {
gBrowser.selectedBrowser.removeEventListener(aEvent.type, arguments.callee, true);
HUDService.activateHUDForContext(gBrowser.selectedTab);
gBrowser.selectedBrowser.addEventListener("load", tabReloaded, true);
content.location.reload();
}
function tabReloaded(aEvent) {
gBrowser.selectedBrowser.removeEventListener(aEvent.type, arguments.callee, true);
let hudId = HUDService.getHudIdByWindow(content);
let HUD = HUDService.hudReferences[hudId];
ok(HUD, "Web Console is open");
isnot(HUD.outputNode.textContent.indexOf("fooBug597756_error"), -1,
"error message must be in console output");
executeSoon(function() {
if (newTabIsOpen) {
testEnd();
return;
}
let newTab = gBrowser.addTab();
gBrowser.removeCurrentTab();
gBrowser.selectedTab = newTab;
newTabIsOpen = true;
gBrowser.selectedBrowser.addEventListener("load", tabLoaded, true);
content.location = TEST_URI;
});
}
function testEnd() {
gBrowser.removeCurrentTab();
executeSoon(finishTest);
}
function test() {
addTab(TEST_URI);
browser.addEventListener("load", tabLoaded, true);
}

Просмотреть файл

@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<html dir="ltr" xml:lang="en-US" lang="en-US">
<head>
<title>Bug 597756: test error logging after tab close and reopen</title>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
</head>
<body>
<h1>Bug 597756: test error logging after tab close and reopen.</h1>
<script type="text/javascript"><!--
fooBug597756_error.bar();
// --></script>
</body>
</html>