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

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

Issue 11231070: Fix bug in HTTP client request generation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | « runtime/bin/websocket_impl.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/http_client_test.dart
diff --git a/tests/standalone/io/http_client_test.dart b/tests/standalone/io/http_client_test.dart
index 9fe3f157040e9d98f4f708154ada2d29c8172a86..55ec6170e86816b27ecfacc121b88e110a9a2088 100644
--- a/tests/standalone/io/http_client_test.dart
+++ b/tests/standalone/io/http_client_test.dart
@@ -25,25 +25,31 @@ void testGoogle() {
conn.onError = (error) => Expect.fail("Unexpected IO error");
}
+int testGoogleUrlCount = 0;
void testGoogleUrl() {
HttpClient client = new HttpClient();
void testUrl(String url) {
- var conn = client.getUrl(new Uri.fromString(url));
+ var requestUri = new Uri.fromString(url);
+ var conn = client.getUrl(requestUri);
conn.onRequest = (HttpClientRequest request) {
request.outputStream.close();
};
conn.onResponse = (HttpClientResponse response) {
+ testGoogleUrlCount++;
Expect.isTrue(response.statusCode < 500);
+ if (requestUri.path.length == 0) {
+ Expect.isTrue(response.statusCode != 404);
+ }
response.inputStream.onData = () {
response.inputStream.read();
};
response.inputStream.onClosed = () {
- client.shutdown();
+ if (testGoogleUrlCount == 5) client.shutdown();
};
};
- conn.onError = (error) => Expect.fail("Unexpected IO error");
+ conn.onError = (error) => Expect.fail("Unexpected IO error $error");
}
testUrl('http://www.google.com');
« no previous file with comments | « runtime/bin/websocket_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698