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

Unified Diff: pkg/shelf/test/shelf_io_test.dart

Issue 281353004: pkg/shelf: Fixed logic for setting Server header in `shelf_io` (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixed Created 6 years, 7 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
« pkg/shelf/CHANGELOG.md ('K') | « pkg/shelf/pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/shelf/test/shelf_io_test.dart
diff --git a/pkg/shelf/test/shelf_io_test.dart b/pkg/shelf/test/shelf_io_test.dart
index c7d9f7a78d5ea449d2fda53bee17fb9703db65dc..b7ed8471dfd8bac1a9231378de55613eb54ec74c 100644
--- a/pkg/shelf/test/shelf_io_test.dart
+++ b/pkg/shelf/test/shelf_io_test.dart
@@ -284,6 +284,27 @@ void main() {
});
});
});
+
+ group('server header', () {
+ test('defaults to "dart:io with Shelf"', () {
+ _scheduleServer(syncHandler);
+
+ return _scheduleGet().then((response) {
+ expect(response.headers, containsPair(HttpHeaders.SERVER, 'dart:io with Shelf'));
nweiz 2014/05/27 23:08:05 Long line
kevmoo 2014/05/28 00:44:05 Done.
+ });
+ });
+
+ test('deferres to response header when', () {
nweiz 2014/05/27 23:08:05 "deferres" -> "defers", "response header when" ->
kevmoo 2014/05/28 00:44:05 Done.
+ _scheduleServer((request) {
+ return new Response.ok('test',
+ headers: {HttpHeaders.SERVER: 'myServer'});
+ });
+
+ return _scheduleGet().then((response) {
+ expect(response.headers, containsPair(HttpHeaders.SERVER, 'myServer'));
+ });
+ });
+ });
}
int _serverPort;
« pkg/shelf/CHANGELOG.md ('K') | « pkg/shelf/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698