| Index: third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow.html
|
| diff --git a/third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow.html b/third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..02b6c658f7d794eb83eac772fb1ee80a7c798397
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/shadow-dom/fullscreen-element-in-shadow.html
|
| @@ -0,0 +1,74 @@
|
| +<!DOCTYPE html>
|
| +<script src='../resources/testharness.js'></script>
|
| +<script src='../resources/testharnessreport.js'></script>
|
| +<script src='resources/shadow-dom.js'></script>
|
| +
|
| +<div id='host'>
|
| + <template data-mode='open'>
|
| + <slot></slot>
|
| + </template>
|
| + <div id='host2'>
|
| + <template data-mode='open'>
|
| + <div id='host3'>
|
| + <template data-mode='open'>
|
| + <canvas></canvas>
|
| + <div id='host4'>
|
| + <template data-mode='open'>
|
| + <div></div>
|
| + </template>
|
| + </div>
|
| + </template>
|
| + </div>
|
| + <div id='host5'>
|
| + <template data-mode='open'>
|
| + <div></div>
|
| + </template>
|
| + </div>
|
| + </template>
|
| + </div>
|
| +</div>
|
| +
|
| +<script>
|
| +async_test((test) => {
|
| + document.onfullscreenerror = test.unreached_func('onfullscreenerror is not expected.');
|
| +
|
| + document.onfullscreenchange = test.step_func_done(() => {
|
| + // Not interested in handling before or after exitFullscreen.
|
| + if (document.fullscreenElement === null)
|
| + return;
|
| +
|
| + assert_equals(document.fullscreenElement, host2, 'document.fullscreenElement should be shadow host2.');
|
| + assert_equals(host.shadowRoot.fullscreenElement, null, 'host\'s shadowRoot.fullscreenElement should be null.');
|
| + assert_equals(host2.shadowRoot.fullscreenElement, host3, 'host2\'s shadowRoot.fullscreenElement should be host3.');
|
| + assert_equals(host3.shadowRoot.fullscreenElement, canvas, 'host3\'s shadowRoot.fullscreenElement should be canvas element.');
|
| + assert_equals(host4.shadowRoot.fullscreenElement, null, 'host4\'s shadowRoot.fullscreenElement should be null.');
|
| + assert_equals(host5.shadowRoot.fullscreenElement, null, 'host5\'s shadowRoot.fullscreenElement should be null.');
|
| +
|
| + document.exitFullscreen();
|
| + });
|
| +
|
| + convertTemplatesToShadowRootsWithin(host);
|
| + var host3 = host2.shadowRoot.querySelector('#host3');
|
| + var host4 = host3.shadowRoot.querySelector('#host4');
|
| + var host5 = host2.shadowRoot.querySelector('#host5');
|
| +
|
| + // All fullscreenElement should default to null.
|
| + assert_equals(document.fullscreenElement, null);
|
| + assert_equals(host.shadowRoot.fullscreenElement, null);
|
| + assert_equals(host2.shadowRoot.fullscreenElement, null);
|
| + assert_equals(host3.shadowRoot.fullscreenElement, null);
|
| + assert_equals(host4.shadowRoot.fullscreenElement, null);
|
| + assert_equals(host5.shadowRoot.fullscreenElement, null);
|
| +
|
| + var canvas = host3.shadowRoot.querySelector('canvas');
|
| + if (window.testRunner) {
|
| + setTimeout(() => {
|
| + document.onclick = () => {
|
| + canvas.requestFullscreen();
|
| + };
|
| + eventSender.mouseDown();
|
| + eventSender.mouseUp();
|
| + }, 0);
|
| + }
|
| +}, 'Test for fullscreenElement adjustment for Shadow DOM.');
|
| +</script>
|
|
|