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

Side by Side Diff: tests/standalone/src/io/ListOutputStreamTest.dart

Issue 9653026: Add writeString method to OutputStream (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 8 years, 9 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
« no previous file with comments | « tests/standalone/src/io/HttpTest.dart ('k') | tests/standalone/src/io/StringStreamTest.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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"); 5 #import("dart:io");
6 #import("dart:isolate"); 6 #import("dart:isolate");
7 7
8 void testEmptyListOutputStream1() { 8 void testEmptyListOutputStream1() {
9 OutputStream stream = new ListOutputStream(); 9 OutputStream stream = new ListOutputStream();
10 Expect.equals(null, stream.contents()); 10 Expect.equals(null, stream.contents());
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 Expect.equals(null, stream.contents()); 78 Expect.equals(null, stream.contents());
79 donePort.toSendPort().send(null); 79 donePort.toSendPort().send(null);
80 } 80 }
81 81
82 stream.onNoPendingWrites = onNoPendingWrites; 82 stream.onNoPendingWrites = onNoPendingWrites;
83 stream.onClosed = onClosed; 83 stream.onClosed = onClosed;
84 84
85 donePort.receive((x,y) => donePort.close()); 85 donePort.receive((x,y) => donePort.close());
86 } 86 }
87 87
88 void testListOutputStream3() {
89 OutputStream stream = new ListOutputStream();
90 ReceivePort donePort = new ReceivePort();
91 void onNoPendingWrites() {
92 stream.writeString("abcdABCD");
93 stream.writeString("abcdABCD", Encoding.UTF_8);
94 stream.writeString("abcdABCD", Encoding.ISO_8859_1);
95 stream.writeString("abcdABCD", Encoding.ASCII);
96 stream.writeString("æøå", Encoding.UTF_8);
97 stream.close();
98 }
99
100 void onClosed() {
101 var contents = stream.contents();
102 Expect.equals(38, contents.length);
103 donePort.toSendPort().send(null);
104 }
105
106 stream.onNoPendingWrites = onNoPendingWrites;
107 stream.onClosed = onClosed;
108
109 donePort.receive((x,y) => donePort.close());
110 }
111
88 main() { 112 main() {
89 testEmptyListOutputStream1(); 113 testEmptyListOutputStream1();
90 testEmptyListOutputStream2(); 114 testEmptyListOutputStream2();
91 testListOutputStream1(); 115 testListOutputStream1();
92 testListOutputStream2(); 116 testListOutputStream2();
117 testListOutputStream3();
93 } 118 }
OLDNEW
« no previous file with comments | « tests/standalone/src/io/HttpTest.dart ('k') | tests/standalone/src/io/StringStreamTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698