| 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 // OtherResources=certificates/server_chain.pem |
| 6 // OtherResources=certificates/server_key.pem |
| 7 // OtherResources=certificates/trusted_certs.pem |
| 8 |
| 5 // This test verifies that the bad certificate callback works in HttpClient. | 9 // This test verifies that the bad certificate callback works in HttpClient. |
| 6 | 10 |
| 7 import "dart:async"; | 11 import "dart:async"; |
| 8 import "dart:io"; | 12 import "dart:io"; |
| 9 | 13 |
| 10 import "package:expect/expect.dart"; | 14 import "package:expect/expect.dart"; |
| 11 | 15 |
| 12 final HOST_NAME = 'localhost'; | 16 final HOST_NAME = 'localhost'; |
| 13 | 17 |
| 14 String localFile(path) => Platform.script.resolve(path).toFilePath(); | 18 String localFile(path) => Platform.script.resolve(path).toFilePath(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 if (result == 'fail') { | 77 if (result == 'fail') { |
| 74 Expect.isTrue(error is HandshakeException || | 78 Expect.isTrue(error is HandshakeException || |
| 75 (callbackReturns is! bool && error is TypeError)); | 79 (callbackReturns is! bool && error is TypeError)); |
| 76 } else if (result == 'throw') { | 80 } else if (result == 'throw') { |
| 77 Expect.isTrue(error is CustomException); | 81 Expect.isTrue(error is CustomException); |
| 78 } else { | 82 } else { |
| 79 Expect.fail('Unknown expectation $result'); | 83 Expect.fail('Unknown expectation $result'); |
| 80 } | 84 } |
| 81 } | 85 } |
| 82 } | 86 } |
| OLD | NEW |