summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fetch/corb/resources
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/fetch/corb/resources')
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html-nosniff.css1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html-nosniff.css.headers2
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html.css1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html.css.headers1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/css-with-json-parser-breaker.css3
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/empty-labeled-as-png.png0
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/empty-labeled-as-png.png.headers1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/html-correctly-labeled.html10
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/html-correctly-labeled.html.headers1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/html-js-polyglot.js9
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/html-js-polyglot.js.headers1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/html-js-polyglot2.js10
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/html-js-polyglot2.js.headers1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html-nosniff.js1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html-nosniff.js.headers2
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html.js1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html.js.headers1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/png-correctly-labeled.pngbin0 -> 1010 bytes
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/png-correctly-labeled.png.headers1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html-nosniff.pngbin0 -> 1010 bytes
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html-nosniff.png.headers2
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html.pngbin0 -> 1010 bytes
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html.png.headers1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/response_block_probe.js1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/response_block_probe.js.headers1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/sniffable-resource.py11
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/subframe-that-posts-html-containing-blob-url-to-parent.html16
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-empty.svg4
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-empty.svg.headers1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-svg.svg4
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-svg.svg.headers1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-dash.svg3
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-dash.svg.headers1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-svg-xml.svg3
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-svg-xml.svg.headers1
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/svg-xml-decl.svg4
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/svg.svg3
-rw-r--r--testing/web-platform/tests/fetch/corb/resources/svg.svg.headers1
38 files changed, 105 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html-nosniff.css b/testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html-nosniff.css
new file mode 100644
index 0000000000..afd2b92975
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html-nosniff.css
@@ -0,0 +1 @@
+#header { color: red; }
diff --git a/testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html-nosniff.css.headers b/testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html-nosniff.css.headers
new file mode 100644
index 0000000000..0f228f94ec
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html-nosniff.css.headers
@@ -0,0 +1,2 @@
+Content-Type: text/html
+X-Content-Type-Options: nosniff
diff --git a/testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html.css b/testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html.css
new file mode 100644
index 0000000000..afd2b92975
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html.css
@@ -0,0 +1 @@
+#header { color: red; }
diff --git a/testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html.css.headers b/testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html.css.headers
new file mode 100644
index 0000000000..156209f9c8
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/css-mislabeled-as-html.css.headers
@@ -0,0 +1 @@
+Content-Type: text/html
diff --git a/testing/web-platform/tests/fetch/corb/resources/css-with-json-parser-breaker.css b/testing/web-platform/tests/fetch/corb/resources/css-with-json-parser-breaker.css
new file mode 100644
index 0000000000..7db6f5c6d3
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/css-with-json-parser-breaker.css
@@ -0,0 +1,3 @@
+)]}'
+{}
+#header { color: red; }
diff --git a/testing/web-platform/tests/fetch/corb/resources/empty-labeled-as-png.png b/testing/web-platform/tests/fetch/corb/resources/empty-labeled-as-png.png
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/empty-labeled-as-png.png
diff --git a/testing/web-platform/tests/fetch/corb/resources/empty-labeled-as-png.png.headers b/testing/web-platform/tests/fetch/corb/resources/empty-labeled-as-png.png.headers
new file mode 100644
index 0000000000..e7be84a714
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/empty-labeled-as-png.png.headers
@@ -0,0 +1 @@
+Content-Type: image/png
diff --git a/testing/web-platform/tests/fetch/corb/resources/html-correctly-labeled.html b/testing/web-platform/tests/fetch/corb/resources/html-correctly-labeled.html
new file mode 100644
index 0000000000..7bad71bfbd
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/html-correctly-labeled.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Page Title</title>
+ </head>
+ <body>
+ <p>Page body</p>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/fetch/corb/resources/html-correctly-labeled.html.headers b/testing/web-platform/tests/fetch/corb/resources/html-correctly-labeled.html.headers
new file mode 100644
index 0000000000..156209f9c8
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/html-correctly-labeled.html.headers
@@ -0,0 +1 @@
+Content-Type: text/html
diff --git a/testing/web-platform/tests/fetch/corb/resources/html-js-polyglot.js b/testing/web-platform/tests/fetch/corb/resources/html-js-polyglot.js
new file mode 100644
index 0000000000..db45bb4acc
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/html-js-polyglot.js
@@ -0,0 +1,9 @@
+<!--/*--><html><body><script type="text/javascript"><!--//*/
+
+// This is a regression test for https://crbug.com/839425
+// which found out that some script resources are served
+// with text/html content-type and with a body that is
+// both a valid html and a valid javascript.
+window['html-js-polyglot.js'] = true;
+
+//--></script></body></html>
diff --git a/testing/web-platform/tests/fetch/corb/resources/html-js-polyglot.js.headers b/testing/web-platform/tests/fetch/corb/resources/html-js-polyglot.js.headers
new file mode 100644
index 0000000000..156209f9c8
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/html-js-polyglot.js.headers
@@ -0,0 +1 @@
+Content-Type: text/html
diff --git a/testing/web-platform/tests/fetch/corb/resources/html-js-polyglot2.js b/testing/web-platform/tests/fetch/corb/resources/html-js-polyglot2.js
new file mode 100644
index 0000000000..faae1b7682
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/html-js-polyglot2.js
@@ -0,0 +1,10 @@
+<!-- comment --> <script type='text/javascript'>
+//<![CDATA[
+
+// This is a regression test for https://crbug.com/839945
+// which found out that some script resources are served
+// with text/html content-type and with a body that is
+// both a valid html and a valid javascript.
+window['html-js-polyglot2.js'] = true;
+
+//]]>--></script>
diff --git a/testing/web-platform/tests/fetch/corb/resources/html-js-polyglot2.js.headers b/testing/web-platform/tests/fetch/corb/resources/html-js-polyglot2.js.headers
new file mode 100644
index 0000000000..156209f9c8
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/html-js-polyglot2.js.headers
@@ -0,0 +1 @@
+Content-Type: text/html
diff --git a/testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html-nosniff.js b/testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html-nosniff.js
new file mode 100644
index 0000000000..a880a5bc72
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html-nosniff.js
@@ -0,0 +1 @@
+window.has_executed_script = true;
diff --git a/testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html-nosniff.js.headers b/testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html-nosniff.js.headers
new file mode 100644
index 0000000000..0f228f94ec
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html-nosniff.js.headers
@@ -0,0 +1,2 @@
+Content-Type: text/html
+X-Content-Type-Options: nosniff
diff --git a/testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html.js b/testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html.js
new file mode 100644
index 0000000000..a880a5bc72
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html.js
@@ -0,0 +1 @@
+window.has_executed_script = true;
diff --git a/testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html.js.headers b/testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html.js.headers
new file mode 100644
index 0000000000..156209f9c8
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/js-mislabeled-as-html.js.headers
@@ -0,0 +1 @@
+Content-Type: text/html
diff --git a/testing/web-platform/tests/fetch/corb/resources/png-correctly-labeled.png b/testing/web-platform/tests/fetch/corb/resources/png-correctly-labeled.png
new file mode 100644
index 0000000000..820f8cace2
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/png-correctly-labeled.png
Binary files differ
diff --git a/testing/web-platform/tests/fetch/corb/resources/png-correctly-labeled.png.headers b/testing/web-platform/tests/fetch/corb/resources/png-correctly-labeled.png.headers
new file mode 100644
index 0000000000..e7be84a714
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/png-correctly-labeled.png.headers
@@ -0,0 +1 @@
+Content-Type: image/png
diff --git a/testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html-nosniff.png b/testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html-nosniff.png
new file mode 100644
index 0000000000..820f8cace2
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html-nosniff.png
Binary files differ
diff --git a/testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html-nosniff.png.headers b/testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html-nosniff.png.headers
new file mode 100644
index 0000000000..0f228f94ec
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html-nosniff.png.headers
@@ -0,0 +1,2 @@
+Content-Type: text/html
+X-Content-Type-Options: nosniff
diff --git a/testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html.png b/testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html.png
new file mode 100644
index 0000000000..820f8cace2
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html.png
Binary files differ
diff --git a/testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html.png.headers b/testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html.png.headers
new file mode 100644
index 0000000000..156209f9c8
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/png-mislabeled-as-html.png.headers
@@ -0,0 +1 @@
+Content-Type: text/html
diff --git a/testing/web-platform/tests/fetch/corb/resources/response_block_probe.js b/testing/web-platform/tests/fetch/corb/resources/response_block_probe.js
new file mode 100644
index 0000000000..9c3b87bcbd
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/response_block_probe.js
@@ -0,0 +1 @@
+alert(1); // Arbitrary JavaScript. Details don't matter for the test.
diff --git a/testing/web-platform/tests/fetch/corb/resources/response_block_probe.js.headers b/testing/web-platform/tests/fetch/corb/resources/response_block_probe.js.headers
new file mode 100644
index 0000000000..0d848b02c2
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/response_block_probe.js.headers
@@ -0,0 +1 @@
+Content-Type: text/csv
diff --git a/testing/web-platform/tests/fetch/corb/resources/sniffable-resource.py b/testing/web-platform/tests/fetch/corb/resources/sniffable-resource.py
new file mode 100644
index 0000000000..f8150936ac
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/sniffable-resource.py
@@ -0,0 +1,11 @@
+def main(request, response):
+ body = request.GET.first(b"body", None)
+ type = request.GET.first(b"type", None)
+
+ response.add_required_headers = False
+ response.writer.write_status(200)
+ response.writer.write_header(b"content-length", len(body))
+ response.writer.write_header(b"content-type", type)
+ response.writer.end_headers()
+
+ response.writer.write(body)
diff --git a/testing/web-platform/tests/fetch/corb/resources/subframe-that-posts-html-containing-blob-url-to-parent.html b/testing/web-platform/tests/fetch/corb/resources/subframe-that-posts-html-containing-blob-url-to-parent.html
new file mode 100644
index 0000000000..67b3ad5a60
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/subframe-that-posts-html-containing-blob-url-to-parent.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<script>
+fetch('html-correctly-labeled.html')
+ .then(response => response.blob())
+ .then(blob => {
+ let msg = { blob_size: blob.size,
+ blob_type: blob.type,
+ blob_url: URL.createObjectURL(blob) };
+ window.parent.postMessage(msg, '*');
+ })
+ .catch(error => {
+ let msg = { error: error };
+ window.parent.postMessage(msg, '*');
+ });
+</script>
diff --git a/testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-empty.svg b/testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-empty.svg
new file mode 100644
index 0000000000..fa2d29b3b0
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-empty.svg
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<svg width="920" height="625" xmlns="http://www.w3.org/2000/svg" role="img">
+<rect width="100" height="100" style="fill:rgb(255,0,0)"/>
+</svg>
diff --git a/testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-empty.svg.headers b/testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-empty.svg.headers
new file mode 100644
index 0000000000..29515ee7d4
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-empty.svg.headers
@@ -0,0 +1 @@
+Content-Type:
diff --git a/testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-svg.svg b/testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-svg.svg
new file mode 100644
index 0000000000..fa2d29b3b0
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-svg.svg
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<svg width="920" height="625" xmlns="http://www.w3.org/2000/svg" role="img">
+<rect width="100" height="100" style="fill:rgb(255,0,0)"/>
+</svg>
diff --git a/testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-svg.svg.headers b/testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-svg.svg.headers
new file mode 100644
index 0000000000..070de35fbe
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/svg-doctype-html-mimetype-svg.svg.headers
@@ -0,0 +1 @@
+Content-Type: image/svg+xml
diff --git a/testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-dash.svg b/testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-dash.svg
new file mode 100644
index 0000000000..2b7d1016b1
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-dash.svg
@@ -0,0 +1,3 @@
+<svg width="920" height="625" xmlns="http://www.w3.org/2000/svg" role="img">
+<rect width="100" height="100" style="fill:rgb(255,0,0)"/>
+</svg>
diff --git a/testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-dash.svg.headers b/testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-dash.svg.headers
new file mode 100644
index 0000000000..43ce612c9f
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-dash.svg.headers
@@ -0,0 +1 @@
+Content-Type: application/dash+xml
diff --git a/testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-svg-xml.svg b/testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-svg-xml.svg
new file mode 100644
index 0000000000..2b7d1016b1
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-svg-xml.svg
@@ -0,0 +1,3 @@
+<svg width="920" height="625" xmlns="http://www.w3.org/2000/svg" role="img">
+<rect width="100" height="100" style="fill:rgb(255,0,0)"/>
+</svg>
diff --git a/testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-svg-xml.svg.headers b/testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-svg-xml.svg.headers
new file mode 100644
index 0000000000..070de35fbe
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/svg-labeled-as-svg-xml.svg.headers
@@ -0,0 +1 @@
+Content-Type: image/svg+xml
diff --git a/testing/web-platform/tests/fetch/corb/resources/svg-xml-decl.svg b/testing/web-platform/tests/fetch/corb/resources/svg-xml-decl.svg
new file mode 100644
index 0000000000..3b39aff8e5
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/svg-xml-decl.svg
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="920" height="625" xmlns="http://www.w3.org/2000/svg" role="img">
+<rect width="100" height="100" style="fill:rgb(255,0,0)"/>
+</svg>
diff --git a/testing/web-platform/tests/fetch/corb/resources/svg.svg b/testing/web-platform/tests/fetch/corb/resources/svg.svg
new file mode 100644
index 0000000000..2b7d1016b1
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/svg.svg
@@ -0,0 +1,3 @@
+<svg width="920" height="625" xmlns="http://www.w3.org/2000/svg" role="img">
+<rect width="100" height="100" style="fill:rgb(255,0,0)"/>
+</svg>
diff --git a/testing/web-platform/tests/fetch/corb/resources/svg.svg.headers b/testing/web-platform/tests/fetch/corb/resources/svg.svg.headers
new file mode 100644
index 0000000000..070de35fbe
--- /dev/null
+++ b/testing/web-platform/tests/fetch/corb/resources/svg.svg.headers
@@ -0,0 +1 @@
+Content-Type: image/svg+xml