Bug 1602318 - Make download tests wait for the STOP progress event instead of load. r=kmag
authorMatt Woodrow <mwoodrow@mozilla.com>
Sun, 26 Apr 2020 00:50:14 +0000
changeset 526101 7e2902385a6e05baf46e7f8739299203ff5fb7f5
parent 526100 d4dd2b03884ddaa1c1ac57c37a74d5c1e21d7369
child 526102 bd6752b9c333739633d64167630fa338734cfb26
push id37350
push usernbeleuzu@mozilla.com
push dateSun, 26 Apr 2020 09:43:12 +0000
treeherdermozilla-central@21659f178a12 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1602318
milestone77.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 1602318 - Make download tests wait for the STOP progress event instead of load. r=kmag When we initiate URL bar loads from the parent, loads that are handled externally won't fire a load event from the content process docshell, so we should use the progress listener instead. Differential Revision: https://phabricator.services.mozilla.com/D67100
toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_delayedbutton.js
toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_dialog_layout.js
--- a/toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_delayedbutton.js
+++ b/toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_delayedbutton.js
@@ -50,16 +50,18 @@ function waitDelay(delay) {
 
 add_task(async function test_unknownContentType_delayedbutton() {
   Services.ww.registerNotification(UCTObserver);
 
   await BrowserTestUtils.withNewTab(
     {
       gBrowser,
       url: LOAD_URI,
+      waitForLoad: false,
+      waitForStateStop: true,
     },
     async function() {
       let uctWindow = await UCTObserver.opened.promise;
       let dialog = uctWindow.document.getElementById("unknownContentType");
       let ok = dialog.getButton("accept");
 
       SimpleTest.is(ok.disabled, true, "button started disabled");
 
--- a/toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_dialog_layout.js
+++ b/toolkit/mozapps/downloads/tests/browser/browser_unknownContentType_dialog_layout.js
@@ -63,16 +63,18 @@ add_task(async function test_unknownCont
       },
     };
 
     Services.ww.registerNotification(UCTObserver);
     await BrowserTestUtils.withNewTab(
       {
         gBrowser,
         url: test.url,
+        waitForLoad: false,
+        waitForStateStop: true,
       },
       async function() {
         let uctWindow = await UCTObserver.opened.promise;
 
         for (let [id, props] of Object.entries(test.elements)) {
           let elem = uctWindow.dialog.dialogElement(id);
           for (let [prop, value] of Object.entries(props)) {
             SimpleTest.is(