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

Side by Side Diff: tests/standalone/io/socket_exception_test.dart

Issue 10908059: Reenable http client tests and remove test that relies on a specific port on localhost. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | « tests/standalone/io/http_client_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // Tests socket exceptions. 5 // Tests socket exceptions.
6 6
7 #import("dart:isolate"); 7 #import("dart:isolate");
8 #import("dart:io"); 8 #import("dart:io");
9 9
10 class SocketExceptionTest { 10 class SocketExceptionTest {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 static void unknownHostTest() { 176 static void unknownHostTest() {
177 // Port to verify that the test completes. 177 // Port to verify that the test completes.
178 var port = new ReceivePort(); 178 var port = new ReceivePort();
179 port.receive((message, replyTo) => null); 179 port.receive((message, replyTo) => null);
180 180
181 Socket s = new Socket("hede.hule.hest", 1234); 181 Socket s = new Socket("hede.hule.hest", 1234);
182 s.onError = (e) => port.close(); 182 s.onError = (e) => port.close();
183 s.onConnect = () => Expect.fail("Connection completed"); 183 s.onConnect = () => Expect.fail("Connection completed");
184 } 184 }
185 185
186 static void unresponsiveHostTest() {
187 // Port to keep the VM alive until test completes.
188 var port = new ReceivePort();
189 port.receive((message, replyTo) => null);
190
191 Socket s = new Socket("127.0.0.1", 65535);
192 s.onError = (e) => port.close();
193 s.onConnect = () => Expect.fail("Connection completed");
194 }
195
196 static void testMain() { 186 static void testMain() {
197 serverSocketExceptionTest(); 187 serverSocketExceptionTest();
198 clientSocketExceptionTest(); 188 clientSocketExceptionTest();
199 indexOutOfRangeExceptionTest(); 189 indexOutOfRangeExceptionTest();
200 unknownHostTest(); 190 unknownHostTest();
201 // TODO(sgjesse): This test seems to fail on the buildbot.
202 //unresponsiveHostTest();
203 } 191 }
204 } 192 }
205 193
206 main() { 194 main() {
207 SocketExceptionTest.testMain(); 195 SocketExceptionTest.testMain();
208 } 196 }
197
OLDNEW
« no previous file with comments | « tests/standalone/io/http_client_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698