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

Unified Diff: LayoutTests/http/tests/security/mixedContent/websocket/insecure-websocket-in-secure-page.html

Issue 222153002: Disallow connecting an insecure WebSocket from a secure page. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 8 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/mixedContent/websocket/insecure-websocket-in-secure-page-allowed.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/security/mixedContent/websocket/insecure-websocket-in-secure-page.html
diff --git a/LayoutTests/http/tests/security/mixedContent/websocket/insecure-websocket-in-secure-page.html b/LayoutTests/http/tests/security/mixedContent/websocket/insecure-websocket-in-secure-page.html
index a6807087aa07a37f7592bab25e8a3ee1b8c4fe13..bea658d164eff3f23456dec394aed95744317571 100644
--- a/LayoutTests/http/tests/security/mixedContent/websocket/insecure-websocket-in-secure-page.html
+++ b/LayoutTests/http/tests/security/mixedContent/websocket/insecure-websocket-in-secure-page.html
@@ -1,25 +1,30 @@
+<!DOCTYPE html>
<html>
-<body>
+<head>
+<script src="/js-test-resources/testharness.js"></script>
+<script src="/js-test-resources/testharnessreport.js"></script>
<script>
+
if (window.testRunner) {
- testRunner.waitUntilDone();
- testRunner.dumpAsText();
testRunner.setCanOpenWindows();
testRunner.setCloseRemainingWindowsWhenComplete(true);
- testRunner.overridePreference("WebKitAllowRunningInsecureContent", true);
+ // Disallow insecure WebSockets.
+ testRunner.overridePreference("WebKitAllowRunningInsecureContent", false);
}
-window.addEventListener("message", function (e) {
- if (window.testRunner)
- testRunner.notifyDone();
-}, false);
+var test = async_test("Test that when a HTTPS window that creates an insecure WebSocket connection is opened, the mixed content callback is triggered because the main frame in the window is HTTPS but is trying connecting to an insecure WebSocket server.");
+test.step(function ()
+{
+ window.addEventListener("message", test.step_func(function (evt) {
+ assert_equals(evt.data, "DONE", "evt.data");
+ test.done();
+ }), false);
+
+ window.open("https://127.0.0.1:8443/security/mixedContent/websocket/resources/expect-throw-on-construction.html");
+});
</script>
-<p>This test opens a HTTPS window that creates an insecure WebSocket connection. We should
-trigger a mixed content callback because the main frame in the window is HTTPS but
-is trying connecting to an insecure WebSocket server.</p>
-<script>
-window.open("https://127.0.0.1:8443/websocket/send-empty.html");
-</script>
+</head>
+<body>
</body>
</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/mixedContent/websocket/insecure-websocket-in-secure-page-allowed.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698