Bug 1512946 [wpt PR 14435] - Fix timeout issue by calling play(), a=testonly
authorFrançois Beaufort <beaufort.francois@gmail.com>
Wed, 19 Dec 2018 11:05:19 +0000
changeset 514999 82efdb2446a2f4d154c641a9d0aa99ff6a7d2d47
parent 514998 fc3aed055616d295c60a0dec9c2d69ed6da4f8f0
child 515000 39b4f64875f6f5e721202a13fdfc000bdd2b02e7
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1512946, 14435
milestone66.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 1512946 [wpt PR 14435] - Fix timeout issue by calling play(), a=testonly Automatic update from web-platform-tests Fix timeout issue by calling play() -- Merge pull request #14435 from web-platform-tests/beaufortfrancois-patch-1 Fix timeout issue by calling play() -- wpt-commits: 902b4ca1959eb94ff1f4a2483e508a6105469a9e, c3f2a6c407524eeb0377fe66b4060d43470a49ad wpt-pr: 14435
testing/web-platform/tests/picture-in-picture/mediastream.html
--- a/testing/web-platform/tests/picture-in-picture/mediastream.html
+++ b/testing/web-platform/tests/picture-in-picture/mediastream.html
@@ -5,28 +5,20 @@
 <script src="/resources/testdriver.js"></script>
 <script src="/resources/testdriver-vendor.js"></script>
 <script src="resources/picture-in-picture-helpers.js"></script>
 <body></body>
 <script>
 promise_test(async t => {
   const canvas = document.createElement('canvas');
   const video = document.createElement('video');
-  const mediastreamVideoLoadedPromise = new Promise((resolve, reject) => {
-    canvas.getContext('2d').fillRect(0, 0, canvas.width, canvas.height);
-    video.autoplay = true;
-    video.srcObject = canvas.captureStream(60 /* fps */);
-    video.onloadedmetadata = () => {
-      resolve(video);
-    };
-    video.onerror = error => {
-      reject(error);
-    };
-  });
-  await mediastreamVideoLoadedPromise;
+  canvas.getContext('2d').fillRect(0, 0, canvas.width, canvas.height);
+  video.muted = true;
+  video.srcObject = canvas.captureStream(60 /* fps */);
+  await video.play();
 
   return requestPictureInPictureWithTrustedClick(video)
   .then(pipWindow => {
     assert_not_equals(pipWindow.width, 0);
     assert_not_equals(pipWindow.height, 0);
   });
 }, 'request Picture-in-Picture resolves on user click with Picture-in-Picture window');
 </script>