| 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>
|
|
|