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

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

Issue 598453003: Add HttpServer:autoCompress option, to disable auto gzip compression. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add 'To disable, ...' Created 6 years, 2 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
« sdk/lib/io/http.dart ('K') | « sdk/lib/io/http_impl.dart ('k') | no next file » | 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) 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 // VMOptions= 5 // VMOptions=
6 // VMOptions=--short_socket_read 6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write 7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write 8 // VMOptions=--short_socket_read --short_socket_write
9 9
10 import 'package:expect/expect.dart'; 10 import 'package:expect/expect.dart';
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 test('gzip , deflate', true); 85 test('gzip , deflate', true);
86 test('deflate,gzip', true); 86 test('deflate,gzip', true);
87 test('deflate, gzip', true); 87 test('deflate, gzip', true);
88 test('deflate ,gzip', true); 88 test('deflate ,gzip', true);
89 test('deflate , gzip', true); 89 test('deflate , gzip', true);
90 test('abc,deflate , gzip,def,,,ghi ,jkl', true); 90 test('abc,deflate , gzip,def,,,ghi ,jkl', true);
91 test('xgzip', false); 91 test('xgzip', false);
92 test('gzipx;', false); 92 test('gzipx;', false);
93 } 93 }
94 94
95 void testDisableCompressTest() {
96 HttpServer.bind("127.0.0.1", 0).then((server) {
97 server.autoCompress = false;
98 server.listen((request) {
99 Expect.equals('gzip', request.headers.value(HttpHeaders.ACCEPT_ENCODING));
100 request.response.write("data");
101 request.response.close();
102 });
103 var client = new HttpClient();
104 client.get("127.0.0.1", server.port, "/")
105 .then((request) => request.close())
106 .then((response) {
107 Expect.equals(null,
108 response.headers.value(HttpHeaders.CONTENT_ENCODING));
109 response.listen(
110 (_) {},
111 onDone: () {
112 server.close();
113 client.close();
114 });
115 });
116 });
117 }
118
95 void main() { 119 void main() {
96 testServerCompress(); 120 testServerCompress();
97 testServerCompress(clientAutoUncompress: false); 121 testServerCompress(clientAutoUncompress: false);
98 testAcceptEncodingHeader(); 122 testAcceptEncodingHeader();
123 testDisableCompressTest();
99 } 124 }
OLDNEW
« sdk/lib/io/http.dart ('K') | « sdk/lib/io/http_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698