Backed out changeset 2547daf183e5 (bug 1533166) by request of jaws
authorarthur.iakab <aiakab@mozilla.com>
Mon, 06 May 2019 23:51:36 +0300
changeset 531592 088d7221c75aa84d4a3ad559e50e1dc99bfd9fa1
parent 531591 6c5289f88fb428520af6e8e97b4210418c907e73
child 531593 ef8c4674d0b0f402b5ca674300e239b196b0becd
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1533166
milestone68.0a1
backs out2547daf183e553ec60d8cb5ccbfb47358a17fb4d
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
Backed out changeset 2547daf183e5 (bug 1533166) by request of jaws
toolkit/components/passwordmgr/test/mochitest/pwmgr_common.js
toolkit/components/passwordmgr/test/mochitest/test_formless_submit.html
toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation.html
toolkit/components/passwordmgr/test/mochitest/test_munged_username.html
toolkit/components/passwordmgr/test/mochitest/test_one_doorhanger_per_un_pw.html
toolkit/components/passwordmgr/test/mochitest/test_onsubmit_value_change.html
toolkit/components/passwordmgr/test/mochitest/test_password_length.html
--- a/toolkit/components/passwordmgr/test/mochitest/pwmgr_common.js
+++ b/toolkit/components/passwordmgr/test/mochitest/pwmgr_common.js
@@ -137,36 +137,16 @@ function checkUnmodifiedForm(formNum) {
       continue;
     }
 
     is(ele.value, ele.defaultValue, "Test to default value of field " +
        ele.name + " in form " + formNum);
   }
 }
 
