Skip to content

Commit

Permalink
Bug 1459006 [wpt PR 10827] - Implement FeaturePolicy sync-script (as …
Browse files Browse the repository at this point in the history
…an experimental feature policy), a=testonly

Automatic update from web-platform-testsImplement FeaturePolicy sync-script (as an experimental feature policy)

Spec discussion: https://github.com/WICG/feature-policy/issues/135
Intent to implement: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/b7f_K30MBYo

Bug: 862422
Change-Id: Icd8a5d747373a819c7073ac459b5e8823d7986a8
Reviewed-on: https://chromium-review.googlesource.com/894137
Reviewed-by: Ojan Vafai <ojan@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Commit-Queue: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576652}

--

wpt-commits: 0cc3831f4c19152ec28b4a1fa600baace321c775
wpt-pr: 10827
  • Loading branch information
natechapin authored and jgraham committed Jul 29, 2018
1 parent 289ef2c commit 4e2376c
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 0 deletions.
55 changes: 55 additions & 0 deletions testing/web-platform/meta/MANIFEST.json
Original file line number Diff line number Diff line change
Expand Up @@ -275207,11 +275207,21 @@
{}
]
],
"feature-policy/experimental-features/resources/async-script.js": [
[
{}
]
],
"feature-policy/experimental-features/resources/common.js": [
[
{}
]
],
"feature-policy/experimental-features/resources/defer-script.js": [
[
{}
]
],
"feature-policy/experimental-features/resources/document-write.html": [
[
{}
Expand All @@ -275237,6 +275247,16 @@
{}
]
],
"feature-policy/experimental-features/resources/parser-blocking-script.js": [
[
{}
]
],
"feature-policy/experimental-features/resources/sync-script-test.js": [
[
{}
]
],
"feature-policy/experimental-features/resources/vertical-scroll-scrollintoview.html": [
[
{}
Expand Down Expand Up @@ -275267,6 +275287,11 @@
{}
]
],
"feature-policy/experimental-features/sync-script.tentative.https.sub.html.headers": [
[
{}
]
],
"feature-policy/experimental-features/unsized-image.tentative.https.sub.html.headers": [
[
{}
Expand Down Expand Up @@ -338148,6 +338173,12 @@
{}
]
],
"feature-policy/experimental-features/sync-script.tentative.https.sub.html": [
[
"/feature-policy/experimental-features/sync-script.tentative.https.sub.html",
{}
]
],
"feature-policy/experimental-features/unsized-image.tentative.https.sub.html": [
[
"/feature-policy/experimental-features/unsized-image.tentative.https.sub.html",
Expand Down Expand Up @@ -570829,10 +570860,18 @@
"c91dfd7dd6d0f18e3a5d224823676f623f9dd426",
"testharness"
],
"feature-policy/experimental-features/resources/async-script.js": [
"2c4a6fbbaec1f46e4f22a8f07f9601c498b6c4b7",
"support"
],
"feature-policy/experimental-features/resources/common.js": [
"36dd671a85ed93f2e69927c843243cb953f82a97",
"support"
],
"feature-policy/experimental-features/resources/defer-script.js": [
"5084a464bf3da0a8ffd2c92ce5a1b49c66210c75",
"support"
],
"feature-policy/experimental-features/resources/document-write.html": [
"a0e39689056dc5cc24ad2d7e6fb2c681e84fd35d",
"support"
Expand All @@ -570853,6 +570892,14 @@
"39f716f4bc22283fc444ea0b3a807ae426e2aadf",
"support"
],
"feature-policy/experimental-features/resources/parser-blocking-script.js": [
"833b1492f3558f16486bfe88670a180657b08a4d",
"support"
],
"feature-policy/experimental-features/resources/sync-script-test.js": [
"432e7f767cccc0254385b2345cbfd1eca57138dc",
"support"
],
"feature-policy/experimental-features/resources/vertical-scroll-scrollintoview.html": [
"7be60c6f51698ea1e63030bf94aad995881e0049",
"support"
Expand All @@ -570877,6 +570924,14 @@
"7c6d80135c0688eb5ef5e79351c8ebbd24cb7d77",
"support"
],
"feature-policy/experimental-features/sync-script.tentative.https.sub.html": [
"eb102d262fd4c9a1c600beb6bba79e5b4c055d64",
"testharness"
],
"feature-policy/experimental-features/sync-script.tentative.https.sub.html.headers": [
"28b3d20a2ee88ab7771fc2ea671dd139182f5182",
"support"
],
"feature-policy/experimental-features/unsized-image.tentative.https.sub.html": [
"ac063a3e3084a9416a272bbac413016124e5289f",
"testharness"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
window.didExecuteExternalAsyncScript = true;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
window.didExecuteExternalDeferredScript = true;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
window.didExecuteExternalParsingBlockingScript = true;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var t = async_test('Test behavior of sync-script feature policy for different script types');

window.onload = t.step_func(function() {
assert_equals(undefined, window.didExecuteInlineParsingBlockingScript, 'inline parser blocking script should be blocked');
assert_equals(undefined, window.didExecuteExternalParsingBlockingScript, 'external parser blocking script should be blocked');
assert_true(window.didExecuteExternalAsyncScript, 'external async script should not be blocked');
assert_true(window.didExecuteExternalDeferredScript, 'external defer script should not be blocked');
t.done();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<body>
<script defer src="/resources/testharness.js"></script>
<script defer src="/resources/testharnessreport.js"></script>
<script>
// The test harness scripts above are loaded as <script defer> because
// they would be blocked if loaded synchronously.
// Harness scripts should be evaluated before sync-script-test.js, so it
// is also loaded as <script defer>
//
// The other scripts (both inline and external) are testing whether those
// scripts are blocked or not.
// sync-script-test.js asserts the results of the other scripts in onload
// in order to guarantee that all scripts have either loaded or been blocked
// before verifying the behavior.
window.didExecuteInlineParsingBlockingScript = true;
</script>
<script src="/feature-policy/experimental-features/resources/parser-blocking-script.js"></script>
<script async src="/feature-policy/experimental-features/resources/async-script.js"></script>
<script defer src="/feature-policy/experimental-features/resources/defer-script.js"></script>
<script defer src="/feature-policy/experimental-features/resources/sync-script-test.js"></script>
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Feature-Policy: sync-script 'none'

0 comments on commit 4e2376c

Please sign in to comment.