reporting-api-works-on-frame-src.https.sub.html (825B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>Test that reports using the report-api service are sent when there's a violation</title> 5 <script src='/resources/testharness.js'></script> 6 <script src='/resources/testharnessreport.js'></script> 7 </head> 8 <body> 9 <script> 10 async_test(function(t2) { 11 window.addEventListener("securitypolicyviolation", t2.step_func(function(e) { 12 assert_equals(e.blockedURI, "{{location[scheme]}}://{{location[host]}}/content-security-policy/support/fail.html"); 13 assert_equals(e.violatedDirective, "frame-src"); 14 t2.done(); 15 })); 16 }, "Event is fired"); 17 </script> 18 <iframe src="../support/fail.html"></iframe> 19 20 <script async defer src='../support/checkReport.sub.js?reportField=effectiveDirective&reportValue=frame-src%20%27none%27'></script> 21 </body> 22 </html>