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

Unified Diff: tests/standalone/io/secure_no_builtin_roots_test.dart

Issue 19558011: Improve certificate tests that hit google.com. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Pass null instead. Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/io/secure_no_builtin_roots_database_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/secure_no_builtin_roots_test.dart
diff --git a/tests/standalone/io/secure_no_builtin_roots_test.dart b/tests/standalone/io/secure_no_builtin_roots_test.dart
index 4bcdac83eeda96be61fe25d09932a127ad1568e0..49026b4a4d8f9d83c98fd4af24ffd10037a0808c 100644
--- a/tests/standalone/io/secure_no_builtin_roots_test.dart
+++ b/tests/standalone/io/secure_no_builtin_roots_test.dart
@@ -8,16 +8,23 @@ import "dart:isolate";
import "dart:async";
void testGoogleUrl() {
- ReceivePort keepAlive = new ReceivePort();
- HttpClient client = new HttpClient();
- client.getUrl(Uri.parse('https://www.google.com'))
- .then((request) => request.close())
- .then((response) => Expect.fail("Unexpected successful connection"))
- .catchError((error) {
- Expect.isTrue(error is HandshakeException);
- keepAlive.close();
- client.close();
- });
+ // We need to use an external server here because it is backed by a
+ // built-in root certificate authority.
+ InternetAddress.lookup('www.google.com').then((_) {
+ ReceivePort keepAlive = new ReceivePort();
+ HttpClient client = new HttpClient();
+ client.getUrl(Uri.parse('https://www.google.com'))
+ .then((request) => request.close())
+ .then((response) => Expect.fail("Unexpected successful connection"))
+ .catchError((error) {
+ Expect.isTrue(error is HandshakeException);
+ keepAlive.close();
+ client.close();
+ });
+ },
+ onError: (e) {
+ Expect.isTrue(e is SocketException);
+ });
}
void InitializeSSL() {
« no previous file with comments | « tests/standalone/io/secure_no_builtin_roots_database_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698