Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-in line'; font-src 'none'"> | |
|
Mike West
2016/08/19 09:25:41
Can you add a more complicated test as well? Somet
| |
| 3 <script> | |
| 4 var boundedStart = performance.now(); | |
| 5 </script> | |
| 6 <script src="../resources/testharness.js"></script> | |
| 7 <script src="../resources/testharnessreport.js"></script> | |
| 8 <link rel=preload href="../resources/Ahem.ttf" as=font crossorigin> | |
| 9 <script> | |
| 10 var t = async_test("Ensure preloads occur when csp meta tags are in the markup "); | |
| 11 window.addEventListener("load", t.step_func(function() { | |
| 12 var fonts = performance.getEntriesByName(new URL("../resources/Ahem.ttf", lo cation.href).href); | |
| 13 assert_equals(fonts.length, 0); | |
| 14 window.performance.getEntriesByType('resource').forEach(function(r) { | |
| 15 if (r.name.indexOf('testharness.js') != -1) { | |
| 16 assert_greater_than(r.startTime, 0); | |
| 17 assert_greater_than(boundedStart, r.startTime); | |
|
kouhei (in TOK)
2016/08/19 04:56:15
Should we use internals.isPreloaded?
Charlie Harrison
2016/08/19 15:13:40
Done. isPreloaded will return true even if the res
kouhei (in TOK)
2016/08/22 05:34:03
Yes.
| |
| 18 t.done(); | |
| 19 } | |
| 20 }); | |
| 21 })); | |
| 22 </script> | |
| 23 | |
| OLD | NEW |