Bug 721495 - Passwordmgr tests: Use EventUtils sendChar() and sendKey(), instead of calling synthesizeKey() directly, r=zpao
authorKarun Dambiec <karun.84@gmx.de>
Thu, 26 Jan 2012 14:13:00 -0800
changeset 86918 ab27cd7968454471d5d3947d9e5a7c0d8ab38a97
parent 86917 3bdf5e09ead78a9b28a64066275bffb5fa26bf81
child 86919 847a2d676b67d0a413101a5164e8a30afad45685
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerszpao
bugs721495
milestone12.0a1
Bug 721495 - Passwordmgr tests: Use EventUtils sendChar() and sendKey(), instead of calling synthesizeKey() directly, r=zpao
toolkit/components/passwordmgr/test/browser/browser_passwordmgr_sort.js
toolkit/components/passwordmgr/test/browser/browser_passwordmgrdlg.js
--- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_sort.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_sort.js
@@ -109,17 +109,17 @@ function test() {
             // only watch for a confirmation dialog every other time being called
             if (showMode) {
                 Services.ww.registerNotification(function (aSubject, aTopic, aData) {
                     if (aTopic == "domwindowclosed")
                         Services.ww.unregisterNotification(arguments.callee);
                     else if (aTopic == "domwindowopened") {
                         let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
                         SimpleTest.waitForFocus(function() {
-                            EventUtils.synthesizeKey("VK_RETURN", {}, win)
+                            EventUtils.sendKey("RETURN", win);
                         }, win);
                     }
                 });
             }
 
             Services.obs.addObserver(function (aSubject, aTopic, aData) {
                 if (aTopic == "passwordmgr-password-toggle-complete") {
                     Services.obs.removeObserver(arguments.callee, aTopic, false);
--- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgrdlg.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_passwordmgrdlg.js
@@ -119,17 +119,17 @@ function test() {
             // only watch for a confirmation dialog every other time being called
             if (showMode) {
                 Services.ww.registerNotification(function (aSubject, aTopic, aData) {
                     if (aTopic == "domwindowclosed")
                         Services.ww.unregisterNotification(arguments.callee);
                     else if (aTopic == "domwindowopened") {
                         let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
                         SimpleTest.waitForFocus(function() {
-                            EventUtils.synthesizeKey("VK_RETURN", {}, win)
+                            EventUtils.sendKey("RETURN", win);
                         }, win);
                     }
                 });
             }
 
             Services.obs.addObserver(function (aSubject, aTopic, aData) {
                 if (aTopic == "passwordmgr-password-toggle-complete") {
                     Services.obs.removeObserver(arguments.callee, aTopic, false);