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

Side by Side Diff: pkg/http_server/test/virtual_directory_test.dart

Issue 356843004: Don't use å in non-ascii test, as it can have multiple representations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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:io'; 6 import 'dart:io';
7 7
8 import "package:http_server/http_server.dart"; 8 import "package:http_server/http_server.dart";
9 import 'package:path/path.dart' as pathos; 9 import 'package:path/path.dart' as pathos;
10 import "package:unittest/unittest.dart"; 10 import "package:unittest/unittest.dart";
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 virDir.allowDirectoryListing = true; 135 virDir.allowDirectoryListing = true;
136 136
137 return getAsString(virDir, '/alert(\'hacked!\');') 137 return getAsString(virDir, '/alert(\'hacked!\');')
138 .then((result) { 138 .then((result) {
139 expect(result, contains('/alert('hacked!');/')); 139 expect(result, contains('/alert('hacked!');/'));
140 }); 140 });
141 }); 141 });
142 142
143 testVirtualDir('non-ascii-dir', (dir) { 143 testVirtualDir('non-ascii-dir', (dir) {
144 var virDir = new VirtualDirectory(dir.path); 144 var virDir = new VirtualDirectory(dir.path);
145 new Directory('${dir.path}/æøå').createSync(); 145 new Directory('${dir.path}/æø').createSync();
146 virDir.allowDirectoryListing = true; 146 virDir.allowDirectoryListing = true;
147 147
148 return getAsString(virDir, '/') 148 return getAsString(virDir, '/')
149 .then((result) { 149 .then((result) {
150 expect(result, contains('æøå')); 150 expect(result, contains('æø'));
151 }); 151 });
152 }); 152 });
153 153
154 testVirtualDir('content-type', (dir) { 154 testVirtualDir('content-type', (dir) {
155 var virDir = new VirtualDirectory(dir.path); 155 var virDir = new VirtualDirectory(dir.path);
156 virDir.allowDirectoryListing = true; 156 virDir.allowDirectoryListing = true;
157 157
158 return getHeaders(virDir, '/') 158 return getHeaders(virDir, '/')
159 .then((headers) { 159 .then((headers) {
160 var contentType = headers.contentType.toString(); 160 var contentType = headers.contentType.toString();
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 return virDir.serveFile(new File('${d.path}/file'), request); 587 return virDir.serveFile(new File('${d.path}/file'), request);
588 }; 588 };
589 589
590 return getAsString(virDir, '/') 590 return getAsString(virDir, '/')
591 .then((result) { 591 .then((result) {
592 expect(result, 'file contents'); 592 expect(result, 'file contents');
593 }); 593 });
594 }); 594 });
595 }); 595 });
596 } 596 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698