mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 491898 - Random Test Failure (browser_passwordmgrdlg.js); r=dolske
This commit is contained in:
parent
71ffeedec0
commit
e6e16dae76
@ -167,14 +167,19 @@ function DeleteAllSignons() {
|
||||
}
|
||||
|
||||
function TogglePasswordVisible() {
|
||||
if (!showingPasswords && !ConfirmShowPasswords())
|
||||
return;
|
||||
if (showingPasswords || ConfirmShowPasswords()) {
|
||||
showingPasswords = !showingPasswords;
|
||||
document.getElementById("togglePasswords").label = kSignonBundle.getString(showingPasswords ? "hidePasswords" : "showPasswords");
|
||||
document.getElementById("togglePasswords").accessKey = kSignonBundle.getString(showingPasswords ? "hidePasswordsAccessKey" : "showPasswordsAccessKey");
|
||||
document.getElementById("passwordCol").hidden = !showingPasswords;
|
||||
_filterPasswords();
|
||||
}
|
||||
|
||||
showingPasswords = !showingPasswords;
|
||||
document.getElementById("togglePasswords").label = kSignonBundle.getString(showingPasswords ? "hidePasswords" : "showPasswords");
|
||||
document.getElementById("togglePasswords").accessKey = kSignonBundle.getString(showingPasswords ? "hidePasswordsAccessKey" : "showPasswordsAccessKey");
|
||||
document.getElementById("passwordCol").hidden = !showingPasswords;
|
||||
_filterPasswords();
|
||||
// Notify observers that the password visibility toggling is
|
||||
// completed. (Mostly useful for tests)
|
||||
Components.classes["@mozilla.org/observer-service;1"]
|
||||
.getService(Components.interfaces.nsIObserverService)
|
||||
.notifyObservers(null, "passwordmgr-password-toggle-complete", null);
|
||||
}
|
||||
|
||||
function AskUserShowPasswords() {
|
||||
|
@ -139,10 +139,9 @@ function test() {
|
||||
if (showMode) {
|
||||
let obs = {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic == "domwindowclosed") {
|
||||
if (aTopic == "domwindowclosed")
|
||||
ww.unregisterNotification(this);
|
||||
setTimeout(func, 0);
|
||||
} else if (aTopic == "domwindowopened") {
|
||||
else if (aTopic == "domwindowopened") {
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
|
||||
win.addEventListener("load", function() {
|
||||
win.removeEventListener("load", arguments.callee, true);
|
||||
@ -156,9 +155,18 @@ function test() {
|
||||
ww.registerNotification(obs);
|
||||
}
|
||||
|
||||
let obsSvc = Cc["@mozilla.org/observer-service;1"].
|
||||
getService(Ci.nsIObserverService);
|
||||
obsSvc.addObserver({
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic == "passwordmgr-password-toggle-complete") {
|
||||
obsSvc.removeObserver(this, "passwordmgr-password-toggle-complete", false);
|
||||
func();
|
||||
}
|
||||
}
|
||||
}, "passwordmgr-password-toggle-complete", false);
|
||||
|
||||
EventUtils.synthesizeMouse(toggleButton, 1, 1, {}, win);
|
||||
if (!showMode)
|
||||
func();
|
||||
}
|
||||
|
||||
function runTests(mode, endFunction) {
|
||||
|
Loading…
Reference in New Issue
Block a user