| Kunihiko Sakamoto | 1a4049a | 2017-09-27 09:54:31 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <script nonce="abc" src="/resources/testharness.js"></script> |
| 3 | <script nonce="abc" src="/resources/testharnessreport.js"></script> |
| 4 | <script nonce="abc" src="/preload/resources/preload_helper.js"></script> |
| 5 | <body> |
| 6 | <script nonce="abc"> |
| 7 | |
| 8 | async_test(function(t) { |
| 9 | verifyPreloadAndRTSupport(); |
| 10 | var link = document.createElement("link"); |
| 11 | link.as = "script"; |
| 12 | link.rel = "preload"; |
| 13 | link.href = "resources/dummy.js?with-nonce"; |
| 14 | link.nonce = "abc"; |
| 15 | link.onload = link.onerror = t.step_func(function() { |
| 16 | t.step_timeout(function() { |
| Kunihiko Sakamoto | eb5aa00 | 2019-02-05 03:35:20 | [diff] [blame] | 17 | verifyNumberOfResourceTimingEntries("resources/dummy.js?with-nonce", 1); |
| Kunihiko Sakamoto | 1a4049a | 2017-09-27 09:54:31 | [diff] [blame] | 18 | t.done(); |
| 19 | }, 0); |
| 20 | }); |
| 21 | document.body.appendChild(link); |
| 22 | }, "link preload with nonce attribute"); |
| 23 | |
| 24 | async_test(function(t) { |
| 25 | verifyPreloadAndRTSupport(); |
| 26 | var link = document.createElement("link"); |
| 27 | link.as = "script"; |
| 28 | link.rel = "preload"; |
| 29 | link.href = "resources/dummy.js?without-nonce"; |
| 30 | link.onload = link.onerror = t.step_func(function() { |
| 31 | t.step_timeout(function() { |
| Kunihiko Sakamoto | eb5aa00 | 2019-02-05 03:35:20 | [diff] [blame] | 32 | verifyNumberOfResourceTimingEntries("resources/dummy.js?without-nonce", 0); |
| Kunihiko Sakamoto | 1a4049a | 2017-09-27 09:54:31 | [diff] [blame] | 33 | t.done(); |
| 34 | }, 0); |
| 35 | }); |
| 36 | document.body.appendChild(link); |
| 37 | }, "link preload without nonce attribute"); |
| 38 | |
| 39 | </script> |
| 40 | </body> |