Bug 1465758 [wpt PR 11270] - Fail early if Feature Policy is not supported, a=testonly

Automatic update from web-platform-testsFail early if Feature Policy is not supported (#11270)

Part of #11269.
--

wpt-commits: 73f8f236d53c825f4ed2fbe6379ce04a56e7a865
wpt-pr: 11270
This commit is contained in:
Simon Pieters 2018-07-06 16:43:48 +00:00 коммит произвёл James Graham
Родитель c9b903546d
Коммит 71d7f34a87
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -567077,7 +567077,7 @@
"support"
],
"feature-policy/resources/featurepolicy.js": [
"a95ee6fc23217f5fc271763f5363a09b0ff04537",
"e43c54ef8b92deb077f9061681a83261552ef2ef",
"support"
],
"feature-policy/resources/picture-in-picture.js": [

Просмотреть файл

@ -1,3 +1,7 @@
// Feature test to avoid timeouts
function assert_feature_policy_supported() {
assert_not_equals(document.policy, undefined, 'Feature Policy is supported');
}
// Tests whether a feature that is enabled/disabled by feature policy works
// as expected.
// Arguments:
@ -279,6 +283,7 @@ function test_allowed_feature_for_subframe(message, feature, src, allow) {
frame.allow = allow;
}
promise_test(function() {
assert_feature_policy_supported();
frame.src = src;
return new Promise(function(resolve, reject) {
window.addEventListener('message', function handler(evt) {
@ -305,6 +310,7 @@ function test_disallowed_feature_for_subframe(message, feature, src, allow) {
frame.allow = allow;
}
promise_test(function() {
assert_feature_policy_supported();
frame.src = src;
return new Promise(function(resolve, reject) {
window.addEventListener('message', function handler(evt) {
@ -333,6 +339,7 @@ function test_subframe_header_policy(
feature, frame_header_policy, src, test_expects, test_name) {
let frame = document.createElement('iframe');
promise_test(function() {
assert_feature_policy_supported()
frame.src = src + '?pipe=sub|header(Feature-Policy,' + feature + ' '
+ frame_header_policy + ';)';
return new Promise(function(resolve, reject) {