| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |