https://github.com/web-platform-tests/wpt
Raw File
Tip revision: be666a5d73d5ca27723bedbe8be202d1daa4451b authored by Boris Zbarsky on 03 April 2018, 17:09:28 UTC
Use stable error messages in the link onload event tests by default.
Tip revision: be666a5
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