OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>Element ready check with fullscreen allowed</title> |
| 3 <script src="/resources/testharness.js"></script> |
| 4 <script src="/resources/testharnessreport.js"></script> |
| 5 <script src="../trusted-click.js"></script> |
| 6 <iframe src="http://{{domains[www1]}}:{{ports[http][0]}}/fullscreen/api/resource
s/attempt-fullscreen.html" name="cross-origin-allowed" allowfullscreen></iframe> |
| 7 <script> |
| 8 |
| 9 async_test((t) => { |
| 10 // When a message is received from a child frame, ensure that the report |
| 11 // matches the expectations. |
| 12 window.addEventListener('message', t.step_func(e => { |
| 13 if (e.data.report && e.data.report.api == "fullscreen") { |
| 14 assert_equals(e.data.report.result, true, |
| 15 e.data.report.frame + " frame did enter fullscreen"); |
| 16 t.done(); |
| 17 } |
| 18 })); |
| 19 |
| 20 // Trigger the child frame to report as soon as its content is loaded. |
| 21 var elem = document.querySelector('iframe'); |
| 22 elem.addEventListener('load', () => { |
| 23 trusted_click(t, () => { |
| 24 elem.contentWindow.postMessage({"action": "report"}, "*"); |
| 25 }, document.body); |
| 26 }); |
| 27 }); |
| 28 </script> |
OLD | NEW |