Bug 1588627 - Fix test_autocomplete_https_*grade.html on Windows with Fission. rs=MattN
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Fri, 27 Mar 2020 05:38:16 +0000
changeset 2725562 b14b3a5abed62d00167740de32f982522f976f04
parent 2725561 b2c96c58335b3a1bdab52c01835a0eaa6a8c1a15
child 2725563 a2d6508940de2b5cea50e409f6d00ee57711938c
child 2730708 616edc708110d5521757e47cdcd886353abbaecf
push id510263
push usermalexandru@mozilla.com
push dateFri, 27 Mar 2020 09:57:42 +0000
treeherdertry@750dbc575147 [default view] [failures only]
reviewersMattN
bugs1588627
milestone76.0a1
Bug 1588627 - Fix test_autocomplete_https_*grade.html on Windows with Fission. rs=MattN Handle the form processed observer notification before the load event. Differential Revision: https://phabricator.services.mozilla.com/D68507
toolkit/components/passwordmgr/test/mochitest/test_autocomplete_https_downgrade.html
toolkit/components/passwordmgr/test/mochitest/test_autocomplete_https_upgrade.html
--- a/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_https_downgrade.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_https_downgrade.html
@@ -70,23 +70,24 @@ function restoreForm() {
 }
 
 const HTTP_FORM_URL = "http://example.com/tests/toolkit/components/passwordmgr/test/mochitest/form_basic.html";
 
 async function setup(formUrl) {
   await SpecialPowers.pushPrefEnv({"set": [["signon.schemeUpgrades", true]]});
 
   iframe.src = formUrl;
+  let processedPromise = promiseFormsProcessed();
   await new Promise(resolve => {
     iframe.addEventListener("load", function() {
       resolve();
     }, {once: true});
   });
 
-  await promiseFormsProcessed();
+  await processedPromise;
 
   hostname = await SpecialPowers.spawn(getIframeBrowsingContext(window), [], function() {
     return this.content.document.documentURIObject.host;
   });
 }
 
 add_task(async function test_autocomplete_https_downgrade() {
   info("test_autocomplete_http, setup with " + HTTP_FORM_URL);
--- a/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_https_upgrade.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_https_upgrade.html
@@ -68,23 +68,24 @@ function restoreForm() {
 }
 
 const HTTPS_FORM_URL = "https://example.com/tests/toolkit/components/passwordmgr/test/mochitest/form_basic.html";
 
 async function setup(formUrl = HTTPS_FORM_URL) {
   await SpecialPowers.pushPrefEnv({"set": [["signon.schemeUpgrades", true]]});
 
   iframe.src = formUrl;
+  let processedPromise = promiseFormsProcessed();
   await new Promise(resolve => {
     iframe.addEventListener("load", function() {
       resolve();
     }, {once: true});
   });
 
-  await promiseFormsProcessed();
+  await processedPromise;
 
   hostname = await SpecialPowers.spawn(getIframeBrowsingContext(window), [], function() {
     return this.content.document.documentURIObject.host;
   });
 }
 
 add_task(async function setup_https_frame() {
   await setup(HTTPS_FORM_URL);