| OLD | NEW |
| 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import "package:path/path.dart"; | 6 import "package:path/path.dart"; |
| 7 import "dart:async"; | 7 import "dart:async"; |
| 8 import "dart:io"; | 8 import "dart:io"; |
| 9 import "dart:isolate"; | 9 import "dart:isolate"; |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 response.listen( | 36 response.listen( |
| 37 (_) { }, | 37 (_) { }, |
| 38 onDone: () { | 38 onDone: () { |
| 39 client.close(); | 39 client.close(); |
| 40 clientPort.close(); | 40 clientPort.close(); |
| 41 server.close(); | 41 server.close(); |
| 42 Expect.throws(() => server.port); | 42 Expect.throws(() => server.port); |
| 43 onDone(); | 43 onDone(); |
| 44 }); | 44 }); |
| 45 }) | 45 }) |
| 46 .catchError((e) { | 46 .catchError((e, trace) { |
| 47 String msg = "Unexpected error in Https client: $e"; | 47 String msg = "Unexpected error in Https client: $e"; |
| 48 var trace = getAttachedStackTrace(e); | |
| 49 if (trace != null) msg += "\nStackTrace: $trace"; | 48 if (trace != null) msg += "\nStackTrace: $trace"; |
| 50 Expect.fail(msg); | 49 Expect.fail(msg); |
| 51 }); | 50 }); |
| 52 }); | 51 }); |
| 53 } | 52 } |
| 54 | 53 |
| 55 // Test two servers in succession. | 54 // Test two servers in succession. |
| 56 test(() { | 55 test(() { |
| 57 test(() { }); | 56 test(() { }); |
| 58 }); | 57 }); |
| 59 } | 58 } |
| 60 | 59 |
| 61 void InitializeSSL() { | 60 void InitializeSSL() { |
| 62 var testPkcertDatabase = join(dirname(Platform.script), 'pkcert'); | 61 var testPkcertDatabase = join(dirname(Platform.script), 'pkcert'); |
| 63 SecureSocket.initialize(database: testPkcertDatabase, | 62 SecureSocket.initialize(database: testPkcertDatabase, |
| 64 password: 'dartdart'); | 63 password: 'dartdart'); |
| 65 } | 64 } |
| 66 | 65 |
| 67 void main() { | 66 void main() { |
| 68 InitializeSSL(); | 67 InitializeSSL(); |
| 69 testListenOn(); | 68 testListenOn(); |
| 70 } | 69 } |
| OLD | NEW |