iframe-non-html.html (872B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>Test the sequence of events when reporting iframe timing.</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="resources/resource-loaders.js"></script> 7 <body> 8 <script> 9 function test(href, type) { 10 promise_test(async t => { 11 await load.iframe(href); 12 const entries = performance.getEntriesByType('resource').filter(({name}) => name.includes(href)); 13 assert_equals(entries.length, 1); 14 assert_equals(entries[0].initiatorType, 'iframe'); 15 }, `Iframes should report resource timing for ${type} iframes`); 16 } 17 18 test('/common/square.png', 'image'); 19 test('/common/dummy.xhtml', 'xhtml'); 20 test('/common/dummy.xml', 'xml'); 21 test('/common/text-plain.txt', 'text'); 22 </script> 23 </body>