Bug 513560 - mochitest-browser-chrome: intermittent "browser_passwordmgrdlg.js | Timed out"; r=dolske

This commit is contained in:
Ehsan Akhgari 2009-11-12 13:10:04 -05:00
Родитель 284d0a4d47
Коммит f27631a155
2 изменённых файлов: 26 добавлений и 42 удалений

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

@ -92,23 +92,11 @@ function test() {
// Detect when the password manager window is opened
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
getService(Ci.nsIWindowWatcher);
let obs = {
observe: function(aSubject, aTopic, aData) {
// unregister ourself
ww.unregisterNotification(this);
let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
win.addEventListener("load", function() {
win.removeEventListener("load", arguments.callee, true);
setTimeout(doTest, 0);
}, true);
}
};
ww.registerNotification(obs);
// Open the password manager dialog
const PWMGR_DLG = "chrome://passwordmgr/content/passwordManager.xul";
let pwmgrdlg = window.openDialog(PWMGR_DLG, "Toolkit:PasswordManager", "");
SimpleTest.waitForFocus(doTest, pwmgrdlg);
// the meat of the test
function doTest() {
@ -133,12 +121,9 @@ function test() {
ww.unregisterNotification(this);
else if (aTopic == "domwindowopened") {
let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
win.addEventListener("load", function() {
win.removeEventListener("load", arguments.callee, true);
setTimeout(function() {
EventUtils.synthesizeKey("VK_RETURN", {}, win)
}, 0);
}, true);
SimpleTest.waitForFocus(function() {
EventUtils.synthesizeKey("VK_RETURN", {}, win)
}, win);
}
}
};
@ -254,9 +239,16 @@ function test() {
checkColumnEntries(2, expectedValues);
checkSortDirection(passwordCol, true);
// cleanup
ww.registerNotification({
observe: function(aSubject, aTopic, aData) {
// unregister ourself
ww.unregisterNotification(this);
pwmgr.removeAllLogins();
finish();
}
});
pwmgrdlg.close();
pwmgr.removeAllLogins();
finish();
}
}

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

@ -77,23 +77,11 @@ function test() {
// Detect when the password manager window is opened
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
getService(Ci.nsIWindowWatcher);
let obs = {
observe: function(aSubject, aTopic, aData) {
// unregister ourself
ww.unregisterNotification(this);
let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
win.addEventListener("focus", function() {
win.removeEventListener("focus", arguments.callee, true);
setTimeout(doTest, 0);
}, true);
}
};
ww.registerNotification(obs);
// Open the password manager dialog
const PWMGR_DLG = "chrome://passwordmgr/content/passwordManager.xul";
let pwmgrdlg = window.openDialog(PWMGR_DLG, "Toolkit:PasswordManager", "");
SimpleTest.waitForFocus(doTest, pwmgrdlg);
// the meat of the test
function doTest() {
@ -143,12 +131,9 @@ function test() {
ww.unregisterNotification(this);
else if (aTopic == "domwindowopened") {
let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
win.addEventListener("focus", function() {
win.removeEventListener("focus", arguments.callee, true);
setTimeout(function() {
EventUtils.synthesizeKey("VK_RETURN", {}, win)
}, 0);
}, true);
SimpleTest.waitForFocus(function() {
EventUtils.synthesizeKey("VK_RETURN", {}, win)
}, win);
}
}
};
@ -239,9 +224,16 @@ function test() {
function lastStep() {
// cleanup
ww.registerNotification({
observe: function(aSubject, aTopic, aData) {
// unregister ourself
ww.unregisterNotification(this);
pwmgr.removeAllLogins();
finish();
}
});
pwmgrdlg.close();
pwmgr.removeAllLogins();
finish();
}
step1();