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

Side by Side Diff: net/data/websocket/connect_to.html

Issue 336263005: Map WebSocket URL schemes to HTTP URL schemes for auth purposes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace accidentally removed #include <string> Created 6 years, 4 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>test ws connection</title> 4 <title>test ws connection</title>
5 <script type="text/javascript"> 5 <script type="text/javascript">
6 var protocol = location.protocol.replace('http', 'ws'); 6
7 var url = protocol + '//' + location.host + '/echo-with-no-extension'; 7 var href = window.location.href;
8 var queryBegin = href.indexOf('?url=');
9 if (queryBegin == -1) {
10 console.log("Failed to find ?url= in URL");
11 document.title = 'FAIL';
12 throw "FAILURE";
13 }
14 var url = href.slice(queryBegin + 5);
15
8 // Do connection test. 16 // Do connection test.
9 var ws = new WebSocket(url); 17 var ws = new WebSocket(url);
10 18
11 ws.onopen = function() 19 ws.onopen = function()
12 { 20 {
13 // Set document title to 'PASS'. The test observer catches this title changes 21 // Set document title to 'PASS'. The test observer catches this title changes
14 // to know the result. 22 // to know the result.
15 document.title = 'PASS'; 23 document.title = 'PASS';
16 } 24 }
17 25
18 ws.onclose = function() 26 ws.onclose = function()
19 { 27 {
20 // Set document title to 'FAIL'. 28 // Set document title to 'FAIL'.
21 document.title = 'FAIL'; 29 document.title = 'FAIL';
22 } 30 }
23 31
24 </script> 32 </script>
25 </head> 33 </head>
26 </html> 34 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698