Bug 917271 - Fix race condition in browser_bug624734.js by checking for the completion of the async places call, r=dao

This commit is contained in:
Gijs Kruitbosch 2013-09-18 23:49:31 +02:00
parent 3f371ab30b
commit be64c9b2ab

View File

@ -4,6 +4,15 @@
// Bug 624734 - Star UI has no tooltip until bookmarked page is visited
function finishTest() {
is(BookmarkingUI.button.getAttribute("buttontooltiptext"),
BookmarkingUI._unstarredTooltip,
"Star icon should have the unstarred tooltip text");
gBrowser.removeCurrentTab();
finish();
}
function test() {
waitForExplicitFinish();
@ -11,12 +20,11 @@ function test() {
tab.linkedBrowser.addEventListener("load", (function(event) {
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
is(BookmarkingUI.button.getAttribute("buttontooltiptext"),
BookmarkingUI._unstarredTooltip,
"Star icon should have the unstarred tooltip text");
gBrowser.removeCurrentTab();
finish();
if (BookmarkingUI._pendingStmt) {
waitForCondition(function() !BookmarkingUI._pendingStmt, finishTest, "BookmarkingUI held pending statement for too long");
} else {
finishTest();
}
}), true);
tab.linkedBrowser.loadURI("http://example.com/browser/browser/base/content/test/dummy_page.html");