Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/external/wpt/fullscreen/api/document-fullscreen-enabled-cross-origin.sub.html |
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/fullscreen/api/document-fullscreen-enabled-cross-origin.sub.html b/third_party/WebKit/LayoutTests/external/wpt/fullscreen/api/document-fullscreen-enabled-cross-origin.sub.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1452f77c3a1c4082da0bf436e406adbb5eece1aa |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/external/wpt/fullscreen/api/document-fullscreen-enabled-cross-origin.sub.html |
| @@ -0,0 +1,37 @@ |
| +<!DOCTYPE html> |
| +<title>Document#fullscreenEnabled</title> |
| +<script src="/resources/testharness.js"></script> |
| +<script src="/resources/testharnessreport.js"></script> |
| +<div id="log"></div> |
| +<iframe src="resources/report-fullscreen-enabled.html" name="same-origin-default"></iframe> |
| +<iframe src="resources/report-fullscreen-enabled.html" allowfullscreen name="same-origin-allow"></iframe> |
| +<iframe src="http://{{domains[www1]}}:{{ports[http][0]}}/fullscreen/api/resources/report-fullscreen-enabled.html" name="cross-origin-default"></iframe> |
| +<iframe src="http://{{domains[www1]}}:{{ports[http][0]}}/fullscreen/api/resources/report-fullscreen-enabled.html" allowfullscreen name="cross-origin-allow"></iframe> |
| +<script> |
| +// Fullscreen is enabled in same-origin frames regardless of allowfullscreen, |
| +// but must be explicitly enabled in cross-origin frames. |
| +var expectations = { |
| + "same-origin-default": true, |
| + "same-origin-allow": true, |
| + "cross-origin-default": false, |
| + "cross-origin-allow": true |
| +}; |
| + |
| +async_test((t) => { |
|
foolip
2017/08/16 21:43:15
Because there's just one async_test, there's just
iclelland
2017/08/17 20:01:56
Done.
|
| + // When a message is received from a child frame, ensure that the report |
| + // matches the expectations. |
| + window.addEventListener('message', t.step_func(e => { |
| + if (e.data.report && e.data.report.api == "fullscreen") { |
| + if (e.data.report.frame in expectations) { |
| + assert_equals(e.data.report.enabled, |
| + expectations[e.data.report.frame], |
| + e.data.report.frame + " frame webkitFullscreenEnabled"); |
|
foolip
2017/08/16 21:43:15
more webkit on the loose :)
iclelland
2017/08/17 20:01:56
Ack! Fixed, thanks :)
(Thankfully just in text out
|
| + delete expectations[e.data.report.frame]; |
| + // When all child frames have reported, the test is complete. |
| + if (Object.keys(expectations).length == 0) |
| + t.done(); |
| + } |
| + } |
| + })); |
| +}); |
| +</script> |