Bug 1441488 [wpt PR 9318] - [Picture-in-Picture] Add leavepictureinpicture video event, a=testonly
authorFrançois Beaufort <beaufort.francois@gmail.com>
Tue, 27 Feb 2018 17:55:39 +0000
changeset 461097 98bbe1ad5f692aec8def8c4ac9a15869025328d3
parent 461096 51facb4707db380de1922e309681b81336443944
child 461098 8e8b89ce24d8d2fae56700ec843c89e754957359
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1441488, 806249, 895309, 534388
milestone60.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 1441488 [wpt PR 9318] - [Picture-in-Picture] Add leavepictureinpicture video event, a=testonly Automatic update from web-platform-tests Bug: 806249 Change-Id: I443cedc0b6d0d72f98a61dd8bf5bb8c79da0d490 Reviewed-on: https://chromium-review.googlesource.com/895309 Reviewed-by: Mounir Lamouri (slow) <mlamouri@chromium.org> Reviewed-by: Mike West <mkwst@chromium.org> Reviewed-by: apacible <apacible@chromium.org> Commit-Queue: Mounir Lamouri (slow) <mlamouri@chromium.org> Cr-Commit-Position: refs/heads/master@{#534388} <!-- Reviewable:start --> <!-- Reviewable:end --> wpt-commits: af2dee726dc800a0968b59b5d620191aed4ce997 wpt-pr: 9318 reapplied-commits: 370e267e160568862f1fd9ec246ab5bb840f586e, fe4514c84e7ad28e46bad5da93381deb99b177f3, 7806af854343c043a2645a4034fdc7812f65daad, 9ddfd21554293dec5a4bf2e5375ae4f3c9f2ded0, 75f63c4d1ebc949647184fd60972fc7b9fd4affb, 1f3a5b496acd2288cc8cf0c32af86cb35157ea4e, 88b42bd5847abac58a62c4d6b33c1509bfce5f3d, 15c2e4c690700c6c115f8afe5e44ded10d943538, c8d461ef1437641ae7d4ea1d21e1e60cd62910b0, a6088a5f48ee299386a84d2f771902267d7355b1, 0634cd8f08ebe0905a9188fb1398c7b5f889c5dc, c8ee4a012dae506ae06bb5b2ad50942b04c1aaaa, c2c352456a4cf62dcc12f851138b04397675a445, b93a8879555d2fa7e7d4e00a275513a3a6338b35, b86e1331cb36634fd33677043b61fc0c1d8485bc, 44ddf14fd3346658c3223f13652073fafbfa48fa, a1a5840a6bb53e305ba02bcbeb215659342d0edb, 7465cb110ae5ec2e2ca73182caf5293f0efc8fd5, aad5349b3458bc3414e274b33fa86a1123901ff2, eca0907980d2769c449894a6277c60c1a306792f, 38626987c0cfd6e715cfcc6f4f1a1209191a03c5, e4a67f7ddcde6cd99348e9104bd7ed07074da44a, bb3c9990840a0fae2afc840b5952d7874785b112, 042d7adef0bdb9dc80e825c3997ace7519477c42, 99f1ea44fc7915b8b7b33bce4732fa8765fd3ac2
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/picture-in-picture/enter-picture-in-picture.html
testing/web-platform/tests/picture-in-picture/leave-picture-in-picture.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -345389,16 +345389,24 @@
    "picture-in-picture/exit-picture-in-picture.html": [
     [
      "/picture-in-picture/exit-picture-in-picture.html",
      {
       "testdriver": true
      }
     ]
    ],
+   "picture-in-picture/leave-picture-in-picture.html": [
+    [
+     "/picture-in-picture/leave-picture-in-picture.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
    "picture-in-picture/not-processing-user-gesture.html": [
     [
      "/picture-in-picture/not-processing-user-gesture.html",
      {}
     ]
    ],
    "picture-in-picture/picture-in-picture-element.html": [
     [
@@ -573237,23 +573245,27 @@
    "dc978fd8669d67118109fcab245010fdd7d799b0",
    "testharness"
   ],
   "picture-in-picture/disable-picture-in-picture.html": [
    "887338e9330b4d94d007685c2a511cf285bb0c3e",
    "testharness"
   ],
   "picture-in-picture/enter-picture-in-picture.html": [
-   "c0d29867a380b7e780ed14c229fa5598626a75aa",
+   "1286b5349d7787be49ad00f910e2bd7ec80ed87e",
    "testharness"
   ],
   "picture-in-picture/exit-picture-in-picture.html": [
    "b1103b96927872de07fc6eb5f34668a0267da6a2",
    "testharness"
   ],
+  "picture-in-picture/leave-picture-in-picture.html": [
+   "178275fc27367da45895150124e1d2a0051f73d5",
+   "testharness"
+  ],
   "picture-in-picture/not-processing-user-gesture.html": [
    "0bfb194f9fd96db340177d8ff9e62becb1dd9f5e",
    "testharness"
   ],
   "picture-in-picture/picture-in-picture-element.html": [
    "72f2d3b885be8f7268df828f7758b1bc05334d5e",
    "testharness"
   ],
--- a/testing/web-platform/tests/picture-in-picture/enter-picture-in-picture.html
+++ b/testing/web-platform/tests/picture-in-picture/enter-picture-in-picture.html
@@ -2,17 +2,17 @@
 <title>Test enterpictureinpicture event</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <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>
-async_test(t => {
+promise_test(t => {
   const video = document.createElement('video');
 
   video.addEventListener('enterpictureinpicture', t.step_func_done(event => {
     assert_equals(event.target, video);
     assert_equals(event.bubbles, true);
     assert_equals(event.cancelable, false);
     assert_equals(event.composed, false);
     assert_equals(document.pictureInPictureElement, video);
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/picture-in-picture/leave-picture-in-picture.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Test leavepictureinpicture event</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<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(t => {
+  const video = document.createElement('video');
+
+  video.addEventListener('leavepictureinpicture', t.step_func_done(event => {
+    assert_equals(event.target, video);
+    assert_equals(event.bubbles, true);
+    assert_equals(event.cancelable, false);
+    assert_equals(event.composed, false);
+    assert_equals(document.pictureInPictureElement, null);
+  }));
+
+  return requestPictureInPictureWithTrustedClick(video)
+  .then(() => document.exitPictureInPicture())
+}, 'leavepictureinpicture event is fired if document.exitPictureInPicture');
+
+promise_test(t => {
+  const video = document.createElement('video');
+
+  video.addEventListener('leavepictureinpicture', t.step_func_done(event => {
+    assert_equals(event.target, video);
+    assert_equals(event.bubbles, true);
+    assert_equals(event.cancelable, false);
+    assert_equals(event.composed, false);
+    assert_equals(document.pictureInPictureElement, null);
+  }));
+
+  return requestPictureInPictureWithTrustedClick(video)
+  .then(() => {
+    video.disablePictureInPicture = true;
+  });
+}, 'leavepictureinpicture event is fired if video.disablePictureInPicture is set to true');
+</script>