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

Side by Side Diff: test/message_test.dart

Issue 1660513002: pkg/shelf: use async and enable compression in example (Closed) Base URL: https://github.com/dart-lang/shelf.git@master
Patch Set: nits Created 4 years, 10 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
« no previous file with comments | « pubspec.yaml ('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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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:async'; 5 import 'dart:async';
6 import 'dart:convert'; 6 import 'dart:convert';
7 7
8 import 'package:shelf/src/message.dart'; 8 import 'package:shelf/src/message.dart';
9 import 'package:shelf/src/response.dart';
10 import 'package:test/test.dart'; 9 import 'package:test/test.dart';
11 10
12 import 'test_util.dart'; 11 import 'test_util.dart';
13 12
14 class _TestMessage extends Message { 13 class _TestMessage extends Message {
15 _TestMessage(Map<String, String> headers, Map<String, Object> context, body, 14 _TestMessage(Map<String, String> headers, Map<String, Object> context, body,
16 Encoding encoding) 15 Encoding encoding)
17 : super(body, headers: headers, context: context, encoding: encoding); 16 : super(body, headers: headers, context: context, encoding: encoding);
18 17
19 Message change({Map<String, String> headers, Map<String, Object> context, 18 Message change({Map<String, String> headers, Map<String, Object> context,
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 test("overwrites an existing charset if given an explicit encoding", () { 245 test("overwrites an existing charset if given an explicit encoding", () {
247 var request = _createMessage( 246 var request = _createMessage(
248 body: "è", 247 body: "è",
249 encoding: LATIN1, 248 encoding: LATIN1,
250 headers: {'content-type': 'text/plain; charset=whatever'}); 249 headers: {'content-type': 'text/plain; charset=whatever'});
251 expect(request.headers, 250 expect(request.headers,
252 containsPair('content-type', 'text/plain; charset=iso-8859-1')); 251 containsPair('content-type', 'text/plain; charset=iso-8859-1'));
253 }); 252 });
254 }); 253 });
255 } 254 }
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698