Bug 1203375 - Focus the password manager dialog after the Show Passwords prompt closes
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 13 Sep 2015 14:26:17 -0400
changeset 294852 e617c037515ba7c98b1d549832a3fc8decb52663
parent 294851 eb3784e3b5847ee99d443d474906f57242bb603b
child 294853 503da58c2e6c3fe1d1b2dc62ce1e73f74a118efc
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1203375
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1203375 - Focus the password manager dialog after the Show Passwords prompt closes
toolkit/components/passwordmgr/test/browser/browser_passwordmgr_editing.js
--- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_editing.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_editing.js
@@ -27,18 +27,19 @@ function synthesizeDblClickOnCell(aTree,
   let rect = tbo.getCoordsForCellItem(row, aTree.columns[column], "text");
   let x = rect.x + rect.width / 2;
   let y = rect.y + rect.height / 2;
   // Simulate the double click.
   EventUtils.synthesizeMouse(aTree.body, x, y, { clickCount: 2 },
                              aTree.ownerDocument.defaultView);
 }
 
-function togglePasswords() {
+function* togglePasswords() {
   pwmgrdlg.document.querySelector("#togglePasswords").doCommand();
+  yield new Promise(resolve => waitForFocus(resolve, pwmgrdlg));
 }
 
 function* editUsernamePromises(site, oldUsername, newUsername) {
   is(Services.logins.findLogins({}, site, "", "").length, 1, "Correct login found");
   let login = Services.logins.findLogins({}, site, "", "")[0];
   is(login.username, oldUsername, "Correct username saved");
   is(getUsername(0), oldUsername, "Correct username shown");
   synthesizeDblClickOnCell(signonsTree, 1, 0);
@@ -108,19 +109,19 @@ add_task(function* test_setup() {
     }, pwmgrdlg);
   });
 });
 
 add_task(function* test_edit_multiple_logins() {
   function* testLoginChange(site, oldUsername, oldPassword, newUsername, newPassword) {
     addLogin(site, oldUsername, oldPassword);
     yield* editUsernamePromises(site, oldUsername, newUsername);
-    togglePasswords();
+    yield* togglePasswords();
     yield* editPasswordPromises(site, oldPassword, newPassword);
-    togglePasswords();
+    yield* togglePasswords();
   }
 
   yield* testLoginChange("http://c.tn/", "userC", "passC", "usernameC", "passwordC");
   yield* testLoginChange("http://b.tn/", "userB", "passB", "usernameB", "passwordB");
   yield* testLoginChange("http://a.tn/", "userA", "passA", "usernameA", "passwordA");
 
   pwmgrdlg.close();
 });