https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 98cc5c8bb77ef18be9c4464c8e66873654ade128 authored by Chris Lilley on 11 April 2018, 09:30:00 UTC
quick test to see if descriptor supported anywhere
Tip revision: 98cc5c8
document-exit-fullscreen-active-document.html
<!DOCTYPE html>
<title>Document#exitFullscreen() when the document is not the active document</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<iframe allowfullscreen></iframe>
<script>
var t = async_test();

onload = t.step_func(() => {
  var iframe = document.querySelector("iframe");
  var documentBeforeNav = iframe.contentDocument;

  iframe.onload = t.step_func(() => {
    var p = documentBeforeNav.exitFullscreen();
    assert_true(p instanceof Promise, 'exitFullscreen() returns promise');
    // The promise should already be rejected, so its reject callback should be
    // invoked before a second promise's callback.
    p.catch(t.step_func_done());
    Promise.resolve().then(t.unreached_func('new promise resolved before exitFullscreen() promise rejected'));
  });

  // Navigate the iframe
  window[0].location.href = '/common/blank.html';
});
</script>
back to top