diff options
Diffstat (limited to 'testing/web-platform/tests/fullscreen/api/document-fullscreen-element-manual.html')
-rw-r--r-- | testing/web-platform/tests/fullscreen/api/document-fullscreen-element-manual.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fullscreen/api/document-fullscreen-element-manual.html b/testing/web-platform/tests/fullscreen/api/document-fullscreen-element-manual.html new file mode 100644 index 000000000..473bdbb0f --- /dev/null +++ b/testing/web-platform/tests/fullscreen/api/document-fullscreen-element-manual.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<title>Document.fullscreenElement</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="../trusted-click.js"></script> +<div id="log"></div> +<script> +async_test(function(t) +{ + var div = document.querySelector("div"); + + document.onfullscreenchange = t.step_func(function() + { + assert_equals(document.fullscreenElement, div, "fullscreenElement before exitFullscreen()"); + document.exitFullscreen(); + assert_equals(document.fullscreenElement, div, "fullscreenElement after exitFullscreen()"); + + document.onfullscreenchange = t.step_func(function() + { + assert_equals(document.fullscreenElement, null, "fullscreenElement after exiting fullscreen"); + t.done(); + }); + }); + + trusted_click(t.step_func(function() + { + assert_equals(document.fullscreenElement, null, "fullscreenElement before requestFullscreen()"); + div.requestFullscreen(); + assert_equals(document.fullscreenElement, null, "fullscreenElement after requestFullscreen()"); + }), document.body); +}); +</script> |