Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 28cbc22

Browse files
hiroshige-gfoolip
authored andcommitted
[WPT/referrer-policy] Add worker subresource tests
This CL adds tests of subresources sent from worker global scope, including XHR/Fetch API inside workers and nested workers. The tests are failing on Safari and Firefox, largely because of differences of referrer policy inheritance rule (which is a spec-level issue). Bug: 906850 Change-Id: Ia385d72918df5d4318c7fc58306bfc614a3bd4b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1785499 Commit-Queue: Hiroshige Hayashizaki <[email protected]> Reviewed-by: Hiroki Nakagawa <[email protected]> Reviewed-by: Kenichi Ishibashi <[email protected]> Cr-Commit-Position: refs/heads/master@{#702280}
1 parent c0a3f7e commit 28cbc22

File tree

496 files changed

+22480
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

496 files changed

+22480
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using common/security-features/tools/template/test.release.html.template. -->
3+
<html>
4+
<head>
5+
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
6+
<meta charset='utf-8'>
7+
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
8+
<link rel="author" title="Kristijan Burnik" href="[email protected]">
9+
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
10+
<meta name="assert" content="Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and keep-origin redirection from http context.">
11+
<meta name="referrer" content="no-referrer">
12+
<script src="/resources/testharness.js"></script>
13+
<script src="/resources/testharnessreport.js"></script>
14+
<script src="/common/security-features/resources/common.sub.js"></script>
15+
<script src="/referrer-policy/generic/test-case.sub.js"></script>
16+
</head>
17+
<body>
18+
<script>
19+
TestCase(
20+
{
21+
"expectation": "stripped-referrer",
22+
"origin": "cross-http",
23+
"redirection": "keep-origin",
24+
"source_context_list": [
25+
{
26+
"policyDeliveries": [
27+
{
28+
"deliveryType": "http-rp",
29+
"key": "referrerPolicy",
30+
"value": "no-referrer-when-downgrade"
31+
}
32+
],
33+
"sourceContextType": "worker-classic"
34+
}
35+
],
36+
"source_scheme": "http",
37+
"subresource": "fetch",
38+
"subresource_policy_deliveries": []
39+
},
40+
document.querySelector("meta[name=assert]").content,
41+
new SanityChecker()
42+
).start();
43+
</script>
44+
<div id="log"></div>
45+
</body>
46+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using common/security-features/tools/template/test.release.html.template. -->
3+
<html>
4+
<head>
5+
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
6+
<meta charset='utf-8'>
7+
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
8+
<link rel="author" title="Kristijan Burnik" href="[email protected]">
9+
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
10+
<meta name="assert" content="Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and no-redirect redirection from http context.">
11+
<meta name="referrer" content="no-referrer">
12+
<script src="/resources/testharness.js"></script>
13+
<script src="/resources/testharnessreport.js"></script>
14+
<script src="/common/security-features/resources/common.sub.js"></script>
15+
<script src="/referrer-policy/generic/test-case.sub.js"></script>
16+
</head>
17+
<body>
18+
<script>
19+
TestCase(
20+
{
21+
"expectation": "stripped-referrer",
22+
"origin": "cross-http",
23+
"redirection": "no-redirect",
24+
"source_context_list": [
25+
{
26+
"policyDeliveries": [
27+
{
28+
"deliveryType": "http-rp",
29+
"key": "referrerPolicy",
30+
"value": "no-referrer-when-downgrade"
31+
}
32+
],
33+
"sourceContextType": "worker-classic"
34+
}
35+
],
36+
"source_scheme": "http",
37+
"subresource": "fetch",
38+
"subresource_policy_deliveries": []
39+
},
40+
document.querySelector("meta[name=assert]").content,
41+
new SanityChecker()
42+
).start();
43+
</script>
44+
<div id="log"></div>
45+
</body>
46+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using common/security-features/tools/template/test.release.html.template. -->
3+
<html>
4+
<head>
5+
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
6+
<meta charset='utf-8'>
7+
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
8+
<link rel="author" title="Kristijan Burnik" href="[email protected]">
9+
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
10+
<meta name="assert" content="Referrer Policy: Expects stripped-referrer for fetch to cross-http origin and swap-origin redirection from http context.">
11+
<meta name="referrer" content="no-referrer">
12+
<script src="/resources/testharness.js"></script>
13+
<script src="/resources/testharnessreport.js"></script>
14+
<script src="/common/security-features/resources/common.sub.js"></script>
15+
<script src="/referrer-policy/generic/test-case.sub.js"></script>
16+
</head>
17+
<body>
18+
<script>
19+
TestCase(
20+
{
21+
"expectation": "stripped-referrer",
22+
"origin": "cross-http",
23+
"redirection": "swap-origin",
24+
"source_context_list": [
25+
{
26+
"policyDeliveries": [
27+
{
28+
"deliveryType": "http-rp",
29+
"key": "referrerPolicy",
30+
"value": "no-referrer-when-downgrade"
31+
}
32+
],
33+
"sourceContextType": "worker-classic"
34+
}
35+
],
36+
"source_scheme": "http",
37+
"subresource": "fetch",
38+
"subresource_policy_deliveries": []
39+
},
40+
document.querySelector("meta[name=assert]").content,
41+
new SanityChecker()
42+
).start();
43+
</script>
44+
<div id="log"></div>
45+
</body>
46+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using common/security-features/tools/template/test.release.html.template. -->
3+
<html>
4+
<head>
5+
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
6+
<meta charset='utf-8'>
7+
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
8+
<link rel="author" title="Kristijan Burnik" href="[email protected]">
9+
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
10+
<meta name="assert" content="Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and keep-origin redirection from http context.">
11+
<meta name="referrer" content="no-referrer">
12+
<script src="/resources/testharness.js"></script>
13+
<script src="/resources/testharnessreport.js"></script>
14+
<script src="/common/security-features/resources/common.sub.js"></script>
15+
<script src="/referrer-policy/generic/test-case.sub.js"></script>
16+
</head>
17+
<body>
18+
<script>
19+
TestCase(
20+
{
21+
"expectation": "stripped-referrer",
22+
"origin": "cross-https",
23+
"redirection": "keep-origin",
24+
"source_context_list": [
25+
{
26+
"policyDeliveries": [
27+
{
28+
"deliveryType": "http-rp",
29+
"key": "referrerPolicy",
30+
"value": "no-referrer-when-downgrade"
31+
}
32+
],
33+
"sourceContextType": "worker-classic"
34+
}
35+
],
36+
"source_scheme": "http",
37+
"subresource": "fetch",
38+
"subresource_policy_deliveries": []
39+
},
40+
document.querySelector("meta[name=assert]").content,
41+
new SanityChecker()
42+
).start();
43+
</script>
44+
<div id="log"></div>
45+
</body>
46+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using common/security-features/tools/template/test.release.html.template. -->
3+
<html>
4+
<head>
5+
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
6+
<meta charset='utf-8'>
7+
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
8+
<link rel="author" title="Kristijan Burnik" href="[email protected]">
9+
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
10+
<meta name="assert" content="Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and no-redirect redirection from http context.">
11+
<meta name="referrer" content="no-referrer">
12+
<script src="/resources/testharness.js"></script>
13+
<script src="/resources/testharnessreport.js"></script>
14+
<script src="/common/security-features/resources/common.sub.js"></script>
15+
<script src="/referrer-policy/generic/test-case.sub.js"></script>
16+
</head>
17+
<body>
18+
<script>
19+
TestCase(
20+
{
21+
"expectation": "stripped-referrer",
22+
"origin": "cross-https",
23+
"redirection": "no-redirect",
24+
"source_context_list": [
25+
{
26+
"policyDeliveries": [
27+
{
28+
"deliveryType": "http-rp",
29+
"key": "referrerPolicy",
30+
"value": "no-referrer-when-downgrade"
31+
}
32+
],
33+
"sourceContextType": "worker-classic"
34+
}
35+
],
36+
"source_scheme": "http",
37+
"subresource": "fetch",
38+
"subresource_policy_deliveries": []
39+
},
40+
document.querySelector("meta[name=assert]").content,
41+
new SanityChecker()
42+
).start();
43+
</script>
44+
<div id="log"></div>
45+
</body>
46+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using common/security-features/tools/template/test.release.html.template. -->
3+
<html>
4+
<head>
5+
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
6+
<meta charset='utf-8'>
7+
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
8+
<link rel="author" title="Kristijan Burnik" href="[email protected]">
9+
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
10+
<meta name="assert" content="Referrer Policy: Expects stripped-referrer for fetch to cross-https origin and swap-origin redirection from http context.">
11+
<meta name="referrer" content="no-referrer">
12+
<script src="/resources/testharness.js"></script>
13+
<script src="/resources/testharnessreport.js"></script>
14+
<script src="/common/security-features/resources/common.sub.js"></script>
15+
<script src="/referrer-policy/generic/test-case.sub.js"></script>
16+
</head>
17+
<body>
18+
<script>
19+
TestCase(
20+
{
21+
"expectation": "stripped-referrer",
22+
"origin": "cross-https",
23+
"redirection": "swap-origin",
24+
"source_context_list": [
25+
{
26+
"policyDeliveries": [
27+
{
28+
"deliveryType": "http-rp",
29+
"key": "referrerPolicy",
30+
"value": "no-referrer-when-downgrade"
31+
}
32+
],
33+
"sourceContextType": "worker-classic"
34+
}
35+
],
36+
"source_scheme": "http",
37+
"subresource": "fetch",
38+
"subresource_policy_deliveries": []
39+
},
40+
document.querySelector("meta[name=assert]").content,
41+
new SanityChecker()
42+
).start();
43+
</script>
44+
<div id="log"></div>
45+
</body>
46+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using common/security-features/tools/template/test.release.html.template. -->
3+
<html>
4+
<head>
5+
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
6+
<meta charset='utf-8'>
7+
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
8+
<link rel="author" title="Kristijan Burnik" href="[email protected]">
9+
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
10+
<meta name="assert" content="Referrer Policy: Expects stripped-referrer for fetch to same-http origin and keep-origin redirection from http context.">
11+
<meta name="referrer" content="no-referrer">
12+
<script src="/resources/testharness.js"></script>
13+
<script src="/resources/testharnessreport.js"></script>
14+
<script src="/common/security-features/resources/common.sub.js"></script>
15+
<script src="/referrer-policy/generic/test-case.sub.js"></script>
16+
</head>
17+
<body>
18+
<script>
19+
TestCase(
20+
{
21+
"expectation": "stripped-referrer",
22+
"origin": "same-http",
23+
"redirection": "keep-origin",
24+
"source_context_list": [
25+
{
26+
"policyDeliveries": [
27+
{
28+
"deliveryType": "http-rp",
29+
"key": "referrerPolicy",
30+
"value": "no-referrer-when-downgrade"
31+
}
32+
],
33+
"sourceContextType": "worker-classic"
34+
}
35+
],
36+
"source_scheme": "http",
37+
"subresource": "fetch",
38+
"subresource_policy_deliveries": []
39+
},
40+
document.querySelector("meta[name=assert]").content,
41+
new SanityChecker()
42+
).start();
43+
</script>
44+
<div id="log"></div>
45+
</body>
46+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<!-- DO NOT EDIT! Generated by referrer-policy/generic/tools/generate.py using common/security-features/tools/template/test.release.html.template. -->
3+
<html>
4+
<head>
5+
<title>Referrer-Policy: Referrer Policy is set to 'no-referrer-when-downgrade'</title>
6+
<meta charset='utf-8'>
7+
<meta name="description" content="Check that non a priori insecure subresource gets the full Referrer URL. A priori insecure subresource gets no referrer information.">
8+
<link rel="author" title="Kristijan Burnik" href="[email protected]">
9+
<link rel="help" href="https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-no-referrer-when-downgrade">
10+
<meta name="assert" content="Referrer Policy: Expects stripped-referrer for fetch to same-http origin and no-redirect redirection from http context.">
11+
<meta name="referrer" content="no-referrer">
12+
<script src="/resources/testharness.js"></script>
13+
<script src="/resources/testharnessreport.js"></script>
14+
<script src="/common/security-features/resources/common.sub.js"></script>
15+
<script src="/referrer-policy/generic/test-case.sub.js"></script>
16+
</head>
17+
<body>
18+
<script>
19+
TestCase(
20+
{
21+
"expectation": "stripped-referrer",
22+
"origin": "same-http",
23+
"redirection": "no-redirect",
24+
"source_context_list": [
25+
{
26+
"policyDeliveries": [
27+
{
28+
"deliveryType": "http-rp",
29+
"key": "referrerPolicy",
30+
"value": "no-referrer-when-downgrade"
31+
}
32+
],
33+
"sourceContextType": "worker-classic"
34+
}
35+
],
36+
"source_scheme": "http",
37+
"subresource": "fetch",
38+
"subresource_policy_deliveries": []
39+
},
40+
document.querySelector("meta[name=assert]").content,
41+
new SanityChecker()
42+
).start();
43+
</script>
44+
<div id="log"></div>
45+
</body>
46+
</html>

0 commit comments

Comments
 (0)