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

Unified Diff: tests/standalone/io/regress_7097_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
« no previous file with comments | « tests/standalone/io/regress_6521_test.dart ('k') | tests/standalone/io/regress_7191_script.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/regress_7097_test.dart
diff --git a/tests/standalone/io/regress_7097_test.dart b/tests/standalone/io/regress_7097_test.dart
deleted file mode 100644
index 214f92b0aa347708c08437a3811f31b1b7509daf..0000000000000000000000000000000000000000
--- a/tests/standalone/io/regress_7097_test.dart
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:async';
-import 'dart:io';
-import 'dart:uri';
-
-void main() {
- var client = new HttpClient();
- var server = new HttpServer();
-
- var count = 0;
- server.defaultRequestHandler = (HttpRequest request, HttpResponse response) {
- List<int> data = [];
- request.inputStream.onData = () {
- data.addAll(request.inputStream.read());
- };
- request.inputStream.onClosed = () {
- count++;
- Expect.equals(count, data.length);
- switch (count - 1) {
- case 0:
- response.outputStream.writeFrom([65, 66, 67], 1, 1);
- break;
- case 1:
- response.outputStream.writeFrom([65, 66, 67], 1);
- break;
- case 2:
- response.outputStream.writeFrom([65, 66, 67]);
- break;
- default:
- Expect.fail("Unexpected state");
- }
- response.outputStream.close();
- };
- };
- server.listen('127.0.0.1', 0);
-
- Future makeRequest(int n) {
- var completer = new Completer();
- var url = Uri.parse("http://localhost:${server.port}");
- var connection = client.openUrl("POST", url);
- connection.onRequest = (HttpClientRequest request) {
- request.contentLength = n + 1;
- switch (n) {
- case 0:
- request.outputStream.writeFrom([65, 66, 67], 1, 1);
- break;
- case 1:
- request.outputStream.writeFrom([65, 66, 67], 1);
- break;
- case 2:
- request.outputStream.writeFrom([65, 66, 67]);
- break;
- default:
- Expect.fail("Unexpected state");
- }
- request.outputStream.close();
- };
- connection.onResponse = (HttpClientResponse response) {
- List<int> data = [];
- response.inputStream.onData = () {
- data.addAll(response.inputStream.read());
- };
- response.inputStream.onClosed = () {
- Expect.equals(count, data.length);
- completer.complete(null);
- };
- };
- return completer.future;
- }
-
- makeRequest(0).then((_) {
- makeRequest(1).then((_) {
- makeRequest(2).then((_) {
- client.shutdown();
- server.close();
- });
- });
- });
-}
« no previous file with comments | « tests/standalone/io/regress_6521_test.dart ('k') | tests/standalone/io/regress_7191_script.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698