fix handling of about:blank in browser_tabMatchesInAwesomebar.js

This commit is contained in:
Dão Gottwald 2010-11-07 15:04:59 +01:00
Родитель e1ce27e29c
Коммит b804796f22
2 изменённых файлов: 10 добавлений и 1 удалений

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

@ -1082,6 +1082,9 @@
<parameter name="aAllowThirdPartyFixup"/>
<body>
<![CDATA[
if (document.documentElement.getAttribute("chromehidden"))
throw Error("Won't open multiple tabs in popups");
var aFromExternal;
var aRelatedToCurrent;
var aSkipAnimation;

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

@ -121,7 +121,7 @@ var gTestSteps = [
},
function() {
info("Running step 7 - remove tab immediately");
let tab = gBrowser.addTab("about:blank");
let tab = gBrowser.addTab("about:logo");
gBrowser.removeTab(tab);
ensure_opentabs_match_db();
nextStep();
@ -209,6 +209,8 @@ function ensure_opentabs_match_db() {
for (let i = 0; i < browserWin.gBrowser.tabContainer.childElementCount; i++) {
let browser = browserWin.gBrowser.getBrowserAtIndex(i);
let url = browser.currentURI.spec;
if (url == "about:blank")
continue;
if (!(url in tabs))
tabs[url] = 1;
else
@ -249,6 +251,10 @@ function ensure_opentabs_match_db() {
ok(dbtabs.indexOf(url) > -1,
"tab is open (" + tabs[url] + " times) and should recorded in db: " + url);
}
dbtabs.forEach(function (url) {
ok(url in tabs,
"db-recorded tab should actually exist: " + url);
});
}
/**