| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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 // Client for https_bad_certificate_test, that runs in a subprocess. | 5 // Client for https_bad_certificate_test, that runs in a subprocess. |
| 6 // It verifies that the client bad certificate callback works in HttpClient. | 6 // It verifies that the client bad certificate callback works in HttpClient. |
| 7 | 7 |
| 8 import "dart:async"; | 8 import "dart:async"; |
| 9 import "dart:io"; | 9 import "dart:io"; |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 .then((HttpClientRequest request) { | 65 .then((HttpClientRequest request) { |
| 66 expect(result == 'true'); // The session cache may keep the session. | 66 expect(result == 'true'); // The session cache may keep the session. |
| 67 return request.close(); | 67 return request.close(); |
| 68 }, onError: (e) { | 68 }, onError: (e) { |
| 69 expect(e is HandshakeException || e is SocketException); | 69 expect(e is HandshakeException || e is SocketException); |
| 70 })); | 70 })); |
| 71 | 71 |
| 72 return Future.wait(testFutures); | 72 return Future.wait(testFutures); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void main() { | 75 void main(List<String> args) { |
| 76 final args = new Options().arguments; | |
| 77 SecureSocket.initialize(); | 76 SecureSocket.initialize(); |
| 78 int port = int.parse(args[0]); | 77 int port = int.parse(args[0]); |
| 79 runHttpClient(port, args[1]) | 78 runHttpClient(port, args[1]) |
| 80 .then((_) => print('SUCCESS')); | 79 .then((_) => print('SUCCESS')); |
| 81 } | 80 } |
| OLD | NEW |