-/**
- * @param {Function} [aFilterFn = undefined] Function to filter out irrelevant submissions.
- * @return {Promise} resolving when a relevant form submission was processed.
- */
-function getSubmitMessage(aFilterFn = undefined) {
-  info("getSubmitMessage");
-  return new Promise((resolve, reject) => {
-    PWMGR_COMMON_PARENT.addMessageListener("formSubmissionProcessed", function processed(...args) {
-      if (aFilterFn && !aFilterFn(...args)) {
-        // This submission isn't the one we're waiting for.
-        return;
-      }
-
-      info("got formSubmissionProcessed");
-      PWMGR_COMMON_PARENT.removeMessageListener("formSubmissionProcessed", processed);
-      resolve(...args);
-    });
-  });
-}
-
 function registerRunTests() {
   return new Promise(resolve => {
     function onDOMContentLoaded() {
       var form = document.createElement("form");
       form.id = "observerforcer";
       var username = document.createElement("input");
       username.name = "testuser";
       form.appendChild(username);
--- a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit.html
@@ -124,16 +124,27 @@ const TESTCASES = [
     hostname: DEFAULT_ORIGIN,
     formSubmitURL: DEFAULT_ORIGIN,
     usernameFieldValue: "username from recipe",
     newPasswordFieldValue: "pass2",
     oldPasswordFieldValue: null,
   },
 ];
 
+function getSubmitMessage() {
+  info("getSubmitMessage");
+  return new Promise((resolve, reject) => {
+    PWMGR_COMMON_PARENT.addMessageListener("formSubmissionProcessed", function processed(...args) {
+      info("got formSubmissionProcessed");
+      PWMGR_COMMON_PARENT.removeMessageListener("formSubmissionProcessed", processed);
+      resolve(...args);
+    });
+  });
+}
+
 add_task(async function test() {
   let count = 0;
   let loginFrame = document.getElementById("loginFrame");
 
   for (let tc of TESTCASES) {
     let frameDoc = loginFrame.contentWindow.document;
     info("Starting testcase: " + JSON.stringify(tc));
 
--- a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation.html
@@ -133,16 +133,36 @@ const TESTCASES = [
     hostname: DEFAULT_ORIGIN,
     formSubmitURL: DEFAULT_ORIGIN,
     usernameFieldValue: "username from recipe",
     newPasswordFieldValue: "pass2",
     oldPasswordFieldValue: null,
   },
 ];
 
+/**
+ * @param {Function} [aFilterFn = undefined] Function to filter out irrelevant submissions.
+ * @return {Promise} resolving when a relevant form submission was processed.
+ */
+function getSubmitMessage(aFilterFn = undefined) {
+  info("getSubmitMessage");
+  return new Promise((resolve, reject) => {
+    PWMGR_COMMON_PARENT.addMessageListener("formSubmissionProcessed", function processed(...args) {
+      if (aFilterFn && !aFilterFn(...args)) {
+        // This submission isn't the one we're waiting for.
+        return;
+      }
+
+      info("got formSubmissionProcessed");
+      PWMGR_COMMON_PARENT.removeMessageListener("formSubmissionProcessed", processed);
+      resolve(...args);
+    });
+  });
+}
+
 function filterFormSubmissions(data) {
   return data.newPasswordField.value != "ignore-form-submission";
 }
 
 add_task(async function test() {
   let loginFrame = document.getElementById("loginFrame");
 
   for (let tc of TESTCASES) {
--- a/toolkit/components/passwordmgr/test/mochitest/test_munged_username.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_munged_username.html
@@ -124,16 +124,30 @@ const TESTCASES = [
   },
   {
     testName: "test_okBulletUsername2",
     username: "••user••",
     expected: "••user••",
   },
 ];
 
+/**
+ * @return {Promise} resolving when form submission was processed.
+ */
+function getSubmitMessage() {
+  info("getSubmitMessage");
+  return new Promise((resolve, reject) => {
+    PWMGR_COMMON_PARENT.addMessageListener("formSubmissionProcessed", function processed(...args) {
+      info("got formSubmissionProcessed");
+      PWMGR_COMMON_PARENT.removeMessageListener("formSubmissionProcessed", processed);
+      resolve(...args);
+    });
+  });
+}
+
 add_task(async function test_new_logins() {
   for (let tc of TESTCASES) {
     info("Starting testcase: " + JSON.stringify(tc));
     let frameDoc = await loadFormIntoIframe(DEFAULT_ORIGIN, `<form id="form1" onsubmit="return false;">
       <input  type="text"       name="uname" value="${tc.username}">
       <input  type="password"   name="pword" value="thepassword">
       <button type="submit" id="submitBtn">Submit</button>
     </form>`);
--- a/toolkit/components/passwordmgr/test/mochitest/test_one_doorhanger_per_un_pw.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_one_doorhanger_per_un_pw.html
@@ -7,16 +7,27 @@
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <script type="text/javascript" src="pwmgr_common.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <script>
   let chromeScript = runChecksAfterCommonInit();
 
+  function getSubmitMessage() {
+    info("getSubmitMessage");
+    return new Promise((resolve, reject) => {
+      chromeScript.addMessageListener("formSubmissionProcessed", function processed(...args) {
+        info("got formSubmissionProcessed");
+        chromeScript.removeMessageListener("formSubmissionProcessed", processed);
+        resolve(...args);
+      });
+    });
+  }
+
   SimpleTest.requestFlakyTimeout("Giving a chance for the unexpected popupshown to occur");
 </script>
 <p id="display"></p>
 
 <div id="content" style="display: none">
    <form id="form1" onsubmit="return false;">
     <input  type="text"     name="uname" id="ufield">
     <input  type="password" name="pword" id="pfield">
--- a/toolkit/components/passwordmgr/test/mochitest/test_onsubmit_value_change.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_onsubmit_value_change.html
@@ -7,16 +7,27 @@
   <script type="text/javascript" src="pwmgr_common.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 Login Manager test: input value change right after onsubmit event
 
 <script>
   let chromeScript = runChecksAfterCommonInit();
+
+  function getSubmitMessage() {
+    info("getSubmitMessage");
+    return new Promise((resolve, reject) => {
+      chromeScript.addMessageListener("formSubmissionProcessed", function processed(...args) {
+        info("got formSubmissionProcessed");
+        chromeScript.removeMessageListener("formSubmissionProcessed", processed);
+        resolve(...args);
+      });
+    });
+  }
 </script>
 <p id="display"></p>
 
 <div id="content" style="display: none">
 
   <form id="form1" action="formTest.js" onsubmit="return false;">
     <input  type="text"     name="uname" id="ufield">
     <input  type="password" name="pword" id="pfield">
--- a/toolkit/components/passwordmgr/test/mochitest/test_password_length.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_password_length.html
@@ -72,16 +72,29 @@ const TESTCASES = [
     testName: "test_1characterNewPassword",
     pword1: "pass1",
     pword2: "x",
     expectedNewPassword: { value: "pass1" },
     expectedOldPassword: null,
   },
 ];
 
+/**
+ * @return {Promise} resolving when form submission was processed.
+ */
+function getSubmitMessage() {
+  return new Promise((resolve, reject) => {
+    PWMGR_COMMON_PARENT.addMessageListener("formSubmissionProcessed", function processed(...args) {
+      info("got formSubmissionProcessed");
+      PWMGR_COMMON_PARENT.removeMessageListener("formSubmissionProcessed", processed);
+      resolve(...args);
+    });
+  });
+}
+
 add_task(async function test_password_lengths() {
   for (let tc of TESTCASES) {
     info("Starting testcase: " + tc.testName + ", " + JSON.stringify([tc.pword1, tc.pword2]));
     let frameDoc = await loadFormIntoIframe(DEFAULT_ORIGIN, `<form id="form1" onsubmit="return false;">
       <input  type="text"       name="uname" value="myname">
       <input  type="password"   name="pword1" value="">
       <input  type="password"   name="pword2" value="">
       <button type="submit" id="submitBtn">Submit</button>