From 2a3575908301235d141261fa9546936fbf3bcc2f Mon Sep 17 00:00:00 2001 From: Maggie Cai Date: Mon, 9 Mar 2020 21:45:39 +0000 Subject: [PATCH] Bug 1620896 [wpt PR 22132] - Revert "Origin policy: implement window.originPolicyIds", a=testonly Automatic update from web-platform-tests Revert "Origin policy: implement window.originPolicyIds" This reverts commit 10bfb977d51a0e7885bf9f3dfd4270f139fd3eeb. Reason for revert: This CL seems cause build failure since https://ci.chromium.org/p/chromium/builders/ci/WebKit%20Linux%20MSAN/4651 Original change's description: > Origin policy: implement window.originPolicyIds > > This plumbs the origin policy IDs from the net-side OriginPolicyContents > through to the renderer, where they get exposed on Window. This does not > yet tackle WorkerGlobalScope, but it does add idlharness tests for it, > which fail for now. > > Bug: 1057123 > Change-Id: Ie611f03bab99ccdaa6221733d9305cf2323a129e > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089994 > Commit-Queue: Domenic Denicola > Reviewed-by: Daniel Cheng > Reviewed-by: James MacLean > Cr-Commit-Position: refs/heads/master@{#747893} TBR=dcheng@chromium.org,domenic@chromium.org,wjmaclean@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 1057123 Change-Id: I341fd06c5587bc05ea110307251ad9eb19365433 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2093453 Reviewed-by: Maggie Cai Commit-Queue: Maggie Cai Cr-Commit-Position: refs/heads/master@{#748110} -- wpt-commits: b10ddff4a774ac4400a3d9b6f283caf5e5cf7af6 wpt-pr: 22132 --- .../tests/origin-policy/idlharness.any.js | 17 ----------- .../ids/empty-ids-after-nonempty.https.html | 17 ----------- .../origin-policy/ids/empty-ids.https.html | 17 ----------- .../origin-policy/ids/mix-of-ids.https.html | 25 ----------------- .../tests/origin-policy/ids/no-ids.https.html | 17 ----------- .../origin-policy/ids/non-array-id.https.html | 17 ----------- .../ids/same-object-returned.https.html | 14 ---------- .../ids/still-present-in-http.html | 16 ----------- .../origin-policy/ids/two-ids.https.html | 20 ------------- .../origin-policy/policies/op11 no-ids.json | 7 ----- .../policies/op12 empty-ids.json | 8 ------ .../op13 empty-ids-after-nonempty.json | 11 -------- .../policies/op14 non-array-id.json | 8 ------ .../policies/op15 mix-of-ids.json | 28 ------------------- .../origin-policy/policies/op16 two-ids.json | 16 ----------- .../resources/origin-policy-test-runner.js | 4 +-- .../resources/subframe-with-origin-policy.py | 15 +--------- 17 files changed, 2 insertions(+), 255 deletions(-) delete mode 100644 testing/web-platform/tests/origin-policy/idlharness.any.js delete mode 100644 testing/web-platform/tests/origin-policy/ids/empty-ids-after-nonempty.https.html delete mode 100644 testing/web-platform/tests/origin-policy/ids/empty-ids.https.html delete mode 100644 testing/web-platform/tests/origin-policy/ids/mix-of-ids.https.html delete mode 100644 testing/web-platform/tests/origin-policy/ids/no-ids.https.html delete mode 100644 testing/web-platform/tests/origin-policy/ids/non-array-id.https.html delete mode 100644 testing/web-platform/tests/origin-policy/ids/same-object-returned.https.html delete mode 100644 testing/web-platform/tests/origin-policy/ids/still-present-in-http.html delete mode 100644 testing/web-platform/tests/origin-policy/ids/two-ids.https.html delete mode 100644 testing/web-platform/tests/origin-policy/policies/op11 no-ids.json delete mode 100644 testing/web-platform/tests/origin-policy/policies/op12 empty-ids.json delete mode 100644 testing/web-platform/tests/origin-policy/policies/op13 empty-ids-after-nonempty.json delete mode 100644 testing/web-platform/tests/origin-policy/policies/op14 non-array-id.json delete mode 100644 testing/web-platform/tests/origin-policy/policies/op15 mix-of-ids.json delete mode 100644 testing/web-platform/tests/origin-policy/policies/op16 two-ids.json diff --git a/testing/web-platform/tests/origin-policy/idlharness.any.js b/testing/web-platform/tests/origin-policy/idlharness.any.js deleted file mode 100644 index c8ee8a326d13..000000000000 --- a/testing/web-platform/tests/origin-policy/idlharness.any.js +++ /dev/null @@ -1,17 +0,0 @@ -// META: global=window,worker -// META: script=/resources/WebIDLParser.js -// META: script=/resources/idlharness.js - -'use strict'; - -idl_test( - ['origin-policy'], - ['html', 'dom'], - idl_array => { - if (self.Window) { - idl_array.add_objects({ Window: ['self'] }); - } else { - idl_array.add_objects({ WorkerGlobalScope: ['self'] }); - } - } -); diff --git a/testing/web-platform/tests/origin-policy/ids/empty-ids-after-nonempty.https.html b/testing/web-platform/tests/origin-policy/ids/empty-ids-after-nonempty.https.html deleted file mode 100644 index 3bffa9cffa71..000000000000 --- a/testing/web-platform/tests/origin-policy/ids/empty-ids-after-nonempty.https.html +++ /dev/null @@ -1,17 +0,0 @@ - - -Origin policy with empty-array "ids" member that occurs after a non-empty "ids" member must be ignored - - - - -
- - diff --git a/testing/web-platform/tests/origin-policy/ids/empty-ids.https.html b/testing/web-platform/tests/origin-policy/ids/empty-ids.https.html deleted file mode 100644 index 385aa7c66fe6..000000000000 --- a/testing/web-platform/tests/origin-policy/ids/empty-ids.https.html +++ /dev/null @@ -1,17 +0,0 @@ - - -Origin policy with empty-array "ids" member must be ignored - - - - -
- - diff --git a/testing/web-platform/tests/origin-policy/ids/mix-of-ids.https.html b/testing/web-platform/tests/origin-policy/ids/mix-of-ids.https.html deleted file mode 100644 index 7be2c9f48df9..000000000000 --- a/testing/web-platform/tests/origin-policy/ids/mix-of-ids.https.html +++ /dev/null @@ -1,25 +0,0 @@ - - -Origin policy must include valid IDs and exclude non-strings and invalid strings - - - - -
- - diff --git a/testing/web-platform/tests/origin-policy/ids/no-ids.https.html b/testing/web-platform/tests/origin-policy/ids/no-ids.https.html deleted file mode 100644 index 1fe3d480d0ac..000000000000 --- a/testing/web-platform/tests/origin-policy/ids/no-ids.https.html +++ /dev/null @@ -1,17 +0,0 @@ - - -Origin policy with no "ids" member must be ignored - - - - -
- - diff --git a/testing/web-platform/tests/origin-policy/ids/non-array-id.https.html b/testing/web-platform/tests/origin-policy/ids/non-array-id.https.html deleted file mode 100644 index 223b78f929c1..000000000000 --- a/testing/web-platform/tests/origin-policy/ids/non-array-id.https.html +++ /dev/null @@ -1,17 +0,0 @@ - - -Origin policy a non-array "ids" member must be ignored - - - - -
- - diff --git a/testing/web-platform/tests/origin-policy/ids/same-object-returned.https.html b/testing/web-platform/tests/origin-policy/ids/same-object-returned.https.html deleted file mode 100644 index 9286f9f73448..000000000000 --- a/testing/web-platform/tests/origin-policy/ids/same-object-returned.https.html +++ /dev/null @@ -1,14 +0,0 @@ - - -originPolicyIds must return the same object each time - - - - diff --git a/testing/web-platform/tests/origin-policy/ids/still-present-in-http.html b/testing/web-platform/tests/origin-policy/ids/still-present-in-http.html deleted file mode 100644 index 01969450f92a..000000000000 --- a/testing/web-platform/tests/origin-policy/ids/still-present-in-http.html +++ /dev/null @@ -1,16 +0,0 @@ - - -originPolicyIds must return an empty array in http: pages - - - - diff --git a/testing/web-platform/tests/origin-policy/ids/two-ids.https.html b/testing/web-platform/tests/origin-policy/ids/two-ids.https.html deleted file mode 100644 index 630f07280790..000000000000 --- a/testing/web-platform/tests/origin-policy/ids/two-ids.https.html +++ /dev/null @@ -1,20 +0,0 @@ - - -Origin policy second "ids" member must take precedence - - - - -
- - diff --git a/testing/web-platform/tests/origin-policy/policies/op11 no-ids.json b/testing/web-platform/tests/origin-policy/policies/op11 no-ids.json deleted file mode 100644 index 0f3907bb3e61..000000000000 --- a/testing/web-platform/tests/origin-policy/policies/op11 no-ids.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "content_security": { - "policies": [ - "script-src 'self' 'unsafe-inline'" - ] - } -} diff --git a/testing/web-platform/tests/origin-policy/policies/op12 empty-ids.json b/testing/web-platform/tests/origin-policy/policies/op12 empty-ids.json deleted file mode 100644 index e5c31d2561c1..000000000000 --- a/testing/web-platform/tests/origin-policy/policies/op12 empty-ids.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "ids": [], - "content_security": { - "policies": [ - "script-src 'self' 'unsafe-inline'" - ] - } -} diff --git a/testing/web-platform/tests/origin-policy/policies/op13 empty-ids-after-nonempty.json b/testing/web-platform/tests/origin-policy/policies/op13 empty-ids-after-nonempty.json deleted file mode 100644 index 773772457448..000000000000 --- a/testing/web-platform/tests/origin-policy/policies/op13 empty-ids-after-nonempty.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "ids": [ - "this should be overwritten by the subsequent one" - ], - "ids": [], - "content_security": { - "policies": [ - "script-src 'self' 'unsafe-inline'" - ] - } -} diff --git a/testing/web-platform/tests/origin-policy/policies/op14 non-array-id.json b/testing/web-platform/tests/origin-policy/policies/op14 non-array-id.json deleted file mode 100644 index bc7cf74fbaa7..000000000000 --- a/testing/web-platform/tests/origin-policy/policies/op14 non-array-id.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "ids": "this is not an array", - "content_security": { - "policies": [ - "script-src 'self' 'unsafe-inline'" - ] - } -} diff --git a/testing/web-platform/tests/origin-policy/policies/op15 mix-of-ids.json b/testing/web-platform/tests/origin-policy/policies/op15 mix-of-ids.json deleted file mode 100644 index b49637dbd5c6..000000000000 --- a/testing/web-platform/tests/origin-policy/policies/op15 mix-of-ids.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "ids": [ - "my-policy-1", - ["my-policy-array"], - 5, - null, - { "id": "my-policy-object" }, - "my-policy-2", - true, - "~", - " ", - "\u0000", - "\t", - "my\tpolicy", - "!\"#$%&'()*+,-./:;<=>?@{|}~", - "my\u007Fpolicy", - "azAZ", - "my\u0080policy", - "my~policy", - "my\u1234policy" - ], - "content_security": { - "policies": [ - "script-src 'self' 'unsafe-inline'", - "img-src 'none'" - ] - } -} diff --git a/testing/web-platform/tests/origin-policy/policies/op16 two-ids.json b/testing/web-platform/tests/origin-policy/policies/op16 two-ids.json deleted file mode 100644 index 7a7d8398aa1b..000000000000 --- a/testing/web-platform/tests/origin-policy/policies/op16 two-ids.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "ids": [ - "1", - "2" - ], - "ids": [ - "3", - "4" - ], - "content_security": { - "policies": [ - "script-src 'self' 'unsafe-inline'", - "img-src 'none'" - ] - } -} diff --git a/testing/web-platform/tests/origin-policy/resources/origin-policy-test-runner.js b/testing/web-platform/tests/origin-policy/resources/origin-policy-test-runner.js index d3fd2e4ce11a..a1c6453debd2 100644 --- a/testing/web-platform/tests/origin-policy/resources/origin-policy-test-runner.js +++ b/testing/web-platform/tests/origin-policy/resources/origin-policy-test-runner.js @@ -1,4 +1,4 @@ -window.runTestsInSubframe = ({ hostname, testJS, expectedIds }) => { +window.runTestsInSubframe = ({ hostname, testJS }) => { test(() => { assert_equals(location.protocol, "https:"); }, "Prerequisite check: running on HTTPS"); @@ -12,8 +12,6 @@ window.runTestsInSubframe = ({ hostname, testJS, expectedIds }) => { // to themselves. url.searchParams.append("test", new URL(testJS, document.baseURI).pathname); - url.searchParams.append("expectedIds", JSON.stringify(expectedIds)); - const iframe = document.createElement("iframe"); iframe.src = url.href; diff --git a/testing/web-platform/tests/origin-policy/resources/subframe-with-origin-policy.py b/testing/web-platform/tests/origin-policy/resources/subframe-with-origin-policy.py index 258f23754ef7..636a649a0e20 100644 --- a/testing/web-platform/tests/origin-policy/resources/subframe-with-origin-policy.py +++ b/testing/web-platform/tests/origin-policy/resources/subframe-with-origin-policy.py @@ -9,12 +9,10 @@ def main(request, response): """ test_file = request.GET.first("test") - expected_ids = request.GET.first("expectedIds") - response.headers.set("Origin-Policy", "allowed=(latest)") response.headers.set("Content-Type", "text/html") - ret_val = """ + return """ Origin policy subframe @@ -26,14 +24,3 @@ def main(request, response): """ % test_file - - if expected_ids != "undefined": - ret_val += """ - - """ % expected_ids - - return ret_val