| Yoav Weiss | 7b2c320 | 2017-08-18 11:45:55 | [diff] [blame] | 1 | <!DOCTYPE html> |
| Rob Buis | a0b31f6 | 2019-05-27 08:51:32 | [diff] [blame] | 2 | <title>Makes sure that Link headers on subresources preload resources</title> |
| Yoav Weiss | 7b2c320 | 2017-08-18 11:45:55 | [diff] [blame] | 3 | <script src="/resources/testharness.js"></script> |
| 4 | <script src="/resources/testharnessreport.js"></script> |
| 5 | <script src="/preload/resources/preload_helper.js"></script> |
| Yoav Weiss | 7b2c320 | 2017-08-18 11:45:55 | [diff] [blame] | 6 | <link rel=stylesheet href="resources/dummy-preloads-subresource.css?link-header-on-subresource"> |
| Yoav Weiss | 7b2c320 | 2017-08-18 11:45:55 | [diff] [blame] | 7 | <script> |
| jugglinmike | 306dc50 | 2019-10-26 07:19:26 | [diff] [blame] | 8 | setup({single_test: true}); |
| Rob Buis | a0b31f6 | 2019-05-27 08:51:32 | [diff] [blame] | 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. |
| Kunihiko Sakamoto | eb5aa00 | 2019-02-05 03:35:20 | [diff] [blame] | 19 | verifyNumberOfResourceTimingEntries("/fonts/CanvasTest.ttf?link-header-on-subresource", 1); |
| Rob Buis | a0b31f6 | 2019-05-27 08:51:32 | [diff] [blame] | 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 | }); |
| Yoav Weiss | 7b2c320 | 2017-08-18 11:45:55 | [diff] [blame] | 30 | </script> |
| 31 | |