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 <domenic@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Reviewed-by: James MacLean <wjmaclean@chromium.org>
> 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 <mxcai@chromium.org>
Commit-Queue: Maggie Cai <mxcai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748110}

--

wpt-commits: b10ddff4a774ac4400a3d9b6f283caf5e5cf7af6
wpt-pr: 22132
This commit is contained in:
Maggie Cai 2020-03-09 21:45:39 +00:00 коммит произвёл moz-wptsync-bot
Родитель fcbd2a2570
Коммит 2a35759083
17 изменённых файлов: 2 добавлений и 255 удалений

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

@ -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'] });
}
}
);

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

@ -1,17 +0,0 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>Origin policy with empty-array "ids" member that occurs after a non-empty "ids" member must be ignored</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/origin-policy-test-runner.js"></script>
<div id="log"></div>
<script>
"use strict";
runTestsInSubframe({
hostname: "op13",
testJS: "../content-security/resources/allow-unsafe-eval.mjs",
expectedIds: []
});
</script>

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

@ -1,17 +0,0 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>Origin policy with empty-array "ids" member must be ignored</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/origin-policy-test-runner.js"></script>
<div id="log"></div>
<script>
"use strict";
runTestsInSubframe({
hostname: "op12",
testJS: "../content-security/resources/allow-unsafe-eval.mjs",
expectedIds: []
});
</script>

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

@ -1,25 +0,0 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>Origin policy must include valid IDs and exclude non-strings and invalid strings</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/origin-policy-test-runner.js"></script>
<div id="log"></div>
<script>
"use strict";
runTestsInSubframe({
hostname: "op15",
testJS: "../content-security/resources/disallow-unsafe-eval-disallow-images.mjs",
expectedIds: [
"my-policy-1",
"my-policy-2",
"~",
" ",
"!\"#$%&'()*+,-./:;<=>?@{|}~",
"azAZ",
"my~policy"
]
});
</script>

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

@ -1,17 +0,0 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>Origin policy with no "ids" member must be ignored</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/origin-policy-test-runner.js"></script>
<div id="log"></div>
<script>
"use strict";
runTestsInSubframe({
hostname: "op11",
testJS: "../content-security/resources/allow-unsafe-eval.mjs",
expectedIds: []
});
</script>

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

@ -1,17 +0,0 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>Origin policy a non-array "ids" member must be ignored</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/origin-policy-test-runner.js"></script>
<div id="log"></div>
<script>
"use strict";
runTestsInSubframe({
hostname: "op14",
testJS: "../content-security/resources/allow-unsafe-eval.mjs",
expectedIds: []
});
</script>

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

@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>originPolicyIds must return the same object each time</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
test(() => {
// Failing this test is a common failure mode for FrozenArray attributes,
// so let's be sure implementations get it right.
assert_equals(window.originPolicyIds, window.originPolicyIds);
});
</script>

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

@ -1,16 +0,0 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>originPolicyIds must return an empty array in http: pages</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
"use strict";
test(() => {
assert_equals(location.protocol, "http:");
}, "Prerequisite check: running on HTTP, not HTTPS");
test(() => {
assert_array_equals(window.originPolicyIds, []);
}, "The attribute is still present and returns an empty frozen array");
</script>

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

@ -1,20 +0,0 @@
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>Origin policy second "ids" member must take precedence</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/origin-policy-test-runner.js"></script>
<div id="log"></div>
<script>
"use strict";
runTestsInSubframe({
hostname: "op16",
testJS: "../content-security/resources/disallow-unsafe-eval-disallow-images.mjs",
expectedIds: [
"3",
"4"
]
});
</script>

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

@ -1,7 +0,0 @@
{
"content_security": {
"policies": [
"script-src 'self' 'unsafe-inline'"
]
}
}

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

@ -1,8 +0,0 @@
{
"ids": [],
"content_security": {
"policies": [
"script-src 'self' 'unsafe-inline'"
]
}
}

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

@ -1,11 +0,0 @@
{
"ids": [
"this should be overwritten by the subsequent one"
],
"ids": [],
"content_security": {
"policies": [
"script-src 'self' 'unsafe-inline'"
]
}
}

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

@ -1,8 +0,0 @@
{
"ids": "this is not an array",
"content_security": {
"policies": [
"script-src 'self' 'unsafe-inline'"
]
}
}

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

@ -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'"
]
}
}

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

@ -1,16 +0,0 @@
{
"ids": [
"1",
"2"
],
"ids": [
"3",
"4"
],
"content_security": {
"policies": [
"script-src 'self' 'unsafe-inline'",
"img-src 'none'"
]
}
}

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

@ -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;

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

@ -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 """
<!DOCTYPE html>
<meta charset="utf-8">
<title>Origin policy subframe</title>
@ -26,14 +24,3 @@ def main(request, response):
<script type="module" src="%s"></script>
""" % test_file
if expected_ids != "undefined":
ret_val += """
<script type="module">
test(() => {
assert_array_equals(originPolicyIds, %s);
}, "Expected originPolicyIDs check");
</script>
""" % expected_ids
return ret_val