blob: 19e09472eef3813c9fb25ff7b6549477615c760e [file] [log] [blame]
Kunihiko Sakamoto1a4049a2017-09-27 09:54:311<!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
8async_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 Sakamotoeb5aa002019-02-05 03:35:2017 verifyNumberOfResourceTimingEntries("resources/dummy.js?with-nonce", 1);
Kunihiko Sakamoto1a4049a2017-09-27 09:54:3118 t.done();
19 }, 0);
20 });
21 document.body.appendChild(link);
22}, "link preload with nonce attribute");
23
24async_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 Sakamotoeb5aa002019-02-05 03:35:2032 verifyNumberOfResourceTimingEntries("resources/dummy.js?without-nonce", 0);
Kunihiko Sakamoto1a4049a2017-09-27 09:54:3133 t.done();
34 }, 0);
35 });
36 document.body.appendChild(link);
37}, "link preload without nonce attribute");
38
39</script>
40</body>