OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta http-equiv="Content-Security-Policy" content="connect-src http://127.0.0.1
:8000"/> | 4 <meta http-equiv="Content-Security-Policy" content="connect-src 'none'"/> |
5 <script> | 5 <script> |
6 if (window.testRunner) { | 6 if (window.testRunner) { |
7 testRunner.waitUntilDone(); | 7 testRunner.waitUntilDone(); |
8 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
9 } | 9 } |
10 </script> | 10 </script> |
11 </head> | 11 </head> |
12 <body> | 12 <body> |
13 <script> | 13 <script> |
14 try { | 14 try { |
15 var worker = new SharedWorker('http://127.0.0.1:8000/security/contentSecurit
yPolicy/resources/shared-worker-make-xhr.js'); | 15 var worker = new SharedWorker('http://127.0.0.1:8000/security/contentSecurit
yPolicy/resources/worker.php?type=shared-make-xhr&csp=' + |
| 16 encodeURIComponent("connect-src http://127.0.0
.1:8000")); |
16 worker.port.onmessage = function (event) { | 17 worker.port.onmessage = function (event) { |
17 alert(event.data); | 18 alert(event.data); |
18 if (window.testRunner) | 19 if (window.testRunner) |
19 testRunner.notifyDone(); | 20 testRunner.notifyDone(); |
20 }; | 21 }; |
21 } catch (e) { | 22 } catch (e) { |
22 alert(e); | 23 alert(e); |
23 if (window.testRunner) | 24 if (window.testRunner) |
24 testRunner.notifyDone(); | 25 testRunner.notifyDone(); |
25 } | 26 } |
26 </script> | 27 </script> |
27 </body> | 28 </body> |
28 </html> | 29 </html> |
OLD | NEW |