OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 |
| 4 <head> |
| 5 <!-- Programmatically converted from a WebKit Reftest, please forgive result
ing idiosyncracies.--> |
| 6 <title>worker-connect-src-blocked</title> |
| 7 <script src="/resources/testharness.js"></script> |
| 8 <script src="/resources/testharnessreport.js"></script> |
| 9 <script src="../support/logTest.sub.js?logs=[]"></script> |
| 10 <script src='../support/alertAssert.sub.js?alerts=["TEST COMPLETE"]'></scrip
t> |
| 11 <!-- enforcing policy: |
| 12 connect-src 'self'; script-src 'self' 'unsafe-inline'; child-src *; |
| 13 --> |
| 14 |
| 15 </head> |
| 16 <p>This test loads a worker, from a guid. |
| 17 The worker should be blocked from loading with a child-src policy of * |
| 18 as the blob: scheme must be specified explicitly. |
| 19 A report should be sent to the report-uri specified |
| 20 with this resource.</p> |
| 21 <body> |
| 22 <script> |
| 23 try { |
| 24 var blob = new Blob([ |
| 25 "postMessage('FAIL');" + |
| 26 "postMessage('TEST COMPLETE');" |
| 27 ], |
| 28 {type : 'application/javascript'}); |
| 29 var url = URL.createObjectURL(blob); |
| 30 var worker = new Worker(url); |
| 31 worker.onmessage = function(event) { |
| 32 alert_assert(event.data); |
| 33 }; |
| 34 worker.onerror = function(event) { |
| 35 event.preventDefault(); |
| 36 alert_assert('TEST COMPLETE'); |
| 37 } |
| 38 } catch (e) { |
| 39 alert_assert('TEST COMPLETE'); |
| 40 } |
| 41 function timeout() { |
| 42 alert_assert('TEST COMPLETE'); |
| 43 } |
| 44 </script> |
| 45 <div id="log"></div> |
| 46 <script async defer src="../support/checkReport.sub.js?reportExists=true&am
p;reportField=violated-directive&reportValue=child-src%20'self'"><
/script> |
| 47 </body> |
| 48 |
| 49 </html> |
OLD | NEW |