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