mirror of
https://github.com/servo/servo.git
synced 2025-08-31 18:18:21 +01:00
Update web-platform-tests to revision 6b6163867ad474d977778a3f19c378a05a4851dc
This commit is contained in:
parent
3ebd42caa3
commit
498854a0e4
49 changed files with 587 additions and 173 deletions
|
@ -7,7 +7,7 @@
|
|||
<body>
|
||||
<script>
|
||||
test(() => {
|
||||
document.policy.allowedFeatures().forEach((enabled_feature) => {
|
||||
document.featurePolicy.allowedFeatures().forEach((enabled_feature) => {
|
||||
assert_not_equals(enabled_feature, "layout-animations");
|
||||
});
|
||||
},
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<body>
|
||||
<script>
|
||||
test(() => {
|
||||
document.policy.allowedFeatures().forEach((enabled_feature) => {
|
||||
document.featurePolicy.allowedFeatures().forEach((enabled_feature) => {
|
||||
assert_not_equals(enabled_feature, "layout-animations");
|
||||
});
|
||||
},
|
||||
|
|
|
@ -25,7 +25,7 @@ html, body {
|
|||
|
||||
// Sanity check.
|
||||
test(() => {
|
||||
assert_false(document.policy.allowsFeature("vertical-scroll"),
|
||||
assert_false(document.featurePolicy.allowsFeature("vertical-scroll"),
|
||||
"Expected 'vertical-scroll' to be disabled.");
|
||||
}, "'vertical-scroll' disabled in main document.");
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Test that fullscreen's allowlist is ['*']
|
||||
test(function() {
|
||||
assert_array_equals(
|
||||
document.policy.getAllowlistForFeature('fullscreen'),
|
||||
document.featurePolicy.getAllowlistForFeature('fullscreen'),
|
||||
['*']);
|
||||
}, header_policy + ' -- test allowlist is ['*']');
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Test that fullscreen's allowlist is ['same_origin']
|
||||
test(function() {
|
||||
assert_array_equals(
|
||||
document.policy.getAllowlistForFeature('fullscreen'),
|
||||
document.featurePolicy.getAllowlistForFeature('fullscreen'),
|
||||
[same_origin]);
|
||||
}, header_policy + ' -- test allowlist is [same_origin]');
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
// Test that fullscreen's allowlist is [same_origin, cross_origin, 'https://www.example.com']
|
||||
test(function() {
|
||||
assert_array_equals(
|
||||
document.policy.getAllowlistForFeature('fullscreen').sort(),
|
||||
document.featurePolicy.getAllowlistForFeature('fullscreen').sort(),
|
||||
[same_origin, cross_origin, 'https://www.example.com'].sort());
|
||||
}, header_policy + ' -- test allowlist is [same_origin, cross_origin, https://www.example.com]');
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
// Test that fullscreen's allowlist is [same_origin, cross_origin, 'https://www.example.com']
|
||||
test(function() {
|
||||
assert_array_equals(
|
||||
document.policy.getAllowlistForFeature('fullscreen'),
|
||||
document.featurePolicy.getAllowlistForFeature('fullscreen'),
|
||||
[cross_origin, 'https://www.example.com'].sort());
|
||||
}, header_policy + ' -- test allowlist is [cross_origin, https://www.example.com]');
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Test that fullscreen's allowlist is []
|
||||
test(function() {
|
||||
assert_array_equals(
|
||||
document.policy.getAllowlistForFeature('fullscreen'),
|
||||
document.featurePolicy.getAllowlistForFeature('fullscreen'),
|
||||
[]);
|
||||
}, header_policy + ' -- test allowlist is []');
|
||||
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
'use strict';
|
||||
|
||||
window.onload = function() {
|
||||
parent.postMessage(document.policy.allowedFeatures(), '*');
|
||||
parent.postMessage(document.featurePolicy.allowedFeatures(), '*');
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Feature test to avoid timeouts
|
||||
function assert_feature_policy_supported() {
|
||||
assert_not_equals(document.policy, undefined, 'Feature Policy is supported');
|
||||
assert_not_equals(document.featurePolicy, undefined,
|
||||
'Feature Policy is supported');
|
||||
}
|
||||
// Tests whether a feature that is enabled/disabled by feature policy works
|
||||
// as expected.
|
||||
|
@ -257,7 +258,8 @@ function run_all_fp_tests_allow_all(
|
|||
// Arguments:
|
||||
// expected_policy: A list of {feature, allowlist} pairs where the feature is
|
||||
// enabled for every origin in the allowlist, in the |policy|.
|
||||
// policy: Either a document.policy or a iframe.policy to be tested.
|
||||
// policy: Either a document.featurePolicy or an iframe.featurePolicy to be
|
||||
// tested.
|
||||
// message: A short description of what policy is being tested.
|
||||
function test_allowlists(expected_policy, policy, message) {
|
||||
for (var allowlist of allowlists) {
|
||||
|
@ -409,7 +411,7 @@ function test_frame_policy(
|
|||
document.body.appendChild(frame);
|
||||
// frame_policy should be dynamically updated as allow and allowfullscreen is
|
||||
// updated.
|
||||
var frame_policy = frame.policy;
|
||||
var frame_policy = frame.featurePolicy;
|
||||
if (typeof allow !== 'undefined') {
|
||||
frame.setAttribute('allow', allow);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue