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

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

Issue 12661003: Fix empty zlib deflate and early close of responses. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: tests/standalone/io/zlib_test.dart
diff --git a/tests/standalone/io/zlib_test.dart b/tests/standalone/io/zlib_test.dart
index b637db476e8f48f35335e3b6e9dd9af6810595cd..dcae4ffa80a34fdd1ad1371ac2001e71c695169b 100644
--- a/tests/standalone/io/zlib_test.dart
+++ b/tests/standalone/io/zlib_test.dart
@@ -48,6 +48,23 @@ void testZLibDeflate() {
}
+void testZLibDeflateEmpty() {
+ var port = new ReceivePort();
+ var controller = new StreamController();
+ controller.stream.transform(new ZLibDeflater(gzip: false, level: 6))
+ .reduce([], (buffer, data) {
+ buffer.addAll(data);
+ return buffer;
+ })
+ .then((data) {
+ print(data);
+ Expect.listEquals([120, 156, 2, 0, 0, 0, 255, 255], data);
+ port.close();
+ });
+ controller.close();
+}
+
+
void testZLibDeflateGZip() {
var port = new ReceivePort();
var data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
@@ -121,6 +138,7 @@ void testZLibInflate() {
void main() {
testZLibDeflate();
+ testZLibDeflateEmpty();
testZLibDeflateGZip();
testZLibDeflateInvalidLevel();
testZLibInflate();

Powered by Google App Engine
This is Rietveld 408576698