Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/fullscreen/full-screen-iframe-legacy.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/fullscreen/full-screen-iframe-legacy.html b/third_party/WebKit/LayoutTests/http/tests/fullscreen/full-screen-iframe-legacy.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d7ad453f52ac4ad5270b97ecb7f01d845c7fde1a |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/fullscreen/full-screen-iframe-legacy.html |
| @@ -0,0 +1,53 @@ |
| +<!DOCTYPE html> |
| +<html> |
| + <head> |
| + <meta charset="utf-8"> |
| + <title>fullscreenEnabled test</title> |
| + <script src="../resources/testharness.js"></script> |
| + <script src="../resources/testharnessreport.js"></script> |
| + </head> |
| + <body> |
| +<p>HTMLVideoElement.webkitEnterFullScreen() in a cross-origin iframe requires the allowfullscreen attribute</p> |
|
foolip
2017/08/16 21:43:15
As mentioned elsewhere, I think it's OK to not cov
|
| +<script src="resources/media-file.js"></script> |
| +<iframe name="cross-origin-default" src="http://localhost:8000/fullscreen/resources/legacy.html" width="336" height="256"> |
| +</iframe> |
| +<iframe name="cross-origin-allowfullscreen" allowfullscreen src="http://localhost:8000/fullscreen/resources/legacy.html" width="336" height="256"> |
| +</iframe> |
| +<script> |
| +var expectations = { |
| + "cross-origin-default": [false, false], |
| + "cross-origin-allowfullscreen": [true, true], |
| +}; |
| + |
| +async_test((t) => { |
| + // When a message is received from a child frame, ensure that the report |
| + // matches the expectations. |
| + window.addEventListener('message', (e) => { |
| + if (e.data.report && e.data.report.api == "fullscreen") { |
| + if (e.data.report.frame in expectations) { |
| + t.step(() => { |
| + expectations[e.data.report.frame].forEach((elem, index) => { |
| + assert_equals(e.data.report.enabled[index], elem, |
| + e.data.report.frame + " frame webkitDisplayingFullscreen result " + index); |
| + }); |
| + }); |
| + delete expectations[e.data.report.frame]; |
| + // When all child frames have reported, the test is complete. |
| + if (Object.keys(expectations).length == 0) |
| + t.done(); |
| + } |
| + } |
| + }); |
| + |
| + // Trigger the child frames to report as soon as their content is loaded. |
| + var videoSrc = findMediaFile("video", "/media-resources/content/test"); |
| + document.querySelectorAll('iframe').forEach((elem) => { |
| + elem.addEventListener('load', () => { |
| + elem.contentWindow.postMessage({"action": "report", "frame": elem.name, |
| + "videoSrc": videoSrc}, "*"); |
| + }); |
| + }); |
| +}); |
| +</script> |
| + </body> |
| +</html> |