Index: third_party/WebKit/LayoutTests/shadow-dom/v0/fullscreen-element-in-v0.html |
diff --git a/third_party/WebKit/LayoutTests/shadow-dom/v0/fullscreen-element-in-v0.html b/third_party/WebKit/LayoutTests/shadow-dom/v0/fullscreen-element-in-v0.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4d53e36e3d1b1098af2d50dd6bf58150b56d537f |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/shadow-dom/v0/fullscreen-element-in-v0.html |
@@ -0,0 +1,44 @@ |
+<!DOCTYPE html> |
+<script src='../../resources/testharness.js'></script> |
+<script src='../../resources/testharnessreport.js'></script> |
+<script src='../resources/shadow-dom.js'></script> |
+<script src='../../fullscreen/trusted-event.js'></script> |
+ |
+<div id='host0'> |
+ <template data-mode='v0'> |
+ <canvas></canvas> |
+ </template> |
+</div> |
+ |
+<script> |
+convertTemplatesToShadowRootsWithin(host0); |
+ |
+async_test((test) => { |
+ document.onfullscreenerror = test.unreached_func('onfullscreenerror is not expected.'); |
+ |
+ // All fullscreenElement should default to null. |
+ assert_equals(document.fullscreenElement, null); |
+ assert_equals(document.webkitFullscreenElement, null); |
+ assert_equals(document.webkitCurrentFullScreenElement, null); |
+ assert_equals(host0.shadowRoot.fullscreenElement, null); |
+ |
+ var canvas = host0.shadowRoot.querySelector('canvas'); |
+ trusted_request(canvas); |
+ |
+ document.onfullscreenchange = test.step_func(() => { |
+ // Not interested in handling before or after exitFullscreen. |
+ if (document.fullscreenElement === null) |
+ return; |
+ |
+ // fullscreen element in V0 shadow root will not be retargeted. |
+ assert_equals(document.fullscreenElement, canvas); |
+ assert_equals(document.webkitFullscreenElement, canvas); |
+ assert_equals(document.webkitCurrentFullScreenElement, canvas); |
+ |
+ assert_equals(host0.shadowRoot.fullscreenElement, null); |
+ document.exitFullscreen(); |
+ test.done(); |
+ }); |
+ |
+}, 'Test for fullscreenElement adjustment for single shadow tree.'); |
+</script> |