Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>Unauthenticated origin with srcdoc iframe is insecure</title> | |
|
Mike West
2016/02/25 11:58:11
Nit: s/Unauthenticated/Authenticated/, s/insecure/
estark
2016/03/01 02:59:26
Done.
| |
| 5 <script src="/resources/testharness.js"></script> | |
| 6 <script src="/resources/testharness-helpers.js"></script> | |
| 7 <script src="/resources/testharnessreport.js"></script> | |
| 8 <script src="/resources/get-host-info.js"></script> | |
| 9 </head> | |
| 10 <body> | |
| 11 <script> | |
| 12 if (window.location.origin != get_host_info().AUTHENTICATED_ORIGIN) { | |
| 13 window.location = get_host_info().AUTHENTICATED_ORIGIN + | |
| 14 window.location.pathname; | |
| 15 } else { | |
| 16 test(function () { | |
| 17 assert_equals(window.location.origin, get_host_info().AUTHENTICA TED_ORIGIN, "Sanity check the test runner."); | |
| 18 assert_true(window.isSecureContext); | |
| 19 }, "authenticated origin is secure."); | |
| 20 | |
| 21 async_test(function (t) { | |
| 22 var messages = 0; | |
| 23 window.addEventListener("message", t.step_func(function (e) { | |
| 24 assert_true(e.data.isSecureContext); | |
| 25 messages++; | |
| 26 if (messages >= 1) | |
| 27 t.done(); | |
| 28 }), false); | |
| 29 | |
| 30 var i1 = document.createElement("iframe"); | |
| 31 i1.srcdoc = "<iframe src='" + get_host_info().AUTHENTICA TED_ORIGIN + "/security/secureContexts/resources/post-securecontext-status.html" + "'></iframe>"; | |
| 32 document.body.appendChild(i1); | |
| 33 }, "Frames inside sandboxed frames are secure"); | |
| 34 } | |
| 35 </script> | |
| 36 </body> | |
| 37 </html> | |
| OLD | NEW |