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

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

Issue 11085039: WebSocket test server migration on browser_tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: retain std::string reference for GURL::Replacements Created 8 years, 2 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
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 6
7 var href = window.location.href; 7 var href = window.location.href;
8 var portBegin = href.lastIndexOf(':') + 1; 8 var hostBegin = href.indexOf('/') + 2;
9 var hostEnd = href.lastIndexOf(':');
10 var host = href.slice(hostBegin, hostEnd);
11 var portBegin = hostEnd + 1
9 var portEnd = href.lastIndexOf('/'); 12 var portEnd = href.lastIndexOf('/');
10 var port = href.slice(portBegin, portEnd); 13 var port = href.slice(portBegin, portEnd);
11 var scheme = href.indexOf('https') >= 0 ? 'wss' : 'ws'; 14 var scheme = href.indexOf('https') >= 0 ? 'wss' : 'ws';
12 var url = scheme + '://localhost:' + port + '/websocket/tests/echo'; 15 var url = scheme + '://' + host + ':' + port + '/echo';
13 16
14 // Do connection test. 17 // Do connection test.
15 var ws = new WebSocket(url); 18 var ws = new WebSocket(url);
16 19
17 ws.onopen = function() 20 ws.onopen = function()
18 { 21 {
19 // Set document title to 'PASS'. The test observer catches this title changes 22 // Set document title to 'PASS'. The test observer catches this title changes
20 // to know the result. 23 // to know the result.
21 document.title = 'PASS'; 24 document.title = 'PASS';
22 } 25 }
23 26
24 ws.onclose = function() 27 ws.onclose = function()
25 { 28 {
26 // Set document title to 'FAIL'. 29 // Set document title to 'FAIL'.
27 document.title = 'FAIL'; 30 document.title = 'FAIL';
28 } 31 }
29 32
30 </script> 33 </script>
31 </head> 34 </head>
32 </html> 35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698