Update web-platform-tests to revision a806d658df3bcc3f05675ad8d08a6e109177c6b0

This commit is contained in:
WPT Sync Bot 2018-09-05 21:34:01 -04:00
parent af777fcf15
commit 23dfe7c81e
155 changed files with 2487 additions and 546 deletions

View file

@ -1,13 +1,22 @@
var t1 = async_test("Inline script block");
var t2 = async_test("Inline event handler");
onload = function() {t1.done(); t2.done()}
onload = function() {t1.done(); t2.done();};
var t_spv = async_test("Should not fire policy violation events");
var test_count = 2;
var t_spv = async_test("Should fire policy violation events");
var block_event_fired = false;
var handler_event_fired = false;
window.addEventListener("securitypolicyviolation", t_spv.step_func(function(e) {
assert_equals(e.violatedDirective, "script-src");
if (--test_count <= 0) {
t_spv.done();
if (e.violatedDirective == "script-src-elem") {
assert_false(block_event_fired);
block_event_fired = true;
} else if (e.violatedDirective == "script-src-attr") {
assert_false(handler_event_fired);
handler_event_fired = true;
} else {
assert_unreached("Unexpected directive broken");
}
if (block_event_fired && handler_event_fired) {
t_spv.done();
}
}));