| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="/resources/testharness.js"></script> |
| 3 <script src="/resources/testharnessreport.js"></script> |
| 4 |
| 5 <meta http-equiv="content-security-policy" content="script-src 'self' 'nonce-a'
blob: filesystem:"> |
| 6 <script nonce="a"> |
| 7 // The filesystem test takes some nesting to setup: |
| 8 setup({explicit_done: true}); |
| 9 |
| 10 // External URLs inherit policy: the header delivered with the script resource
is ignored. |
| 11 fetch_tests_from_worker(new Worker("./support/script-src-self.sub.js")); |
| 12 fetch_tests_from_worker(new Worker("./support/script-src-self.sub.js?pipe=sub|
header(Content-Security-Policy,script-src 'none')")); |
| 13 fetch_tests_from_worker(new Worker("./support/script-src-self.sub.js?pipe=sub|
header(Content-Security-Policy,script-src *)")); |
| 14 fetch_tests_from_worker(new Worker("./support/script-src-self.sub.js?pipe=sub|
header(Content-Security-Policy,default-src 'none')")); |
| 15 fetch_tests_from_worker(new Worker("./support/script-src-self.sub.js?pipe=sub|
header(Content-Security-Policy,default-src *)")); |
| 16 |
| 17 fetch("./support/script-src-self.sub.js") |
| 18 .then(r => r.blob()) |
| 19 .then(b => { |
| 20 // 'blob:' URLs inherit policy. |
| 21 var u = URL.createObjectURL(b); |
| 22 fetch_tests_from_worker(new Worker(u)); |
| 23 |
| 24 // 'filesystem:' urls inherit policy. |
| 25 if (window.webkitrequestfilesystem) { |
| 26 window.webkitRequestFileSystem(window.TEMPORARY, 1024*1024, fs => { |
| 27 fs.root.getFile('worker.js', { create: true }, entry => { |
| 28 entry.createWriter(w => { |
| 29 w.onwriteend = _ => { |
| 30 var u = entry.toURL(); |
| 31 fetch_tests_from_worker(new Worker(u)); |
| 32 |
| 33 // explicit_done: yay. |
| 34 done(); |
| 35 }; |
| 36 w.onerror = _ => {assert_unreached() }; |
| 37 w.write(b); |
| 38 }); |
| 39 }); |
| 40 }); |
| 41 } else { |
| 42 done(); |
| 43 } |
| 44 }); |
| 45 </script> |
| OLD | NEW |