OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="/resources/testharness.js"></script> |
| 3 <script src="/resources/testharnessreport.js"></script> |
| 4 <script> |
| 5 var t = async_test('Makes sure that a dynamically added preloaded resource i
s downloaded'); |
| 6 </script> |
| 7 <body> |
| 8 <script> |
| 9 t.step(function() { |
| 10 var link = document.createElement("link"); |
| 11 assert_true(link.relList && link.relList.supports && link.relList.suppor
ts("preload"), "relList is not defined or browser doesn't support preload."); |
| 12 link.as = "script"; |
| 13 link.rel = "preload"; |
| 14 link.href = "resources/dummy.js"; |
| 15 link.onload = t.step_func(function() { |
| 16 t.step_timeout(function() { |
| 17 assert_equals(performance.getEntriesByType("resource").length, 3
); |
| 18 t.done(); |
| 19 }, 0); |
| 20 }); |
| 21 document.body.appendChild(link); |
| 22 }); |
| 23 </script> |
| 24 </body> |
OLD | NEW |