Bug 612609 - browser_discovery.js is permaorange on Places branch.

r=sdwilsh
a=blocking
This commit is contained in:
Marco Bonardo 2010-11-17 10:25:13 -08:00
Родитель 4a74dc2447
Коммит 4b80544a47
1 изменённых файлов: 7 добавлений и 8 удалений

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

@ -1,13 +1,12 @@
var currentHandler;
var browser;
function doc() browser.contentDocument;
function setHandlerFunc(aResultFunc) {
if (currentHandler)
gBrowser.removeEventListener("DOMLinkAdded", currentHandler, false);
gBrowser.addEventListener("DOMLinkAdded", aResultFunc, false);
currentHandler = aResultFunc;
gBrowser.addEventListener("DOMLinkAdded", function (event) {
gBrowser.removeEventListener("DOMLinkAdded", arguments.callee, false);
executeSoon(aResultFunc);
}, false);
}
function test() {
@ -49,8 +48,8 @@ function runIconDiscoveryTest() {
}
function iconDiscovery() {
setHandlerFunc(runIconDiscoveryTest);
if (iconDiscoveryTests.length) {
setHandlerFunc(runIconDiscoveryTest);
gBrowser.setIcon(gBrowser.selectedTab, null);
var test = iconDiscoveryTests[0];
@ -59,7 +58,7 @@ function iconDiscovery() {
var rootDir = getRootDirectory(gTestPath);
var rel = test.rel || "icon";
var href = test.href || rootDir + "/moz.png";
var href = test.href || rootDir + "moz.png";
var type = test.type || "image/png";
if (test.pass == undefined)
test.pass = true;
@ -119,7 +118,6 @@ function runMultipleEnginesTestAndFinalize() {
is(browser.engines[0].uri, "http://first.mozilla.com/search.xml", "first engine wins");
gBrowser.removeCurrentTab();
gBrowser.removeEventListener("DOMLinkAdded", currentHandler, false);
finish();
}
@ -144,6 +142,7 @@ function searchDiscovery() {
link.title = title;
head.appendChild(link);
} else {
setHandlerFunc(runMultipleEnginesTestAndFinalize);
setHandlerFunc(runMultipleEnginesTestAndFinalize);
// Test multiple engines with the same title
var link = doc().createElement("link");