summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/picture-in-picture/picture-in-picture-element.html
blob: 2763eca476d716aeb88bf923f32279a3bc55998a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<title>Test Picture-in-Picture element</title>
<script src="/common/media.js"></script>
<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(async t => {
  assert_equals(document.pictureInPictureElement, null);
  const video = await loadVideo();

  return requestPictureInPictureWithTrustedClick(video)
  .then(() => {
    assert_equals(document.pictureInPictureElement, video);
    return document.exitPictureInPicture();
  })
  .then(() => {
    assert_equals(document.pictureInPictureElement, null);
  });
});
</script>