<!DOCTYPE html>
<title>Test disable Picture-in-Picture</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>
test(t => {
  const video = document.createElement('video');
  assert_false(video.disablePictureInPicture); // default value

  video.setAttribute('disablepictureinpicture', 'foo');
  assert_true(video.disablePictureInPicture);

  video.removeAttribute('disablepictureinpicture');
  assert_false(video.disablePictureInPicture);

  video.disablePictureInPicture = true;
  assert_equals(video.getAttribute('disablepictureinpicture'), '');

  video.disablePictureInPicture = false;
  assert_equals(video.getAttribute('disablepictureinpicture'), null);
}, 'Test disablePictureInPicture IDL attribute');

promise_test(async t => {
  const video = await loadVideo();
  video.disablePictureInPicture = true;
  return promise_rejects(t, 'InvalidStateError',
      requestPictureInPictureWithTrustedClick(video));
}, 'Request Picture-in-Picture rejects if disablePictureInPicture is true');

promise_test(async t => {
  const video = await loadVideo();
  await test_driver.bless('request Picture-in-Picture');
  const promise = video.requestPictureInPicture();
  video.disablePictureInPicture = true;
  await promise_rejects(t, 'InvalidStateError', promise);
  assert_equals(document.pictureInPictureElement, null);
}, 'Request Picture-in-Picture rejects if disablePictureInPicture becomes ' +
   'true before promise resolves.');

promise_test(async t => {
  const video = await loadVideo();
  return requestPictureInPictureWithTrustedClick(video)
  .then(() => {
    video.disablePictureInPicture = true;
    video.addEventListener('leavepictureinpicture', t.step_func(() => {
      assert_equals(document.pictureInPictureElement, null);
    }));
  });
}, 'pictureInPictureElement is unset if disablePictureInPicture becomes true');

promise_test(async t => {
  const video = await loadVideo();
  return requestPictureInPictureWithTrustedClick(video)
  .then(() => {
    video.disablePictureInPicture = false;
    assert_equals(document.pictureInPictureElement, video);
  });
}, 'pictureInPictureElement is unchanged if disablePictureInPicture becomes false');

promise_test(async t => {
  const video = await loadVideo();
  return requestPictureInPictureWithTrustedClick(video)
  .then(() => {
    document.createElement('video').disablePictureInPicture = true;
    assert_equals(document.pictureInPictureElement, video);
  });
}, 'pictureInPictureElement is unchanged if disablePictureInPicture becomes ' +
   'true for another video');
</script>
