Update web-platform-tests to revision 4a5223502fa660ce03e470af6a61c8bc26c5a8ee

This commit is contained in:
WPT Sync Bot 2018-04-23 21:13:37 -04:00
parent c5f7c9ccf3
commit e891345f26
1328 changed files with 36632 additions and 20588 deletions

View file

@ -393,8 +393,10 @@ function test_subframe_header_policy(
// test_expect: boolean value of whether the feature should be allowed.
// allow: optional, the allow attribute (container policy) of the iframe.
// allowfullscreen: optional, boolean value of allowfullscreen attribute.
// sandbox: optional boolean. If true, the frame will be sandboxed (with
// allow-scripts, so that tests can run in it.)
function test_frame_policy(
feature, src, test_expect, allow, allowfullscreen) {
feature, src, test_expect, allow, allowfullscreen, sandbox) {
let frame = document.createElement('iframe');
document.body.appendChild(frame);
// frame_policy should be dynamically updated as allow and allowfullscreen is
@ -406,6 +408,9 @@ function test_frame_policy(
if (!!allowfullscreen) {
frame.setAttribute('allowfullscreen', true);
}
if (!!sandbox) {
frame.setAttribute('sandbox', 'allow-scripts');
}
frame.src = src;
if (test_expect) {
assert_true(frame_policy.allowedFeatures().includes(feature));