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

Side by Side 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, 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 | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html>
1 <html> 2 <html>
2 <body> 3 <head>
4 <script src="/js-test-resources/testharness.js"></script>
5 <script src="/js-test-resources/testharnessreport.js"></script>
3 <script> 6 <script>
7
4 if (window.testRunner) { 8 if (window.testRunner) {
5 testRunner.waitUntilDone();
6 testRunner.dumpAsText();
7 testRunner.setCanOpenWindows(); 9 testRunner.setCanOpenWindows();
8 testRunner.setCloseRemainingWindowsWhenComplete(true); 10 testRunner.setCloseRemainingWindowsWhenComplete(true);
9 testRunner.overridePreference("WebKitAllowRunningInsecureContent", true); 11 // Disallow insecure WebSockets.
12 testRunner.overridePreference("WebKitAllowRunningInsecureContent", false);
10 } 13 }
11 14
12 window.addEventListener("message", function (e) { 15 var test = async_test("Test that when a HTTPS window that creates an insecure We bSocket connection is opened, the mixed content callback is triggered because th e main frame in the window is HTTPS but is trying connecting to an insecure WebS ocket server.");
13 if (window.testRunner) 16 test.step(function ()
14 testRunner.notifyDone(); 17 {
15 }, false); 18 window.addEventListener("message", test.step_func(function (evt) {
19 assert_equals(evt.data, "DONE", "evt.data");
20 test.done();
21 }), false);
22
23 window.open("https://127.0.0.1:8443/security/mixedContent/websocket/resource s/expect-throw-on-construction.html");
24 });
16 25
17 </script> 26 </script>
18 <p>This test opens a HTTPS window that creates an insecure WebSocket connection. We should 27 </head>
19 trigger a mixed content callback because the main frame in the window is HTTPS b ut 28 <body>
20 is trying connecting to an insecure WebSocket server.</p>
21 <script>
22 window.open("https://127.0.0.1:8443/websocket/send-empty.html");
23 </script>
24 </body> 29 </body>
25 </html> 30 </html>
OLDNEW
« 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