Update web-platform-tests to revision 78f764c05c229883e87ad135c7153051a66e2851

This commit is contained in:
WPT Sync Bot 2019-03-06 20:32:15 -05:00
parent 55347aa39f
commit bf84a079f9
1983 changed files with 58006 additions and 31437 deletions

View file

@ -15,6 +15,36 @@
t2.done();
}));
}, "Event is fired");
async_test(function(t3) {
var observer = new ReportingObserver(function(reports, observer) {
t3.step(function() {
assert_equals(reports.length, 1);
// Ensure that the contents of the report are valid.
var base_url = "{{location[scheme]}}://{{location[host]}}/content-security-policy/"
var document_url = base_url + "reporting-api/reporting-api-sends-reports-on-violation.https.sub.html";
assert_equals(reports[0].type, "csp-violation");
assert_equals(reports[0].url, document_url);
assert_equals(reports[0].body.documentURL, document_url);
assert_equals(reports[0].body.referrer, null);
assert_equals(reports[0].body.blockedURL,
base_url + "support/fail.png");
assert_equals(reports[0].body.effectiveDirective, "img-src");
assert_equals(reports[0].body.originalPolicy,
"script-src 'self' 'unsafe-inline'; img-src 'none'; report-to csp-group");
assert_equals(reports[0].body.sourceFile, document_url);
assert_equals(reports[0].body.sample, null);
assert_equals(reports[0].body.disposition, "enforce");
assert_equals(reports[0].body.statusCode, 0);
assert_equals(reports[0].body.lineNumber, 53);
assert_equals(reports[0].body.columnNumber, 0);
});
t3.done();
});
observer.observe();
}, "Report is observable to ReportingObserver");
</script>
<img src='/content-security-policy/support/fail.png'
onload='t1.unreached_func("The image should not have loaded");'