Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/upgrade-insecure-requests/iframe-upgrade-redirect.https.html

Issue 2445993006: [WIP] Upgrade-insecure-request: upgrade insecurely-redirected requests.
Patch Set: bugfix Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/security/upgrade-insecure-requests/iframe-upgrade-redirect.https.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/upgrade-insecure-requests/iframe-upgrade-redirect.https.html b/third_party/WebKit/LayoutTests/http/tests/security/upgrade-insecure-requests/iframe-upgrade-redirect.https.html
new file mode 100644
index 0000000000000000000000000000000000000000..408062e89b0f4b3e2a35e842145b4074c96b05d4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/upgrade-insecure-requests/iframe-upgrade-redirect.https.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<head>
+<title>Upgrade Insecure Requests: IFrames with a redirection.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
+</head>
+<body>
+<script>
+
+// This is a bit of a hack. UPGRADE doesn't upgrade the port number, so we
+// specify this non-existent URL ('http' over port 8443). If UPGRADE doesn't
+// work, it won't load.
+var origin = [
+ {name: "same origin" , url:"http://127.0.0.1:8443"},
+ {name: "cross origin" , url:"http://example.test:8443"}
+];
+
+var redirect_url = "/resources/redirect.php?url=";
+var iframe_url = "/security/resources/post-origin-to-parent.html";
+
+origin.forEach(function(redirector_origin) {
+ origin.forEach(function(redirected_origin) {
+ async_test(t => {
+ var i = document.createElement('iframe');
+ i.src = redirector_origin.url + redirect_url + redirected_origin.url + iframe_url;
+ window.addEventListener('message', t.step_func(e => {
+ if (e.source == i.contentWindow) {
+ t.done();
+ }
+ }));
+ document.body.appendChild(i);
+ }, "Verify that " + redirector_origin.name + " iframe with " + redirected_origin.name + " redirection are both upgraded.");
+ });
+});
+
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698