Trial fix for bug 620789 - Intermittent browser_bug581253.js | Test timed out followed by Found a tab after previous test timed out; r=mak a=tests

--HG--
extra : rebase_source : d729d0641bfaff945c3f8912ce72dc05a477f0d2
This commit is contained in:
Hiroyuki Ikezoe 2011-02-08 14:16:37 -05:00
Родитель 319c09fc86
Коммит fb14f08d6b
1 изменённых файлов: 6 добавлений и 2 удалений

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

@ -5,10 +5,14 @@
let testURL = "data:text/plain,nothing but plain text"; let testURL = "data:text/plain,nothing but plain text";
let testTag = "581253_tag"; let testTag = "581253_tag";
let starButton = document.getElementById("star-button"); let starButton = document.getElementById("star-button");
let timerID = -1;
function test() { function test() {
registerCleanupFunction(function() { registerCleanupFunction(function() {
PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId); PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId);
if (timerID > 0) {
clearTimeout(timerID);
}
}); });
waitForExplicitFinish(); waitForExplicitFinish();
@ -31,12 +35,12 @@ function test() {
} }
function waitForStarChange(aValue, aCallback) { function waitForStarChange(aValue, aCallback) {
let starButton = document.getElementById("star-button");
if (PlacesStarButton._ignoreClicks || starButton.hasAttribute("starred") != aValue) { if (PlacesStarButton._ignoreClicks || starButton.hasAttribute("starred") != aValue) {
info("Waiting for star button change."); info("Waiting for star button change.");
setTimeout(arguments.callee, 50, aValue, aCallback); timerID = setTimeout(arguments.callee, 50, aValue, aCallback);
return; return;
} }
timerID = -1;
aCallback(); aCallback();
} }