Fix unit box timeout on browser-chrome test from Bug 444179, r=post-facto - CLOSED TREE

This commit is contained in:
Marco Bonardo 2009-01-30 15:26:35 +01:00
Родитель 7399ad83b5
Коммит a91615b8ae
1 изменённых файлов: 34 добавлений и 23 удалений

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

@ -268,28 +268,39 @@ function testSortByDir(aOrganizerWin, aPlaceContentTree, aUnsortFirst) {
function test() {
waitForExplicitFinish();
// Open the Places Library window.
let win = window.openDialog("chrome://browser/content/places/places.xul",
"",
"chrome,toolbar=yes,dialog=no,resizable");
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
getService(Ci.nsIWindowWatcher);
// Wait for it to load before we start.
win.addEventListener("load", function onload() {
win.removeEventListener("load", onload, false);
executeSoon(function () {
let tree = win.document.getElementById("placeContent");
isnot(tree, null, "sanity check: placeContent tree should exist");
// Run the tests.
testSortByColAndDir(win, tree, true);
testSortByColAndDir(win, tree, false);
testSortByDir(win, tree, true);
testSortByDir(win, tree, false);
testInvalid(win, tree);
// Reset the sort to SORT_BY_NONE.
setSort(win, tree, false, false);
// Close the window and finish.
win.close();
finish();
});
}, false);
let windowObserver = {
observe: function(aSubject, aTopic, aData) {
if (aTopic === "domwindowopened") {
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
win.addEventListener("load", function onLoad(event) {
win.removeEventListener("load", onLoad, false);
executeSoon(function () {
let tree = win.document.getElementById("placeContent");
isnot(tree, null, "sanity check: placeContent tree should exist");
// Run the tests.
testSortByColAndDir(win, tree, true);
testSortByColAndDir(win, tree, false);
testSortByDir(win, tree, true);
testSortByDir(win, tree, false);
testInvalid(win, tree);
// Reset the sort to SORT_BY_NONE.
setSort(win, tree, false, false);
// Close the window and finish.
win.close();
finish();
});
}, false);
}
}
};
ww.registerNotification(windowObserver);
ww.openWindow(null,
"chrome://browser/content/places/places.xul",
"",
"chrome,toolbar=yes,dialog=no,resizable",
null);
}