Chromium Code Reviews| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 if (result == 'false') expect (e is HandshakeException || | 55 if (result == 'false') expect (e is HandshakeException || |
| 56 e is SocketException); | 56 e is SocketException); |
| 57 else if (result == 'exception') expect (e is ExpectException || | 57 else if (result == 'exception') expect (e is ExpectException || |
| 58 e is SocketException); | 58 e is SocketException); |
| 59 else expect (e is ArgumentError || e is SocketException); | 59 else expect (e is ArgumentError || e is SocketException); |
| 60 })); | 60 })); |
| 61 | 61 |
| 62 client.badCertificateCallback = null; | 62 client.badCertificateCallback = null; |
| 63 testFutures.add(client.getUrl(Uri.parse('https://$HOST_NAME:$port/$result')) | 63 testFutures.add(client.getUrl(Uri.parse('https://$HOST_NAME:$port/$result')) |
| 64 .then((HttpClientRequest request) { | 64 .then((HttpClientRequest request) { |
| 65 expect(false); | 65 expect(result == 'true'); // The session cache may keep the last connecti on. |
|
kasperl
2013/09/26 08:25:39
Long line.
| |
| 66 }, onError: (e) { | 66 }, onError: (e) { |
| 67 expect(e is HandshakeException || e is SocketException); | 67 expect(e is HandshakeException || e is SocketException); |
| 68 })); | 68 })); |
| 69 | 69 |
| 70 return Future.wait(testFutures); | 70 return Future.wait(testFutures); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void main() { | 73 void main() { |
| 74 final args = new Options().arguments; | 74 final args = new Options().arguments; |
| 75 SecureSocket.initialize(); | 75 SecureSocket.initialize(); |
| 76 int port = int.parse(args[0]); | 76 int port = int.parse(args[0]); |
| 77 runHttpClient(port, args[1]) | 77 runHttpClient(port, args[1]) |
| 78 .then((_) => print('SUCCESS')); | 78 .then((_) => print('SUCCESS')); |
| 79 } | 79 } |
| OLD | NEW |