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-eventsource-redirect-to-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 EventSource() did not fol
low the disallowed redirect.","TEST COMPLETE"]'></script> |
| 10 <script src="../support/alertAssert.sub.js?alerts=[]"></script> |
| 11 <!-- enforcing policy: |
| 12 connect-src 'self'; script-src 'self' 'unsafe-inline'; |
| 13 --> |
| 14 <script></script> |
| 15 </head> |
| 16 |
| 17 <body> |
| 18 <script> |
| 19 var es; |
| 20 try { |
| 21 es = new EventSource("/common/redirect.py?location= http://www.{{hos
t}}:{{ports[http][0]}}/content-security-policy/blink-contrib/resources/simple-ev
ent-stream"); |
| 22 } catch (e) { |
| 23 log("FAIL " + "EventSource() should not throw an exception."); |
| 24 } |
| 25 es.onload = function() { |
| 26 log("FAIL " + "EventSource() should fail to follow the disallowed re
direct."); |
| 27 log("TEST COMPLETE"); |
| 28 }; |
| 29 es.onerror = function() { |
| 30 log("PASS " + "EventSource() did not follow the disallowed redirect.
"); |
| 31 log("TEST COMPLETE"); |
| 32 }; |
| 33 |
| 34 </script> |
| 35 <div id="log"></div> |
| 36 <script async defer src="../support/checkReport.sub.js?reportExists=true&
;reportField=violated-directive&reportValue=connect-src%20'self'/s
ecurity/contentSecurityPolicy/resources/redir.php"></script> |
| 37 </body> |
| 38 |
| 39 </html> |
OLD | NEW |