report-uri-does-not-respect-base-uri.sub.html (1190B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>Test that base does not affect report-uri</title> 5 <script src='/resources/testharness.js'></script> 6 <script src='/resources/testharnessreport.js'></script> 7 <!-- if base is used for resolving the URL to report to then we will not get a report --> 8 <base href="http://nonexistent.{{domains[]}}"> 9 </head> 10 <body> 11 <script> 12 var t1 = async_test("Test that image does not load"); 13 async_test(function(t2) { 14 window.addEventListener("securitypolicyviolation", t2.step_func(function(e) { 15 assert_equals(e.blockedURI, "{{location[scheme]}}://{{location[host]}}/content-security-policy/support/fail.png"); 16 assert_equals(e.violatedDirective, "img-src"); 17 t2.done(); 18 })); 19 }, "Event is fired"); 20 </script> 21 <img src='{{location[scheme]}}://{{location[host]}}/content-security-policy/support/fail.png' 22 onload='t1.unreached_func("The image should not have loaded");' 23 onerror='t1.done();'> 24 25 <script async defer src='{{location[scheme]}}://{{location[host]}}/content-security-policy/support/checkReport.sub.js?reportField=violated-directive&reportValue=img-src%20%27none%27'></script> 26 </body> 27 </html>