summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/referrer-policy/generic/subresource-test
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/referrer-policy/generic/subresource-test
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/referrer-policy/generic/subresource-test')
-rw-r--r--testing/web-platform/tests/referrer-policy/generic/subresource-test/area-navigate.html39
-rw-r--r--testing/web-platform/tests/referrer-policy/generic/subresource-test/attr-referrer-invalid-value.html25
-rw-r--r--testing/web-platform/tests/referrer-policy/generic/subresource-test/fetch-messaging.html48
-rw-r--r--testing/web-platform/tests/referrer-policy/generic/subresource-test/iframe-messaging.html39
-rw-r--r--testing/web-platform/tests/referrer-policy/generic/subresource-test/image-decoding.html39
-rw-r--r--testing/web-platform/tests/referrer-policy/generic/subresource-test/link-navigate.html39
-rw-r--r--testing/web-platform/tests/referrer-policy/generic/subresource-test/script-messaging.html39
-rw-r--r--testing/web-platform/tests/referrer-policy/generic/subresource-test/worker-messaging.html39
-rw-r--r--testing/web-platform/tests/referrer-policy/generic/subresource-test/xhr-messaging.html39
9 files changed, 346 insertions, 0 deletions
diff --git a/testing/web-platform/tests/referrer-policy/generic/subresource-test/area-navigate.html b/testing/web-platform/tests/referrer-policy/generic/subresource-test/area-navigate.html
new file mode 100644
index 000000000..bca7e479f
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/generic/subresource-test/area-navigate.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<!-- TODO(kristijanburnik): Remove subres. duplication. Reuse a template. -->
+<html>
+ <head>
+ <title>Area Link messaging - cross-origin Area Link navigation</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <!-- Common global functions for referrer-policy tests. -->
+ <script src="/referrer-policy/generic/common.js"></script>
+ </head>
+ <body>
+ <h1>Area Link messaging - cross-origin Area Link navigation</h1>
+ <p>If you can read JSON encoded HTTP request headers of the Area link below,
+ the messaging works as expected.</p>
+
+ <pre id="received_message">Running...</pre>
+
+ <script>
+ var messaging_test = async_test("Area is responding with HTTP headers");
+ var urlPath = '/referrer-policy/generic/subresource/document.py';
+ var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
+ urlPath;
+ queryAreaLink(url, function(message) {
+ var pre = document.getElementById('received_message')
+ var headers = message.headers;
+ pre.innerHTML = "";
+ pre.innerHTML += url + ":\n\n";
+ pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
+ messaging_test.step(function() {
+ assert_own_property(headers, "host")
+ assert_own_property(headers, "connection")
+ });
+ messaging_test.done();
+ });
+ </script>
+
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/generic/subresource-test/attr-referrer-invalid-value.html b/testing/web-platform/tests/referrer-policy/generic/subresource-test/attr-referrer-invalid-value.html
new file mode 100644
index 000000000..9bc74f54a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/generic/subresource-test/attr-referrer-invalid-value.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Invalid referrerPolicy attribute value</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+ <body>
+ <h1>Invalid referrerPolicy attribute value</h1>
+ <pre>Running...</pre>
+
+ <script>
+ test(function () {
+ var elements = ["iframe", "img", "a", "area", "link"];
+ for (var i = 0; i < elements.length; i++) {
+ var elem = document.createElement(elements[i]);
+ elem.referrerPolicy = "unsafe-url";
+ assert_equals(elem.referrerPolicy, "unsafe-url");
+ elem.referrerPolicy = "not-valid-value";
+ assert_equals(elem.referrerPolicy, "");
+ }
+ }, "Invalid referrerpolicy values not reflected");
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/generic/subresource-test/fetch-messaging.html b/testing/web-platform/tests/referrer-policy/generic/subresource-test/fetch-messaging.html
new file mode 100644
index 000000000..046b29e9a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/generic/subresource-test/fetch-messaging.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<!-- TODO(kristijanburnik): Remove subres. duplication. Reuse a template. -->
+<html>
+ <head>
+ <title>Fetch messaging - same-origin Fetch request</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <!-- Common global functions for referrer-policy tests. -->
+ <script src="/referrer-policy/generic/common.js"></script>
+ </head>
+ <body>
+ <h1>Fetch messaging - same-origin Fetch request</h1>
+ <p>If you can read JSON encoded HTTP request headers of the Fetch below,
+ the messaging works as expected.</p>
+
+ <pre id="received_message">Running...</pre>
+
+ <script>
+ test(function() {
+ assert_true(!!window.fetch, "Fetch is not supported by this browser.");
+ }, "Fetch is supported by the browser.");
+
+ (function() {
+ if (!window.fetch)
+ return;
+
+ var fetch_test = async_test("Fetch is responding with HTTP headers");
+ var urlPath = '/referrer-policy/generic/subresource/xhr.py';
+ var url = location.protocol + "//" + location.hostname + ":" +
+ location.port + urlPath;
+ queryFetch(url, function(message) {
+ var pre = document.getElementById('received_message')
+ var headers = message.headers;
+ pre.innerHTML = "";
+ pre.innerHTML += url + ":\n\n";
+ pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n";
+ fetch_test.step(function() {
+ assert_own_property(headers, "host")
+ assert_own_property(headers, "connection")
+ });
+ fetch_test.done();
+ });
+ })();
+ </script>
+
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/generic/subresource-test/iframe-messaging.html b/testing/web-platform/tests/referrer-policy/generic/subresource-test/iframe-messaging.html
new file mode 100644
index 000000000..a3e55707c
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/generic/subresource-test/iframe-messaging.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<!-- TODO(kristijanburnik): Remove subres. duplication. Reuse a template. -->
+<html>
+ <head>
+ <title>Iframe messaging - cross-origin iframe request</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <!-- Common global functions for referrer-policy tests. -->
+ <script src="/referrer-policy/generic/common.js"></script>
+ </head>
+ <body>
+ <h1>Iframe messaging - cross-origin iframe request</h1>
+ <p>If you can read JSON encoded HTTP request headers of the iframe below,
+ the messaging works as expected.</p>
+
+ <pre id="received_message">Running...</pre>
+
+ <script>
+ var messaging_test = async_test("Iframe is responding with HTTP headers");
+ var urlPath = '/referrer-policy/generic/subresource/document.py';
+ var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
+ urlPath;
+ queryIframe(url, function(message) {
+ var pre = document.getElementById('received_message')
+ var headers = message.headers;
+ pre.innerHTML = "";
+ pre.innerHTML += url + ":\n\n";
+ pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
+ messaging_test.step(function() {
+ assert_own_property(headers, "host")
+ assert_own_property(headers, "connection")
+ });
+ messaging_test.done();
+ });
+ </script>
+
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/generic/subresource-test/image-decoding.html b/testing/web-platform/tests/referrer-policy/generic/subresource-test/image-decoding.html
new file mode 100644
index 000000000..083fb829a
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/generic/subresource-test/image-decoding.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<!-- TODO(kristijanburnik): Remove subres. duplication. Reuse a template. -->
+<html>
+ <head>
+ <title>Image decoding - cross-origin image request</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <!-- Common global functions for referrer-policy tests. -->
+ <script src="/referrer-policy/generic/common.js"></script>
+ </head>
+ <body>
+ <h1>Image decoding - cross-origin image request</h1>
+ <p>If you can read JSON encoded HTTP headers of the image below,
+ the decoding works as expected.</p>
+
+ <pre id="received_message">Running...</pre>
+
+ <script>
+ var messaging_test = async_test("Image is encoding headers as JSON.");
+ var urlPath = '/referrer-policy/generic/subresource/image.py';
+ var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
+ urlPath;
+ queryImage(url, function(message) {
+ var pre = document.getElementById('received_message')
+ var headers = message.headers;
+ pre.innerHTML = "";
+ pre.innerHTML += url + ":\n\n";
+ pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
+ messaging_test.step(function() {
+ assert_own_property(headers, "host")
+ assert_own_property(headers, "connection")
+ });
+ messaging_test.done();
+ });
+ </script>
+
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/generic/subresource-test/link-navigate.html b/testing/web-platform/tests/referrer-policy/generic/subresource-test/link-navigate.html
new file mode 100644
index 000000000..45e502004
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/generic/subresource-test/link-navigate.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<!-- TODO(kristijanburnik): Remove subres. duplication. Reuse a template. -->
+<html>
+ <head>
+ <title>Link messaging - cross-origin Link navigation</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <!-- Common global functions for referrer-policy tests. -->
+ <script src="/referrer-policy/generic/common.js"></script>
+ </head>
+ <body>
+ <h1>Link messaging - cross-origin Link navigation</h1>
+ <p>If you can read JSON encoded HTTP request headers of the Link below,
+ the messaging works as expected.</p>
+
+ <pre id="received_message">Running...</pre>
+
+ <script>
+ var messaging_test = async_test("Link is responding with HTTP headers");
+ var urlPath = '/referrer-policy/generic/subresource/document.py';
+ var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
+ urlPath;
+ queryLink(url, function(message) {
+ var pre = document.getElementById('received_message')
+ var headers = message.headers;
+ pre.innerHTML = "";
+ pre.innerHTML += url + ":\n\n";
+ pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
+ messaging_test.step(function() {
+ assert_own_property(headers, "host")
+ assert_own_property(headers, "connection")
+ });
+ messaging_test.done();
+ });
+ </script>
+
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/generic/subresource-test/script-messaging.html b/testing/web-platform/tests/referrer-policy/generic/subresource-test/script-messaging.html
new file mode 100644
index 000000000..09c5db619
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/generic/subresource-test/script-messaging.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<!-- TODO(kristijanburnik): Remove subres. duplication. Reuse a template. -->
+<html>
+ <head>
+ <title>Script messaging - cross-origin Script request</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <!-- Common global functions for referrer-policy tests. -->
+ <script src="/referrer-policy/generic/common.js"></script>
+ </head>
+ <body>
+ <h1>Script messaging - cross-origin Script request</h1>
+ <p>If you can read JSON encoded HTTP request headers of the Script below,
+ the messaging works as expected.</p>
+
+ <pre id="received_message">Running...</pre>
+
+ <script>
+ var messaging_test = async_test("Script is responding with HTTP headers");
+ var urlPath = '/referrer-policy/generic/subresource/script.py';
+ var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
+ urlPath;
+ queryScript(url, function(message) {
+ var pre = document.getElementById('received_message')
+ var headers = message.headers;
+ pre.innerHTML = "";
+ pre.innerHTML += url + ":\n\n";
+ pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
+ messaging_test.step(function() {
+ assert_own_property(headers, "host")
+ assert_own_property(headers, "connection")
+ });
+ messaging_test.done();
+ });
+ </script>
+
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/generic/subresource-test/worker-messaging.html b/testing/web-platform/tests/referrer-policy/generic/subresource-test/worker-messaging.html
new file mode 100644
index 000000000..6d34366b9
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/generic/subresource-test/worker-messaging.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<!-- TODO(kristijanburnik): Remove subres. duplication. Reuse a template. -->
+<html>
+ <head>
+ <title>Worker messaging - same-origin Worker request</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <!-- Common global functions for referrer-policy tests. -->
+ <script src="/referrer-policy/generic/common.js"></script>
+ </head>
+ <body>
+ <h1>Worker messaging - same-origin Worker request</h1>
+ <p>If you can read JSON encoded HTTP request headers of the Worker below,
+ the messaging works as expected.</p>
+
+ <pre id="received_message">Running...</pre>
+
+ <script>
+ var messaging_test = async_test("Worker is responding with HTTP headers");
+ var urlPath = '/referrer-policy/generic/subresource/worker.py';
+ var url = location.protocol + "//" + location.hostname + ":" +
+ location.port + urlPath;
+ queryWorker(url, function(message) {
+ var pre = document.getElementById('received_message')
+ var headers = message.headers;
+ pre.innerHTML = "";
+ pre.innerHTML += url + ":\n\n";
+ pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
+ messaging_test.step(function() {
+ assert_own_property(headers, "host")
+ assert_own_property(headers, "connection")
+ });
+ messaging_test.done();
+ });
+ </script>
+
+ <div id="log"></div>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/referrer-policy/generic/subresource-test/xhr-messaging.html b/testing/web-platform/tests/referrer-policy/generic/subresource-test/xhr-messaging.html
new file mode 100644
index 000000000..09f691400
--- /dev/null
+++ b/testing/web-platform/tests/referrer-policy/generic/subresource-test/xhr-messaging.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<!-- TODO(kristijanburnik): Remove subres. duplication. Reuse a template. -->
+<html>
+ <head>
+ <title>XHR messaging - cross-origin XHR request</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <!-- Common global functions for referrer-policy tests. -->
+ <script src="/referrer-policy/generic/common.js"></script>
+ </head>
+ <body>
+ <h1>XHR messaging - cross-origin XHR request</h1>
+ <p>If you can read JSON encoded HTTP request headers of the XHR below,
+ the messaging works as expected.</p>
+
+ <pre id="received_message">Running...</pre>
+
+ <script>
+ var messaging_test = async_test("XHR is responding with HTTP headers");
+ var urlPath = '/referrer-policy/generic/subresource/xhr.py';
+ var url = location.protocol + "//www1." + location.hostname + ":" + location.port +
+ urlPath;
+ queryXhr(url, function(message) {
+ var pre = document.getElementById('received_message')
+ var headers = message.headers;
+ pre.innerHTML = "";
+ pre.innerHTML += url + ":\n\n";
+ pre.innerHTML += JSON.stringify(headers, null, 2) + "\n\n"
+ messaging_test.step(function() {
+ assert_own_property(headers, "host")
+ assert_own_property(headers, "connection")
+ });
+ messaging_test.done();
+ });
+ </script>
+
+ <div id="log"></div>
+ </body>
+</html>