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

Side by Side Diff: tests/standalone/io/regress_10026_test.dart

Issue 22867033: Update ZLib/GZip in dart:io to be a Codec/Converter from dart:convert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add documentation and convert impl. Created 7 years, 4 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:isolate'; 8 import 'dart:isolate';
9 9
10 void testZLibInflate_regress10026() { 10 void testZLibInflate_regress10026() {
11 test(data, expect) { 11 test(data, expect) {
12 var port = new ReceivePort(); 12 var port = new ReceivePort();
13 var controller = new StreamController(sync: true); 13 var controller = new StreamController(sync: true);
14 controller.stream 14 controller.stream
15 .transform(new ZLibInflater()) 15 .transform(ZLIB.decoder)
16 .transform(new StringDecoder()) 16 .transform(new StringDecoder())
17 .fold(new StringBuffer(), (buffer, s) { 17 .fold(new StringBuffer(), (buffer, s) {
18 buffer.write(s); 18 buffer.write(s);
19 return buffer; 19 return buffer;
20 }) 20 })
21 .then((out) { 21 .then((out) {
22 Expect.equals(out.toString(), expect); 22 Expect.equals(out.toString(), expect);
23 port.close(); 23 port.close();
24 }); 24 });
25 controller.add(data); 25 controller.add(data);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 </div> 130 </div>
131 </body> 131 </body>
132 </html> 132 </html>
133 '''); 133 ''');
134 } 134 }
135 135
136 void main() { 136 void main() {
137 testZLibInflate_regress10026(); 137 testZLibInflate_regress10026();
138 } 138 }
139 139
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698