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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/upgrade-insecure-requests/form-upgrade.html

Issue 1964303003: UPGRADE: Correctly handle navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forms. Created 4 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <head>
3 <title>Upgrade Insecure Requests: Form Submission.</title>
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 </head>
7 <body>
8 <script>
9 async_test(t => {
10 var i = document.createElement('iframe');
11 i.srcdoc = "<meta http-equiv='Content-Security-Policy' content='upgrade-inse cure-requests'>" +
12 "<form action='http://127.0.0.1:8443/security/resources/post-orig in-to-parent.html'></form>" +
13 "<script>document.querySelector('form').submit()</scr" + "ipt>";
14
15 window.addEventListener('message', t.step_func(e => {
16 if (e.source == i.contentWindow) {
17 assert_equals("https://127.0.0.1:8443", e.data.origin);
18 t.done();
19 }
20 }));
21
22 document.body.appendChild(i);
23 }, "Same-host form submissions are upgraded.");
24
25 async_test(t => {
26 var i = document.createElement('iframe');
27 i.srcdoc = "<meta http-equiv='Content-Security-Policy' content='upgrade-inse cure-requests'>" +
28 "<form action='http://example.test:8443/security/resources/post-o rigin-to-parent.html'></form>" +
29 "<script>document.querySelector('form').submit()</scr" + "ipt>";
30
31 window.addEventListener('message', t.step_func(e => {
32 if (e.source == i.contentWindow) {
33 assert_equals("https://example.test:8443", e.data.origin);
34 t.done();
35 }
36 }));
37
38 document.body.appendChild(i);
39 }, "Cross-host form submissions are upgraded.");
40 </script>
41 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698