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

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

Issue 370743003: Add option to HttpClient to turn of auto uncompression (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review copmments Created 6 years, 5 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 | « sdk/lib/io/http_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_compression_test.dart
diff --git a/tests/standalone/io/http_compression_test.dart b/tests/standalone/io/http_compression_test.dart
index b5addc7bcadd590e5d0170565e74b53f4253f955..83e2faeecdf59fbacde2900a4d44879d29d4a687 100644
--- a/tests/standalone/io/http_compression_test.dart
+++ b/tests/standalone/io/http_compression_test.dart
@@ -11,7 +11,7 @@ import 'package:expect/expect.dart';
import 'dart:io';
import 'dart:typed_data';
-void testServerCompress() {
+void testServerCompress({bool clientAutoUncompress: true}) {
void test(List<int> data) {
HttpServer.bind("127.0.0.1", 0).then((server) {
server.listen((request) {
@@ -19,6 +19,7 @@ void testServerCompress() {
request.response.close();
});
var client = new HttpClient();
+ client.autoUncompress = clientAutoUncompress;
client.get("127.0.0.1", server.port, "/")
.then((request) {
request.headers.set(HttpHeaders.ACCEPT_ENCODING, "gzip,deflate");
@@ -32,7 +33,11 @@ void testServerCompress() {
list.addAll(b);
return list;
}).then((list) {
- Expect.listEquals(data, list);
+ if (clientAutoUncompress) {
+ Expect.listEquals(data, list);
+ } else {
+ Expect.listEquals(data, GZIP.decode(list));
+ }
server.close();
client.close();
});
@@ -89,5 +94,6 @@ void testAcceptEncodingHeader() {
void main() {
testServerCompress();
+ testServerCompress(clientAutoUncompress: false);
testAcceptEncodingHeader();
}
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698