link-header-on-subresource.html (1089B)
1 <!DOCTYPE html> 2 <title>Makes sure that Link headers on subresources preload resources</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/preload/resources/preload_helper.js"></script> 6 <link rel=stylesheet href="resources/dummy-preloads-subresource.css?link-header-on-subresource"> 7 <script> 8 setup({single_test: true}); 9 10 var iterations = 0; 11 12 function check_finished() { 13 if (numberOfResourceTimingEntries("/fonts/CanvasTest.ttf?link-header-on-subresource") == 1) { 14 done(); 15 } 16 iterations++; 17 if (iterations == 10) { 18 // This is expected to fail, but this should give details to the exact failure. 19 verifyNumberOfResourceTimingEntries("/fonts/CanvasTest.ttf?link-header-on-subresource", 1); 20 done(); 21 } else { 22 step_timeout(check_finished, 500); 23 } 24 } 25 26 window.addEventListener("load", function() { 27 verifyPreloadAndRTSupport(); 28 step_timeout(check_finished, 500); 29 }); 30 </script>