OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Element#requestFullscreen() in iframe followed by removing the iframe</ti
tle> | 2 <title>Element#requestFullscreen() in iframe followed by removing the iframe</ti
tle> |
3 <script src="../../resources/testharness.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
5 <script src="../trusted-click.js"></script> | 5 <script src="../trusted-click.js"></script> |
6 <div id="log"></div> | 6 <div id="log"></div> |
7 <iframe allowfullscreen></iframe> | 7 <iframe allowfullscreen></iframe> |
8 <script> | 8 <script> |
9 // Adapted from https://github.com/w3c/web-platform-tests/pull/4250 | 9 // Adapted from https://github.com/w3c/web-platform-tests/pull/4250 |
10 // TODO(foolip): Remove this test when the above is imported and passing. | 10 // TODO(foolip): Remove this test when the above is imported and passing. |
11 async_test(t => { | 11 async_test(t => { |
12 const iframe = document.querySelector("iframe"); | 12 const iframe = document.querySelector("iframe"); |
13 const iframeDocument = iframe.contentDocument; | 13 const iframeDocument = iframe.contentDocument; |
14 | 14 |
15 document.onfullscreenchange = t.step_func_done(() => { | 15 document.onfullscreenchange = t.unreached_func("fullscreenchange event"); |
16 assert_equals(document.fullscreenElement, null); | |
17 assert_equals(iframeDocument.fullscreenElement, null); | |
18 }); | |
19 document.onfullscreenerror = t.unreached_func("fullscreenerror event"); | 16 document.onfullscreenerror = t.unreached_func("fullscreenerror event"); |
20 iframeDocument.onfullscreenchange = t.unreached_func("iframe fullscreenchange
event"); | 17 iframeDocument.onfullscreenchange = t.unreached_func("iframe fullscreenchange
event"); |
21 iframeDocument.onfullscreenerror = t.unreached_func("iframe fullscreenerror ev
ent"); | 18 iframeDocument.onfullscreenerror = t.unreached_func("iframe fullscreenerror ev
ent"); |
22 | 19 |
23 trusted_click(t.step_func(() => { | 20 trusted_click(t.step_func(() => { |
24 iframeDocument.body.requestFullscreen(); | 21 iframeDocument.body.requestFullscreen(); |
25 iframe.remove(); | 22 iframe.remove(); |
| 23 // No events will be fired, end test after 100ms. |
| 24 setTimeout(t.step_func_done(() => { |
| 25 assert_equals(document.fullscreenElement, null); |
| 26 assert_equals(iframeDocument.fullscreenElement, null); |
| 27 }), 100); |
26 }), document.body); | 28 }), document.body); |
27 }); | 29 }); |
28 </script> | 30 </script> |
OLD | NEW |