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

Side by Side Diff: chrome/test/data/ssl/wss_close.html

Issue 11085039: WebSocket test server migration on browser_tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: protected -> private Created 8 years, 1 month 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 | « chrome/test/data/http/tests/ws.html ('k') | chrome/test/data/ssl/wss_close_slave.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 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>test to close hanging wss connection</title> 4 <title>test to close hanging wss 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 hostBegin = href.indexOf('/') + 2;
9 var hostEnd = href.lastIndexOf(':');
10 var host = href.slice(hostBegin, hostEnd);
8 var queryBegin = href.lastIndexOf('?') + 1; 11 var queryBegin = href.lastIndexOf('?') + 1;
9 var port = href.slice(queryBegin); 12 var port = href.slice(queryBegin);
10 var url = 'wss://localhost:' + port; 13 var url = 'wss://' + host + ':' + port;
11 14
12 // Do connection test. 15 // Do connection test.
13 var ws = new WebSocket(url); 16 var ws = new WebSocket(url);
14 ws.onopen = function() { 17 ws.onopen = function() {
15 // Set document title to 'FAIL'. The test observer catches this title change 18 // Set document title to 'FAIL'. The test observer catches this title change
16 // to know the result. 19 // to know the result.
17 document.title = 'FAIL'; 20 document.title = 'FAIL';
18 } 21 }
19 ws.onclose = function() { 22 ws.onclose = function() {
20 // Set document title to 'PASS'. The test observer catches this title change 23 // Set document title to 'PASS'. The test observer catches this title change
21 // to know the result. 24 // to know the result.
22 document.title = 'PASS'; 25 document.title = 'PASS';
23 } 26 }
24 27
25 </script> 28 </script>
26 </head> 29 </head>
27 </html> 30 </html>
OLDNEW
« no previous file with comments | « chrome/test/data/http/tests/ws.html ('k') | chrome/test/data/ssl/wss_close_slave.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698