element-ready-check-allowed-cross-origin.sub.html (1296B)
1 <!DOCTYPE html> 2 <title>Element ready check with allowfullscreen attribute</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/resources/testdriver.js"></script> 6 <script src="/resources/testdriver-vendor.js"></script> 7 <script src="../trusted-click.js"></script> 8 <iframe name="cross-origin-allowed" allowfullscreen></iframe> 9 <script> 10 promise_test(async (t) => { 11 // Trigger the child frame to report as soon as its content is loaded. 12 const iframe = document.querySelector("iframe"); 13 await new Promise((resolve) => { 14 iframe.onload = resolve; 15 iframe.src = 16 "http://{{hosts[alt][]}}:{{ports[http][0]}}/fullscreen/api/resources/attempt-fullscreen.html"; 17 }); 18 19 // Activate the child frame. 20 await test_driver.click(iframe); 21 22 // When a message is received from a child frame, ensure that the report 23 // matches the expectations. 24 const messagePromise = promiseMessage(iframe); 25 const data = await messagePromise; 26 assert_true( 27 data.report.result, 28 `${data.report.frame} frame did enter fullscreen` 29 ); 30 }, "Element ready check with allowfullscreen attribute"); 31 </script>