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

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

Issue 12395017: dart:io | Fix a crash when read was called on a closed socket on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove intense test. Created 7 years, 9 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 | « runtime/bin/socket_patch.dart ('k') | tests/standalone/standalone.status » ('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 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
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.
4 //
5 // VMOptions=
6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write
9
10 // This test repeats a subtest from raw_secure_server_socket_test 100 times.
11 // This may help to reproduce a reported crash in issue dartbug.com/8798.
12 // This test should be removed within a week (2013/3/8), if it always succeeds.
13
14 import "dart:async";
15 import "dart:io";
16 import "dart:isolate";
17
18 const SERVER_ADDRESS = "127.0.0.1";
19 const HOST_NAME = "localhost";
20 const CERTIFICATE = "localhost_cert";
21
22 void testSimpleConnectFail(String certificate) {
23 ReceivePort port = new ReceivePort();
24 RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 5, certificate).then((server) {
25 var clientEndFuture = RawSecureSocket.connect(HOST_NAME, server.port)
26 .then((clientEnd) {
27 Expect.fail("No client connection expected.");
28 })
29 .catchError((e) {
30 Expect.isTrue(e is AsyncError);
31 Expect.isTrue(e.error is SocketIOException);
32 });
33 server.listen((serverEnd) {
34 Expect.fail("No server connection expected.");
35 },
36 onError: (e) {
37 Expect.isTrue(e is AsyncError);
38 Expect.isTrue(e.error is SocketIOException);
39 clientEndFuture.then((_) => port.close());
40 });
41 });
42 }
43
44 main() {
45 Path scriptDir = new Path(new Options().script).directoryPath;
46 Path certificateDatabase = scriptDir.append('pkcert');
47 SecureSocket.initialize(database: certificateDatabase.toNativePath(),
48 password: 'dartdart',
49 useBuiltinRoots: false);
50 for (int i = 0; i < 100; ++i) {
51 testSimpleConnectFail("not_a_nickname");
52 testSimpleConnectFail("CN=notARealDistinguishedName");
53 }
54 }
OLDNEW
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698