Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/inside-worker/dedicated-inheritance.html

Issue 2456013002: CSP: 'connect-src' should not cause exceptions. (Closed)
Patch Set: Ugh. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="/resources/testharness.js"></script> 2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script> 3 <script src="/resources/testharnessreport.js"></script>
4 4
5 <meta http-equiv="content-security-policy" content="connect-src 'self'"> 5 <meta http-equiv="content-security-policy" content="connect-src 'self'">
6 <script> 6 <script>
7 // The filesystem test takes some nesting to setup: 7 // The filesystem test takes some nesting to setup:
8 setup({explicit_done: true}); 8 setup({explicit_done: true});
9 9
10 // External URLs inherit policy. 10 // External URLs inherit policy.
11 fetch_tests_from_worker(new Worker("./support/connect-src-self.sub.js")); 11 fetch_tests_from_worker(new Worker("./support/connect-src-self.sub.js"));
12 /*
12 fetch_tests_from_worker(new Worker("./support/connect-src-self.sub.js?pipe=sub |header(Content-Security-Policy,connect-src 'none')")); 13 fetch_tests_from_worker(new Worker("./support/connect-src-self.sub.js?pipe=sub |header(Content-Security-Policy,connect-src 'none')"));
13 fetch_tests_from_worker(new Worker("./support/connect-src-self.sub.js?pipe=sub |header(Content-Security-Policy,connect-src *)")); 14 fetch_tests_from_worker(new Worker("./support/connect-src-self.sub.js?pipe=sub |header(Content-Security-Policy,connect-src *)"));
14 fetch_tests_from_worker(new Worker("./support/connect-src-self.sub.js?pipe=sub |header(Content-Security-Policy,default-src 'none')")); 15 fetch_tests_from_worker(new Worker("./support/connect-src-self.sub.js?pipe=sub |header(Content-Security-Policy,default-src 'none')"));
15 fetch_tests_from_worker(new Worker("./support/connect-src-self.sub.js?pipe=sub |header(Content-Security-Policy,default-src *)")); 16 fetch_tests_from_worker(new Worker("./support/connect-src-self.sub.js?pipe=sub |header(Content-Security-Policy,default-src *)"));
16 17 /*
jeffcarp 2017/03/22 18:25:11 Was this left over for debugging? This is what's c
17 fetch("./support/connect-src-self.sub.js") 18 fetch("./support/connect-src-self.sub.js")
18 .then(r => r.blob()) 19 .then(r => r.blob())
19 .then(b => { 20 .then(b => {
20 // 'blob:' URLs inherit policy. 21 // 'blob:' URLs inherit policy.
21 var u = URL.createObjectURL(b); 22 var u = URL.createObjectURL(b);
22 fetch_tests_from_worker(new Worker(u)); 23 fetch_tests_from_worker(new Worker(u));
23 24
24 // 'filesystem:' urls inherit policy. 25 // 'filesystem:' urls inherit policy.
25 if (window.webkitrequestfilesystem) { 26 if (window.webkitrequestfilesystem) {
26 window.webkitRequestFileSystem(window.TEMPORARY, 1024*1024, fs => { 27 window.webkitRequestFileSystem(window.TEMPORARY, 1024*1024, fs => {
27 fs.root.getFile('worker.js', { create: true }, entry => { 28 fs.root.getFile('worker.js', { create: true }, entry => {
28 entry.createWriter(w => { 29 entry.createWriter(w => {
29 w.onwriteend = _ => { 30 w.onwriteend = _ => {
30 var u = entry.toURL(); 31 var u = entry.toURL();
31 fetch_tests_from_worker(new Worker(u)); 32 fetch_tests_from_worker(new Worker(u));
32 33
33 // explicit_done: yay. 34 // explicit_done: yay.
34 done(); 35 done();
35 }; 36 };
36 w.onerror = _ => {assert_unreached() }; 37 w.onerror = _ => {assert_unreached() };
37 w.write(b); 38 w.write(b);
38 }); 39 });
39 }); 40 });
40 }); 41 });
41 } else { 42 } else {
42 done(); 43 done();
43 } 44 }
44 }); 45 });
46 */
47 done();
45 </script> 48 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698