Bug 1574315: Specify the proper parameters to BrowserTestUtils.browserLoaded to ensure that a page's content is entirely loaded before testing for the results of side effects of operations in that content.
☠☠ backed out by 3224524e42b0 ☠ ☠
authorWill Hawkins <whawkins@mozilla.com>
Sat, 07 Sep 2019 03:59:54 +0300
changeset 553449 dd6fd67a75eb485af31e64acb919417c80132d53
parent 553332 4aed8e10318f38571712350856bf9e61c5f84e1f
child 553450 3224524e42b0666811f66a2e2f30266c5766d9b4
push id12169
push userffxbld-merge
push dateMon, 14 Oct 2019 16:59:29 +0000
treeherdermozilla-beta@c819687300ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1574315
milestone71.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 1574315: Specify the proper parameters to BrowserTestUtils.browserLoaded to ensure that a page's content is entirely loaded before testing for the results of side effects of operations in that content. Differential Revision: https://phabricator.services.mozilla.com//D44429
toolkit/content/tests/browser/browser_block_autoplay_media.js
--- a/toolkit/content/tests/browser/browser_block_autoplay_media.js
+++ b/toolkit/content/tests/browser/browser_block_autoplay_media.js
@@ -44,28 +44,28 @@ add_task(async function setup_test_prefe
     ],
   });
 });
 
 add_task(async function block_autoplay_media() {
   info("- open new background tab1 -");
   let tab1 = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
   BrowserTestUtils.loadURI(tab1.linkedBrowser, PAGE);
-  await BrowserTestUtils.browserLoaded(tab1.linkedBrowser);
+  await BrowserTestUtils.browserLoaded(tab1.linkedBrowser, false, PAGE);
 
   info("- should block autoplay media for non-visited tab1 -");
   await check_audio_suspended(
     tab1.linkedBrowser,
     SuspendedType.SUSPENDED_BLOCK
   );
 
   info("- open new background tab2 -");
   let tab2 = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
   BrowserTestUtils.loadURI(tab2.linkedBrowser, PAGE);
-  await BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
+  await BrowserTestUtils.browserLoaded(tab2.linkedBrowser, false, PAGE);
 
   info("- should block autoplay for non-visited tab2 -");
   await check_audio_suspended(
     tab2.linkedBrowser,
     SuspendedType.SUSPENDED_BLOCK
   );
 
   info("- select tab1 as foreground tab -");
@@ -106,33 +106,35 @@ add_task(async function block_autoplay_m
       ["media.autoplay.default", SpecialPowers.Ci.nsIAutoplay.BLOCKED],
       ["media.autoplay.enabled.user-gestures-needed", true],
     ],
   });
 
   info("- open new background tab4 -");
   let tab4 = BrowserTestUtils.addTab(window.gBrowser, "about:blank");
   BrowserTestUtils.loadURI(tab4.linkedBrowser, PAGE);
-  await BrowserTestUtils.browserLoaded(tab4.linkedBrowser);
+  await BrowserTestUtils.browserLoaded(tab4.linkedBrowser, false, PAGE);
+
   info("- should block autoplay for non-visited tab4 -");
   await check_audio_suspended(
     tab4.linkedBrowser,
     SuspendedType.SUSPENDED_BLOCK
   );
   await check_audio_paused(tab4.linkedBrowser, true);
   tab4.linkedBrowser.resumeMedia();
   info("- should not block media from tab4 -");
   await waitForTabPlayingEvent(tab4, true);
   await check_audio_paused(tab4.linkedBrowser, false);
 
   info(
     "- check that loading a new URI in page clears gesture activation status -"
   );
   BrowserTestUtils.loadURI(tab4.linkedBrowser, PAGE);
-  await BrowserTestUtils.browserLoaded(tab4.linkedBrowser);
+  await BrowserTestUtils.browserLoaded(tab4.linkedBrowser, false, PAGE);
+
   info("- should block autoplay again as gesture activation status cleared -");
   await check_audio_paused(tab4.linkedBrowser, true);
 
   info("- remove tabs -");
   BrowserTestUtils.removeTab(tab1);
   BrowserTestUtils.removeTab(tab2);
   BrowserTestUtils.removeTab(tab3);
   BrowserTestUtils.removeTab(tab4);