Update web-platform-tests to revision 077bb422b7bb21491a414e334bc594d83ca9e55b

This commit is contained in:
WPT Sync Bot 2018-10-16 21:24:11 -04:00
parent aa9591137a
commit b2341e328d
248 changed files with 2930 additions and 1961 deletions

View file

@ -396,14 +396,15 @@ function test_subframe_header_policy(
// by iframe allow attribute.
// Arguments:
// feature: feature name.
// src: the URL to load in the frame.
// src: the URL to load in the frame. If undefined, the iframe will have a
// srcdoc="" attribute
// 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, sandbox) {
feature, src, srcdoc, 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
@ -418,7 +419,12 @@ function test_frame_policy(
if (!!sandbox) {
frame.setAttribute('sandbox', 'allow-scripts');
}
frame.src = src;
if (!!src) {
frame.src = src;
}
if (!!srcdoc) {
frame.srcdoc = "<h1>Hello world!</h1>";
}
if (test_expect) {
assert_true(frame_policy.allowedFeatures().includes(feature));
} else {