cross-origin-iframe.html (1302B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Test ResourceTiming reporting for cross-origin iframe.</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="/common/get-host-info.sub.js"></script> 7 <script src="resources/entry-invariants.js"></script> 8 <script src="resources/observe-entry.js"></script> 9 </head> 10 <body> 11 <body> 12 <script> 13 const {REMOTE_ORIGIN} = get_host_info(); 14 15 promise_test(async t => { 16 const iframe = document.createElement('iframe'); 17 t.add_cleanup(() => iframe.remove()); 18 iframe.src = `${REMOTE_ORIGIN}/resource-timing/resources/green.html`; 19 document.body.appendChild(iframe); 20 const entry = await observe_entry(iframe.src); 21 invariants.assert_tao_failure_resource(entry); 22 }, "A cross-origin iframe should report an opaque RT entry"); 23 24 promise_test(async t => { 25 const iframe = document.createElement('iframe'); 26 t.add_cleanup(() => iframe.remove()); 27 iframe.src = `${REMOTE_ORIGIN}/resource-timing/resources/TAOResponse.py?tao=wildcard`; 28 document.body.appendChild(iframe); 29 const entry = await observe_entry(iframe.src); 30 invariants.assert_tao_pass_no_redirect_http(entry); 31 }, "A cross-origin iframe with TAO enabled should report a full RT entry"); 32 33 </script>