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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/workers/dedicated-inheritance.html

Issue 2540983003: CSP: Dedicated workers always inherit policy. (Closed)
Patch Set: Rebase. 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
(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="connect-src 'self'">
6 <script>
7 // The filesystem test takes some nesting to setup:
8 setup({explicit_done: true});
9
10 // External URLs inherit policy.
11 fetch_tests_from_worker(new Worker("/security/contentSecurityPolicy/workers/re sources/connect-src-self.js"));
12
13 fetch("/security/contentSecurityPolicy/workers/resources/connect-src-self.js")
14 .then(r => r.blob())
15 .then(b => {
16 // 'blob:' URLs inherit policy.
17 var u = URL.createObjectURL(b);
18 fetch_tests_from_worker(new Worker(u));
19
20 // 'filesystem:' URLs inherit policy.
21 window.webkitRequestFileSystem(window.TEMPORARY, 1024*1024, fs => {
22 fs.root.getFile('worker.js', { create: true }, entry => {
23 entry.createWriter(w => {
24 w.onwriteend = _ => {
25 var u = entry.toURL();
26 fetch_tests_from_worker(new Worker(u));
27
28 // explicit_done: yay.
29 done();
30 };
31 w.onerror = _ => {assert_unreached() };
32 w.write(b);
33 });
34 });
35 });
36 });
37 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698