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

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

Issue 14690009: Make Completers asynchronous. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 7 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/http_parser_test.dart
diff --git a/tests/standalone/io/http_parser_test.dart b/tests/standalone/io/http_parser_test.dart
index 5742510e6cc181e7e7c2462077b9c4e77acee43c..0030a7dff3d7bc81c73c5de2c10772291566c9d2 100644
--- a/tests/standalone/io/http_parser_test.dart
+++ b/tests/standalone/io/http_parser_test.dart
@@ -275,13 +275,13 @@ class HttpParserTest {
}
static void _testParseInvalidResponse(String response, [bool close = false]) {
- _HttpParser httpParser;
- bool errorCalled;
- StreamController controller;
+ void testWrite(List<int> requestData, [int chunkSize = -1]) {
+ _HttpParser httpParser = new _HttpParser.responseParser();
+ StreamController controller = new StreamController();
+ bool errorCalled = false;;
+
+ if (chunkSize == -1) chunkSize = requestData.length;
- void reset() {
- httpParser = new _HttpParser.responseParser();
- controller = new StreamController();
var port = new ReceivePort();
controller.stream.pipe(httpParser);
var subscription = httpParser.listen((incoming) {
@@ -300,12 +300,8 @@ class HttpParserTest {
port.close();
Expect.isTrue(errorCalled);
});
- errorCalled = false;
- }
- void testWrite(List<int> requestData, [int chunkSize = -1]) {
- if (chunkSize == -1) chunkSize = requestData.length;
- reset();
+ errorCalled = false;
for (int pos = 0;
pos < requestData.length && !errorCalled;
pos += chunkSize) {

Powered by Google App Engine
This is Rietveld 408576698