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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/secureContexts/authenticated_srcdoc.html

Issue 1723753002: Make Document::isSecureContext() work for OOPIFs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 10 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/secureContexts/authenticated_srcdoc.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/secureContexts/authenticated_srcdoc.html b/third_party/WebKit/LayoutTests/http/tests/security/secureContexts/authenticated_srcdoc.html
new file mode 100644
index 0000000000000000000000000000000000000000..49dd8cc0dbe309463d401843364822da78033b4f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/secureContexts/authenticated_srcdoc.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <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.
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharness-helpers.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/resources/get-host-info.js"></script>
+</head>
+<body>
+ <script>
+ if (window.location.origin != get_host_info().AUTHENTICATED_ORIGIN) {
+ window.location = get_host_info().AUTHENTICATED_ORIGIN +
+ window.location.pathname;
+ } else {
+ test(function () {
+ assert_equals(window.location.origin, get_host_info().AUTHENTICATED_ORIGIN, "Sanity check the test runner.");
+ assert_true(window.isSecureContext);
+ }, "authenticated origin is secure.");
+
+ async_test(function (t) {
+ var messages = 0;
+ window.addEventListener("message", t.step_func(function (e) {
+ assert_true(e.data.isSecureContext);
+ messages++;
+ if (messages >= 1)
+ t.done();
+ }), false);
+
+ var i1 = document.createElement("iframe");
+ i1.srcdoc = "<iframe src='" + get_host_info().AUTHENTICATED_ORIGIN + "/security/secureContexts/resources/post-securecontext-status.html" + "'></iframe>";
+ document.body.appendChild(i1);
+ }, "Frames inside sandboxed frames are secure");
+ }
+ </script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698