From d01bdea19df21e0c09942685e0046082fabff5bf Mon Sep 17 00:00:00 2001
From: Marco Castelluccio
Date: Thu, 3 Oct 2019 04:33:14 +0000
Subject: [PATCH] Bug 1464525 [wpt PR 11171] - Cross-Origin-Resource-Policy
tests, a=testonly
Automatic update from web-platform-testsFetch: Cross-Origin-Resource-Policy tests
For https://github.com/whatwg/fetch/pull/733.
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=185840.
--
wpt-commits: 53f7340307c1c0fa4ab96e79d88c69a7870030f4
wpt-pr: 11171
UltraBlame original commit: 2d3d375085ab145c32c6a3de5589739a3a5ceaf0
---
testing/web-platform/meta/MANIFEST.json | 115 +++++++++++++++++-
.../tests/common/get-host-info.sub.js | 2 +
.../fetch-in-iframe.html | 67 ++++++++++
.../cross-origin-resource-policy/fetch.html | 83 +++++++++++++
.../iframe-loads.html | 46 +++++++
.../image-loads.html | 53 ++++++++
.../resources/green.png | Bin 0 -> 87 bytes
.../resources/hello.py | 6 +
.../resources/iframe.py | 5 +
.../resources/iframeFetch.html | 19 +++
.../resources/image.py | 21 ++++
.../resources/redirect.py | 6 +
.../resources/script.py | 6 +
.../script-loads.html | 51 ++++++++
14 files changed, 479 insertions(+), 1 deletion(-)
create mode 100644 testing/web-platform/tests/fetch/cross-origin-resource-policy/fetch-in-iframe.html
create mode 100644 testing/web-platform/tests/fetch/cross-origin-resource-policy/fetch.html
create mode 100644 testing/web-platform/tests/fetch/cross-origin-resource-policy/iframe-loads.html
create mode 100644 testing/web-platform/tests/fetch/cross-origin-resource-policy/image-loads.html
create mode 100644 testing/web-platform/tests/fetch/cross-origin-resource-policy/resources/green.png
create mode 100644 testing/web-platform/tests/fetch/cross-origin-resource-policy/resources/hello.py
create mode 100644 testing/web-platform/tests/fetch/cross-origin-resource-policy/resources/iframe.py
create mode 100644 testing/web-platform/tests/fetch/cross-origin-resource-policy/resources/iframeFetch.html
create mode 100644 testing/web-platform/tests/fetch/cross-origin-resource-policy/resources/image.py
create mode 100644 testing/web-platform/tests/fetch/cross-origin-resource-policy/resources/redirect.py
create mode 100644 testing/web-platform/tests/fetch/cross-origin-resource-policy/resources/script.py
create mode 100644 testing/web-platform/tests/fetch/cross-origin-resource-policy/script-loads.html
diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json
index f580b5892778d..b87755c1964c0 100644
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -274865,6 +274865,41 @@
{}
]
],
+ "fetch/cross-origin-resource-policy/resources/green.png": [
+ [
+ {}
+ ]
+ ],
+ "fetch/cross-origin-resource-policy/resources/hello.py": [
+ [
+ {}
+ ]
+ ],
+ "fetch/cross-origin-resource-policy/resources/iframe.py": [
+ [
+ {}
+ ]
+ ],
+ "fetch/cross-origin-resource-policy/resources/iframeFetch.html": [
+ [
+ {}
+ ]
+ ],
+ "fetch/cross-origin-resource-policy/resources/image.py": [
+ [
+ {}
+ ]
+ ],
+ "fetch/cross-origin-resource-policy/resources/redirect.py": [
+ [
+ {}
+ ]
+ ],
+ "fetch/cross-origin-resource-policy/resources/script.py": [
+ [
+ {}
+ ]
+ ],
"fetch/data-urls/README.md": [
[
{}
@@ -338884,6 +338919,36 @@
{}
]
],
+ "fetch/cross-origin-resource-policy/fetch-in-iframe.html": [
+ [
+ "/fetch/cross-origin-resource-policy/fetch-in-iframe.html",
+ {}
+ ]
+ ],
+ "fetch/cross-origin-resource-policy/fetch.html": [
+ [
+ "/fetch/cross-origin-resource-policy/fetch.html",
+ {}
+ ]
+ ],
+ "fetch/cross-origin-resource-policy/iframe-loads.html": [
+ [
+ "/fetch/cross-origin-resource-policy/iframe-loads.html",
+ {}
+ ]
+ ],
+ "fetch/cross-origin-resource-policy/image-loads.html": [
+ [
+ "/fetch/cross-origin-resource-policy/image-loads.html",
+ {}
+ ]
+ ],
+ "fetch/cross-origin-resource-policy/script-loads.html": [
+ [
+ "/fetch/cross-origin-resource-policy/script-loads.html",
+ {}
+ ]
+ ],
"fetch/data-urls/base64.any.js": [
[
"/fetch/data-urls/base64.any.html",
@@ -418318,7 +418383,7 @@
"support"
],
"common/get-host-info.sub.js": [
- "4175d0fff3555e25a646b0673a082fefdc113fe0",
+ "1eae4a7e29b73d60b9832ef5d8c808f6fd10db5c",
"support"
],
"common/get-host-info.sub.js.headers": [
@@ -569125,6 +569190,54 @@
"465d933f4e52ef4e5a4bd0de40873410195843cd",
"testharness"
],
+ "fetch/cross-origin-resource-policy/fetch-in-iframe.html": [
+ "4d836bed1e90a2d14b1651c0f3229b3f3d0b6b91",
+ "testharness"
+ ],
+ "fetch/cross-origin-resource-policy/fetch.html": [
+ "6a881615d9df0750b640298725be56e60cd5804c",
+ "testharness"
+ ],
+ "fetch/cross-origin-resource-policy/iframe-loads.html": [
+ "8429fdb1695fc73c853dc37bf29544b8139d5396",
+ "testharness"
+ ],
+ "fetch/cross-origin-resource-policy/image-loads.html": [
+ "6e81ede4b474b2516ec735d4d8f99694b4124773",
+ "testharness"
+ ],
+ "fetch/cross-origin-resource-policy/resources/green.png": [
+ "ef91d21307a12b2cfaf33a90dffe16aa1cba42c9",
+ "support"
+ ],
+ "fetch/cross-origin-resource-policy/resources/hello.py": [
+ "0d8e30350c97fd6a040b14348929cf7e87e0e406",
+ "support"
+ ],
+ "fetch/cross-origin-resource-policy/resources/iframe.py": [
+ "d8f4af86d37d2f257b4166a1f7d3001d55eeda69",
+ "support"
+ ],
+ "fetch/cross-origin-resource-policy/resources/iframeFetch.html": [
+ "d66a9c958288a97469e8cfa75eba973e9f35e190",
+ "support"
+ ],
+ "fetch/cross-origin-resource-policy/resources/image.py": [
+ "72f4bbf045fbb61623246d44b763bd06024c0f63",
+ "support"
+ ],
+ "fetch/cross-origin-resource-policy/resources/redirect.py": [
+ "eb237d6f61e042db8454efad97a7ca58ea90eba9",
+ "support"
+ ],
+ "fetch/cross-origin-resource-policy/resources/script.py": [
+ "330a0ae1420b41e63bd639fa24f75e64e4528bcc",
+ "support"
+ ],
+ "fetch/cross-origin-resource-policy/script-loads.html": [
+ "cd28267293f2d20ee78d6b946fe6b8793edf1bae",
+ "testharness"
+ ],
"fetch/data-urls/README.md": [
"868cb170fa0c5626008fef77e37dee16e76b10d5",
"support"
diff --git a/testing/web-platform/tests/common/get-host-info.sub.js b/testing/web-platform/tests/common/get-host-info.sub.js
index 58ef01c345f75..48ac19cbd08f5 100644
--- a/testing/web-platform/tests/common/get-host-info.sub.js
+++ b/testing/web-platform/tests/common/get-host-info.sub.js
@@ -6,6 +6,7 @@ function get_host_info() {
var ORIGINAL_HOST = '{{host}}';
var REMOTE_HOST = (ORIGINAL_HOST === 'localhost') ? '127.0.0.1' : ('www1.' + ORIGINAL_HOST);
var OTHER_HOST = '{{domains[www2]}}';
+ var NOTSAMESITE_HOST = (ORIGINAL_HOST === 'localhost') ? '127.0.0.1' : ('not-' + ORIGINAL_HOST);
return {
HTTP_PORT: HTTP_PORT,
@@ -19,6 +20,7 @@ function get_host_info() {
HTTPS_ORIGIN_WITH_CREDS: 'https://foo:bar@' + ORIGINAL_HOST + ':' + HTTPS_PORT,
HTTP_ORIGIN_WITH_DIFFERENT_PORT: 'http://' + ORIGINAL_HOST + ':' + HTTP_PORT2,
HTTP_REMOTE_ORIGIN: 'http://' + REMOTE_HOST + ':' + HTTP_PORT,
+ HTTP_NOTSAMESITE_ORIGIN: 'http://' + NOTSAMESITE_HOST + ':' + HTTP_PORT,
HTTP_REMOTE_ORIGIN_WITH_DIFFERENT_PORT: 'http://' + REMOTE_HOST + ':' + HTTP_PORT2,
HTTPS_REMOTE_ORIGIN: 'https://' + REMOTE_HOST + ':' + HTTPS_PORT,
HTTPS_REMOTE_ORIGIN_WITH_CREDS: 'https://foo:bar@' + REMOTE_HOST + ':' + HTTPS_PORT,
diff --git a/testing/web-platform/tests/fetch/cross-origin-resource-policy/fetch-in-iframe.html b/testing/web-platform/tests/fetch/cross-origin-resource-policy/fetch-in-iframe.html
new file mode 100644
index 0000000000000..cc6a3a81bcf4c
--- /dev/null
+++ b/testing/web-platform/tests/fetch/cross-origin-resource-policy/fetch-in-iframe.html
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/fetch/cross-origin-resource-policy/fetch.html b/testing/web-platform/tests/fetch/cross-origin-resource-policy/fetch.html
new file mode 100644
index 0000000000000..7cf8d60050aa7
--- /dev/null
+++ b/testing/web-platform/tests/fetch/cross-origin-resource-policy/fetch.html
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/fetch/cross-origin-resource-policy/iframe-loads.html b/testing/web-platform/tests/fetch/cross-origin-resource-policy/iframe-loads.html
new file mode 100644
index 0000000000000..63902c302b7ce
--- /dev/null
+++ b/testing/web-platform/tests/fetch/cross-origin-resource-policy/iframe-loads.html
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/fetch/cross-origin-resource-policy/image-loads.html b/testing/web-platform/tests/fetch/cross-origin-resource-policy/image-loads.html
new file mode 100644
index 0000000000000..8a0458f107abd
--- /dev/null
+++ b/testing/web-platform/tests/fetch/cross-origin-resource-policy/image-loads.html
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/fetch/cross-origin-resource-policy/resources/green.png b/testing/web-platform/tests/fetch/cross-origin-resource-policy/resources/green.png
new file mode 100644
index 0000000000000000000000000000000000000000..28a1faab37797ef39454aa1deac1b470712f7be4
GIT binary patch
literal 87
zcmeAS@N?(olHy`uVBq!ia0vp^DL`z*$P6SW{C@KnNHGWagt#*NXE2F7umZ^C_jGX#
j(GX2ekYHV$kio>jw1The iframe
+ The iframe making a same origin fetch call.
+"
+
diff --git a/testing/web-platform/tests/fetch/cross-origin-resource-policy/resources/iframeFetch.html b/testing/web-platform/tests/fetch/cross-origin-resource-policy/resources/iframeFetch.html
new file mode 100644
index 0000000000000..257185805d96d
--- /dev/null
+++ b/testing/web-platform/tests/fetch/cross-origin-resource-policy/resources/iframeFetch.html
@@ -0,0 +1,19 @@
+
+
+