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 520699 b14b3a5abed62d00167740de32f982522f976f04
parent 520698 b2c96c58335b3a1bdab52c01835a0eaa6a8c1a15
child 520700 a2d6508940de2b5cea50e409f6d00ee57711938c
push id111261
push usermozilla@noorenberghe.ca
push dateFri, 27 Mar 2020 05:39:54 +0000
treeherderautoland@b14b3a5abed6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1588627
milestone76.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 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);