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

Side by Side Diff: tests/standalone/src/ChunkedStreamTest.dart

Issue 9254026: Split dart:builtin into dart:builtin and dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment and add binaries. Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #import("dart:io");
6
5 void test1() { 7 void test1() {
6 void testWithChunkSize(var data, int chunkSize, Function testDone) { 8 void testWithChunkSize(var data, int chunkSize, Function testDone) {
7 InputStream s = new ListInputStream(data); 9 InputStream s = new ListInputStream(data);
8 ChunkedInputStream stream = new ChunkedInputStream(s); 10 ChunkedInputStream stream = new ChunkedInputStream(s);
9 int chunkCount = 0; 11 int chunkCount = 0;
10 int byteCount = 0; 12 int byteCount = 0;
11 void chunkData() { 13 void chunkData() {
12 List<int> chunk = stream.read(); 14 List<int> chunk = stream.read();
13 if (byteCount + chunkSize < data.length) { 15 if (byteCount + chunkSize < data.length) {
14 Expect.equals(chunkSize, chunk.length); 16 Expect.equals(chunkSize, chunk.length);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 s.write([4, 5, 6]); // 7 bytes written to stream. 128 s.write([4, 5, 6]); // 7 bytes written to stream.
127 129
128 donePort.receive((x,y) => donePort.close()); 130 donePort.receive((x,y) => donePort.close());
129 } 131 }
130 132
131 133
132 main() { 134 main() {
133 test1(); 135 test1();
134 test2(); 136 test2();
135 } 137 }
OLDNEW
« no previous file with comments | « samples/total/src/TotalRunner.dart ('k') | tests/standalone/src/DirectoryInvalidArgumentsTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698