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

Side by Side Diff: LayoutTests/http/tests/websocket/tests/hybi/connect-error-by-no-websocket-server.html

Issue 13776002: MediaStream should fire ended event when all tracks are ended (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: The patch is migrated from WebKit #bug 87336 Created 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/websocket/tests/hybi/connect-error-by-no-websocket-server-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../../../../js-test-resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <div id="description"></div>
8 <div id="console"></div>
9 <script>
10 description("Test that WebSocket fires error event if no WebSocket Server can be connected.");
11
12 window.jsTestIsAsync = true;
13
14 function endTest()
15 {
16 clearTimeout(timeoutID);
17 finishJSTest();
18 }
19
20 var url = "ws://localhost:8888"; //here it should have no websocket server to li sten.
21
22 function doTest(index)
23 {
24 debug("test" + index + " Start");
25
26 var ws = new WebSocket(url);
27
28 ws.onopen = function()
29 {
30 testFailed("Connected");
31 endTest();
32 };
33
34 ws.onmessage = function(messageEvent)
35 {
36 testFailed("Received Message");
37 ws.close();
38 endTest();
39 };
40
41 if (index == 0) {
42 ws.onclose = function()
43 {
44 testPassed("onclose was called");
45 doTest(index + 1);
46 };
47 ws.onerror = function()
48 {
49 testPassed("onerror was called");
50 };
51 } else if (index == 1) {
52 ws.onclose = function()
53 {
54 testPassed("onclose was called");
55 ws.close();
56 doTest(index + 1);
57 };
58 ws.onerror = function()
59 {
60 testPassed("onerror was called");
61 };
62 } else {
63 ws.onclose = function()
64 {
65 testPassed("onclose was called");
66 endTest();
67 };
68 ws.onerror = function()
69 {
70 testPassed("onerror was called");
71 ws.close();
72 };
73 }
74 }
75
76 function timeOutCallback()
77 {
78 debug("Timed out...");
79 endTest();
80 }
81
82 var timeoutID = setTimeout(timeOutCallback, 3000);
83
84 doTest(0);
85
86 </script>
87 <script src="../../../../js-test-resources/js-test-post.js"></script>
88 </body>
89 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/websocket/tests/hybi/connect-error-by-no-websocket-server-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698