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

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

Issue 360453004: Use utf-8 encoding for listing and error page, in http_server VirtualDirectory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update right pubspec... Created 6 years, 6 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
« no previous file with comments | « pkg/http_server/pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http_server/test/virtual_directory_test.dart
diff --git a/pkg/http_server/test/virtual_directory_test.dart b/pkg/http_server/test/virtual_directory_test.dart
index 97c7332fb66e82107e8a941aadcae21a5c0fe0a5..9bc65cfb8e646af9b188664aa1ef1cb9071ca020 100644
--- a/pkg/http_server/test/virtual_directory_test.dart
+++ b/pkg/http_server/test/virtual_directory_test.dart
@@ -140,6 +140,28 @@ void main() {
});
});
+ testVirtualDir('non-ascii-dir', (dir) {
+ var virDir = new VirtualDirectory(dir.path);
+ new Directory('${dir.path}/æøå').createSync();
+ virDir.allowDirectoryListing = true;
+
+ return getAsString(virDir, '/')
+ .then((result) {
+ expect(result, contains('æøå'));
+ });
+ });
+
+ testVirtualDir('content-type', (dir) {
+ var virDir = new VirtualDirectory(dir.path);
+ virDir.allowDirectoryListing = true;
+
+ return getHeaders(virDir, '/')
+ .then((headers) {
+ var contentType = headers.contentType.toString();
+ expect(contentType, 'text/html; charset=utf-8');
+ });
+ });
+
if (!Platform.isWindows) {
testVirtualDir('recursive-link', (dir) {
var link = new Link('${dir.path}/recursive')..createSync('.');
« no previous file with comments | « pkg/http_server/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698