mirror of
https://github.com/servo/servo.git
synced 2025-06-23 16:44:33 +01:00
26 lines
956 B
HTML
26 lines
956 B
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>
|