Bug 1526617 [wpt PR 15247] - Do not require user gesture if pictureInPictureElement is set, a=testonly
authorFrançois Beaufort <beaufort.francois@gmail.com>
Mon, 18 Feb 2019 19:26:10 +0000
changeset 519196 eed8064109e8e669fb76b940f8bc7fcc2a225b23
parent 519195 f0afe7269a909f1dce59879a6f273ab7797123dd
child 519197 9b289784c5d145e99e046607fe11ad61903bd4d6
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1526617, 15247, 928697, 1454360, 630026
milestone67.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 1526617 [wpt PR 15247] - Do not require user gesture if pictureInPictureElement is set, a=testonly Automatic update from web-platform-tests Do not require user gesture if pictureInPictureElement is set Following https://github.com/WICG/picture-in-picture/issues/116, it would be great to allow video to enter Picture-in-Picture without user activation if there's already a visible PiP window in the context of the document, in other words if `document.pictureInPictureElement` is set. Bug: 928697 Change-Id: I2c191368d8dd1bd6ddade719399d0679ef410575 Reviewed-on: https://chromium-review.googlesource.com/c/1454360 Commit-Queue: Fran├žois Beaufort <beaufort.francois@gmail.com> Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Cr-Commit-Position: refs/heads/master@{#630026} -- wpt-commits: 5692bc8fe5e5ae3703dda9f0689e1d8ec3431411 wpt-pr: 15247
testing/web-platform/tests/picture-in-picture/request-picture-in-picture-twice.html
--- a/testing/web-platform/tests/picture-in-picture/request-picture-in-picture-twice.html
+++ b/testing/web-platform/tests/picture-in-picture/request-picture-in-picture-twice.html
@@ -11,9 +11,18 @@
 promise_test(async t => {
   const video1 = await loadVideo();
   const video2 = await loadVideo();
   await test_driver.bless('request Picture-in-Picture');
   const promise = video1.requestPictureInPicture();
   await promise_rejects(t, 'NotAllowedError', video2.requestPictureInPicture());
   return promise;
 }, 'request Picture-in-Picture consumes user gesture');
+
+promise_test(async t => {
+  const video1 = await loadVideo();
+  const video2 = await loadVideo();
+  await test_driver.bless('request Picture-in-Picture');
+  await video1.requestPictureInPicture();
+  assert_equals(document.pictureInPictureElement, video1);
+  return video2.requestPictureInPicture();
+}, 'request Picture-in-Picture does not require user gesture if document.pictureInPictureElement is set');
 </script>