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>connect-src-xmlhttprequest-blocked</title> |
| 7 <script src="/resources/testharness.js"></script> |
| 8 <script src="/resources/testharnessreport.js"></script> |
| 9 <script src='../support/logTest.sub.js?logs=["Pass"]'></script> |
| 10 <script src="../support/alertAssert.sub.js?alerts=[]"></script> |
| 11 <!-- enforcing policy: |
| 12 connect-src 'self'; script-src 'self' 'unsafe-inline'; |
| 13 --> |
| 14 </head> |
| 15 |
| 16 <body> |
| 17 <script> |
| 18 try { |
| 19 var xhr = new XMLHttpRequest; |
| 20 xhr.open("GET", "http://www1.{{host}}:{{ports[http][0]}}/content-sec
urity-policy/support/fail.png", true); |
| 21 xhr.send(); |
| 22 xhr.onload = function() { |
| 23 log("Fail"); |
| 24 } |
| 25 xhr.onerror = function() { |
| 26 log("Pass"); |
| 27 } |
| 28 } catch (e) { |
| 29 log("Pass"); |
| 30 } |
| 31 |
| 32 </script> |
| 33 <div id="log"></div> |
| 34 <script async defer src="../support/checkReport.sub.js?reportExists=true&
;reportField=violated-directive&reportValue=connect-src%20'self'">
</script> |
| 35 </body> |
| 36 |
| 37 </html> |
OLD | NEW |