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

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

Issue 1373773003: Implement 'window.isSecureContext'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: document. Created 5 years, 3 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/unauthenticated.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/secureContexts/unauthenticated.html b/third_party/WebKit/LayoutTests/http/tests/security/secureContexts/unauthenticated.html
new file mode 100644
index 0000000000000000000000000000000000000000..aa9bb0594df69dc5b344bdf3690c9ab52e6ff6fa
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/secureContexts/unauthenticated.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Unauthenticated origin is insecure</title>
+ <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().UNAUTHENTICATED_ORIGIN) {
+ window.location = get_host_info().UNAUTHENTICATED_ORIGIN +
+ window.location.pathname;
+ } else {
+ test(function () {
+ assert_equals(window.location.origin, get_host_info().UNAUTHENTICATED_ORIGIN, "Sanity check the test runner.");
+ assert_false(window.isSecureContext);
+ }, "unauthenticated origin is insecure.");
+
+ async_test(function (t) {
+ var messages = 0;
+ window.addEventListener("message", t.step_func(function (e) {
+ assert_false(e.data.isSecureContext);
+ messages++;
+ if (messages >= 2)
+ t.done();
+ }), false);
+
+ var i1 = document.createElement("iframe");
+ i1.src = get_host_info().UNAUTHENTICATED_ORIGIN + "/security/secureContexts/resources/post-securecontext-status.html";
+ document.body.appendChild(i1);
+
+ var i2 = document.createElement("iframe");
+ i2.src = get_host_info().AUTHENTICATED_ORIGIN + "/security/secureContexts/resources/post-securecontext-status.html";
+ document.body.appendChild(i2);
+ }, "Frames are insecure");
+ }
+ </script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698