Bug 1178855 - Hide password visibility toggle when capture doorhanger is closed. r=MattN

MozReview-Commit-ID: 75Pz7jG0RLW

--HG--
extra : transplant_source : %98%EA%1E%06%5D%1D%DA%20%0A%3E%9A%23%B1%0A%CF%CC%24%2B%09%D1
This commit is contained in:
Saad Quadri 2016-06-08 14:18:59 -07:00
Родитель d2efb83420
Коммит abd9f6f8ad
2 изменённых файлов: 28 добавлений и 0 удалений

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

@ -974,11 +974,16 @@ LoginManagerPrompter.prototype = {
toggleBtn.setAttribute("accesskey", togglePasswordAccessKey);
toggleBtn.setAttribute("hidden", LoginHelper.isMasterPasswordSet());
}
if (this.wasDismissed) {
chromeDoc.getElementById("password-notification-visibilityToggle")
.setAttribute("hidden", true);
}
break;
case "shown":
writeDataToUI();
break;
case "dismissed":
this.wasDismissed = true;
readDataFromUI();
// Fall through.
case "removed":

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

@ -553,5 +553,28 @@ add_task(function* test_recipeCaptureFields_ExistingLogin() {
Services.logins.removeAllLogins();
});
add_task(function* test_noShowPasswordOnDismissal() {
info("Check for no Show Password field when the doorhanger is dismissed");
yield testSubmittingLoginForm("subtst_notifications_1.html", function*(fieldValues) {
info("Opening popup");
let notif = getCaptureDoorhanger("password-save");
let { panel } = PopupNotifications;
info("Hiding popup.");
let promiseHidden = BrowserTestUtils.waitForEvent(panel, "popuphidden");
panel.hidePopup();
yield promiseHidden;
info("Clicking on anchor to reshow popup.")
let promiseShown = BrowserTestUtils.waitForEvent(panel, "popupshown");
notif.anchorElement.click();
yield promiseShown;
let passwordVisiblityToggle = panel.querySelector("#password-notification-visibilityToggle");
is(passwordVisiblityToggle.hidden, true, "Check that the Show Password field is Hidden");
});
});
// TODO:
// * existing login test, form has different password --> change password, no save prompt