callback-iframe-different-origin.html (619B)
1 <!doctype html> 2 <title>window.requestIdleCallback in a cross-origin iframe.</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script> 6 async_test(t => { 7 onload = function() { 8 const iframe = document.createElement('iframe'); 9 iframe.src = location.href.replace('://', '://www1.') 10 .replace('callback-iframe-different-origin', 'resources/child'); 11 document.body.appendChild(iframe); 12 }; 13 14 onmessage = function(e) { 15 assert_equals(e.data, 'done'); 16 t.done(); 17 } 18 }, 'Check that idle tasks run in a cross-origin iframe'); 19 </script>