summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/https-upgrades/tentative
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/https-upgrades/tentative')
-rw-r--r--testing/web-platform/tests/https-upgrades/tentative/fallback.sub.html24
-rw-r--r--testing/web-platform/tests/https-upgrades/tentative/http-redirecting-to-http-redirecting-to-http.https.sub.html30
-rw-r--r--testing/web-platform/tests/https-upgrades/tentative/http-redirecting-to-http.https.sub.html29
-rw-r--r--testing/web-platform/tests/https-upgrades/tentative/http-redirecting-to-https.https.sub.html29
-rw-r--r--testing/web-platform/tests/https-upgrades/tentative/referrer.https.sub.html29
-rw-r--r--testing/web-platform/tests/https-upgrades/tentative/upgrade.https.sub.html24
6 files changed, 165 insertions, 0 deletions
diff --git a/testing/web-platform/tests/https-upgrades/tentative/fallback.sub.html b/testing/web-platform/tests/https-upgrades/tentative/fallback.sub.html
new file mode 100644
index 0000000000..8fdf0dc836
--- /dev/null
+++ b/testing/web-platform/tests/https-upgrades/tentative/fallback.sub.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTTPS Upgrades: Fallback.</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/get-host-info.sub.js"></script>
+
+ </head>
+ <body>
+ <script>
+ setup({ single_test: true });
+ // If HTTPS upgrades are enabled, this will fail to load since this test is http only,
+ // and should load properly once a fallback is triggered.
+ var url = new URL("http://{{host}}:{{ports[http][0]}}/https-upgrades/resources/pass.html")
+ window.onmessage = function(event) {
+ if (event.data === "pass") {
+ done();
+ }
+ }
+ win = window.open(url)
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/https-upgrades/tentative/http-redirecting-to-http-redirecting-to-http.https.sub.html b/testing/web-platform/tests/https-upgrades/tentative/http-redirecting-to-http-redirecting-to-http.https.sub.html
new file mode 100644
index 0000000000..96892c95a9
--- /dev/null
+++ b/testing/web-platform/tests/https-upgrades/tentative/http-redirecting-to-http-redirecting-to-http.https.sub.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTTPS Upgrades: HTTP URL redirecting to HTTP URL redirecting to HTTP URL</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/get-host-info.sub.js"></script>
+
+ </head>
+ <body>
+ <script>
+ setup({ single_test: true });
+ // Loads an HTTP URL that redirects to an HTTP URL that redirects to
+ // another HTTP URL. HTTPS upgrading should upgrade all URLs to HTTPS.
+ //
+ // HTTPS upgrading doesn't change custom ports, so this will load
+ // correctly if an HTTPS upgrade is performed, and will fail to load
+ // otherwise (since the port will be wrong for http).
+ var final_url = "http://{{host}}:{{ports[https][0]}}/https-upgrades/resources/pass.html";
+ var middle_url = "http://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=" + final_url;
+ var url = new URL("http://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=" + middle_url);
+ window.onmessage = function(event) {
+ if (event.data === "pass") {
+ done();
+ }
+ }
+ win = window.open(url)
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/https-upgrades/tentative/http-redirecting-to-http.https.sub.html b/testing/web-platform/tests/https-upgrades/tentative/http-redirecting-to-http.https.sub.html
new file mode 100644
index 0000000000..24d50a71bc
--- /dev/null
+++ b/testing/web-platform/tests/https-upgrades/tentative/http-redirecting-to-http.https.sub.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTTPS Upgrades: HTTP URL redirecting to HTTP</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/get-host-info.sub.js"></script>
+
+ </head>
+ <body>
+ <script>
+ setup({ single_test: true });
+ // Loads an HTTP URL that redirects to another HTTP URL. HTTPS upgrading
+ // should upgrade both the initial URL and the redirected URL to HTTPS.
+ //
+ // HTTPS upgrading doesn't change custom ports, so this will load
+ // correctly if an HTTPS upgrade is performed, and will fail to load
+ // otherwise (since the port will be wrong for http).
+ var final_url = "http://{{host}}:{{ports[https][0]}}/https-upgrades/resources/pass.html";
+ var url = new URL("http://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=" + final_url);
+ window.onmessage = function(event) {
+ if (event.data === "pass") {
+ done();
+ }
+ }
+ win = window.open(url)
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/https-upgrades/tentative/http-redirecting-to-https.https.sub.html b/testing/web-platform/tests/https-upgrades/tentative/http-redirecting-to-https.https.sub.html
new file mode 100644
index 0000000000..13a7f1698f
--- /dev/null
+++ b/testing/web-platform/tests/https-upgrades/tentative/http-redirecting-to-https.https.sub.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTTPS Upgrades: HTTP URL redirecting to HTTPS</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/get-host-info.sub.js"></script>
+
+ </head>
+ <body>
+ <script>
+ setup({ single_test: true });
+ // Loads an HTTP URL that redirects to an HTTPS URL. HTTPS upgrading
+ // should upgrade the initial URL.
+ //
+ // HTTPS upgrading doesn't change custom ports, so this will load
+ // correctly if an HTTPS upgrade is performed, and will fail to load
+ // otherwise (since the port will be wrong for http).
+ var final_url = "https://{{host}}:{{ports[https][0]}}/https-upgrades/resources/pass.html";
+ var url = new URL("http://{{host}}:{{ports[https][0]}}/fetch/api/resources/redirect.py?location=" + final_url);
+ window.onmessage = function(event) {
+ if (event.data === "pass") {
+ done();
+ }
+ }
+ win = window.open(url)
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/https-upgrades/tentative/referrer.https.sub.html b/testing/web-platform/tests/https-upgrades/tentative/referrer.https.sub.html
new file mode 100644
index 0000000000..3cd83ba561
--- /dev/null
+++ b/testing/web-platform/tests/https-upgrades/tentative/referrer.https.sub.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTTPS Upgrades: Upgrade.</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/get-host-info.sub.js"></script>
+
+ <meta name="referrer" content="no-referrer-when-downgrade" />
+
+ </head>
+ <body>
+ <script>
+ setup({ single_test: true });
+ // When the referrer policy is no-referrer-when-downgrade, HTTPS upgrades should not drop
+ // the referrer upon navigating to an HTTP URL if the upgrade is successful.
+
+ // HTTPS upgrades don't change custom ports, so this will load correctly if an HTTPS upgrade is performed,
+ // and will fail to load otherwise (since the port will be wrong for http).
+ var url = new URL("http://{{host}}:{{ports[https][0]}}/https-upgrades/resources/pass-with-referrer.html")
+ window.onmessage = function(event) {
+ if (event.data['pass'] && event.data['referrer'] == document.location.href) {
+ done();
+ }
+ }
+ win = window.open(url)
+ </script>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/https-upgrades/tentative/upgrade.https.sub.html b/testing/web-platform/tests/https-upgrades/tentative/upgrade.https.sub.html
new file mode 100644
index 0000000000..71a1fe1dde
--- /dev/null
+++ b/testing/web-platform/tests/https-upgrades/tentative/upgrade.https.sub.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>HTTPS Upgrades: Upgrade.</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/common/get-host-info.sub.js"></script>
+
+ </head>
+ <body>
+ <script>
+ setup({ single_test: true });
+ // HTTPS upgrades don't change custom ports, so this will load correctly if an HTTPS upgrade is performed,
+ // and will fail to load otherwise (since the port will be wrong for http).
+ var url = new URL("http://{{host}}:{{ports[https][0]}}/https-upgrades/resources/pass.html")
+ window.onmessage = function(event) {
+ if (event.data === "pass") {
+ done();
+ }
+ }
+ win = window.open(url)
+ </script>
+ </body>
+</html>