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

Unified Diff: pkg/http_server/test/http_mock.dart

Issue 721213002: Fix a number of issues with the Range header handling for serving files (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 6 years, 1 month 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 | « pkg/http_server/pubspec.yaml ('k') | pkg/http_server/test/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http_server/test/http_mock.dart
diff --git a/pkg/http_server/test/http_mock.dart b/pkg/http_server/test/http_mock.dart
index aa20ffb57bfa1323ea962d94160e4c6b529da1fc..be2b50cfde2db819cfb382e33a11264d6b08cffe 100644
--- a/pkg/http_server/test/http_mock.dart
+++ b/pkg/http_server/test/http_mock.dart
@@ -9,6 +9,9 @@ class MockHttpHeaders implements HttpHeaders {
final Map<String, List<String>> _headers =
new HashMap<String, List<String>>();
+ operator[](key) => _headers[key];
+
+ int get contentLength => int.parse(_headers[HttpHeaders.CONTENT_LENGTH][0]);
DateTime get ifModifiedSince {
List<String> values = _headers[HttpHeaders.IF_MODIFIED_SINCE];
@@ -97,7 +100,11 @@ class MockHttpHeaders implements HttpHeaders {
* Implemented to remove editor warnings
*/
dynamic noSuchMethod(Invocation invocation) {
- print([invocation.memberName, invocation.isGetter, invocation.isSetter, invocation.isMethod, invocation.isAccessor]);
+ print([invocation.memberName,
+ invocation.isGetter,
+ invocation.isSetter,
+ invocation.isMethod,
+ invocation.isAccessor]);
return super.noSuchMethod(invocation);
}
}
@@ -182,6 +189,8 @@ class MockHttpResponse implements HttpResponse {
String get mockContent => UTF8.decode(_buffer);
+ List<int> get mockContentBinary => _buffer;
+
bool get mockDone => _isDone;
// Copied from SDK http_impl.dart @ 845 on 2014-01-05
« no previous file with comments | « pkg/http_server/pubspec.yaml ('k') | pkg/http_server/test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698