external-script.html (1002B)
1 <!DOCTYPE html> 2 <head> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/common/get-host-info.sub.js"></script> 6 <script src="../../resources/test-initiator.js"></script> 7 8 </head> 9 <body> 10 <script src="../../resources/loading-resources.js"></script> 11 12 <h1>Description</h1> 13 <p> This test loads a number of resources in the loading-resources.js and 14 verifies that `iniatitor_url`s in ResourceTiming entries are as expected. 15 </p> 16 </body> 17 <script> 18 19 const hostInfo = get_host_info(); 20 const expectedInitiatorUrl = hostInfo["ORIGIN"] + "/resource-timing/resources/loading-resources.js"; 21 const resources = [ 22 "empty_style.css?no_cache", 23 "blue.png?no_cache", 24 "empty.js?no_cache", 25 "green.html?no_cache", 26 ]; 27 for (const resource of resources) { 28 initiator_url_test(resource, expectedInitiatorUrl, resource + 29 " initiatorUrl from external scripts", resource + " timeout"); 30 } 31 </script>