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

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

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to r18818 Created 7 years, 10 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
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 40dbe21b8812dd726d6e6357e4d1022f08e46a45..9b6f48911e302ed0d6aa3dc1b0e5fbf68c8c575c 100644
--- a/tests/standalone/io/secure_no_builtin_roots_test.dart
+++ b/tests/standalone/io/secure_no_builtin_roots_test.dart
@@ -5,28 +5,20 @@
import "dart:io";
import "dart:uri";
import "dart:isolate";
+import "dart:async";
void testGoogleUrl() {
- ReceivePort keepalivePort = new ReceivePort();
+ ReceivePort keepAlive = new ReceivePort();
HttpClient client = new HttpClient();
-
- void testUrl(String url) {
- var requestUri = Uri.parse(url);
- var conn = client.getUrl(requestUri);
-
- conn.onRequest = (HttpClientRequest request) {
- request.outputStream.close();
- };
- conn.onResponse = (HttpClientResponse response) {
- Expect.fail("Https connection unexpectedly succeeded");
- };
- conn.onError = (error) {
- Expect.isTrue(error is SocketIOException);
- keepalivePort.close();
- };
- }
-
- testUrl('https://www.google.com');
+ 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 AsyncError);
+ Expect.isTrue(error.error is SocketIOException);
+ keepAlive.close();
+ client.close();
+ });
}
void InitializeSSL() {
« no previous file with comments | « tests/standalone/io/secure_builtin_roots_test.dart ('k') | tests/standalone/io/secure_server_client_certificate_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698