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

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

Issue 226183013: Don't create special path characters on windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « no previous file | 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 b58ee31c0a24acb5a3f7ce75fcf1d72cff09d1ff..4c1529cd1f8fcf1eb7758f0ad75d02b124c68425 100644
--- a/pkg/http_server/test/virtual_directory_test.dart
+++ b/pkg/http_server/test/virtual_directory_test.dart
@@ -140,29 +140,6 @@ void main() {
});
});
- testVirtualDir('encoded-path', (dir) {
- var virDir = new VirtualDirectory(dir.path);
- new Directory('${dir.path}/javascript:alert(document);"').createSync();
- virDir.allowDirectoryListing = true;
-
- return getAsString(virDir, '/')
- .then((result) {
- expect(result, contains('%2Fjavascript%3Aalert(document)%3B%22'));
- });
- });
-
- testVirtualDir('encoded-special', (dir) {
- var virDir = new VirtualDirectory(dir.path);
- new Directory('${dir.path}/<>&"').createSync();
- virDir.allowDirectoryListing = true;
-
- return getAsString(virDir, '/')
- .then((result) {
- expect(result, contains('&lt;&gt;&amp;&quot;&#x2F;'));
- expect(result, contains('href="%2F%3C%3E%26%22"'));
- });
- });
-
if (!Platform.isWindows) {
testVirtualDir('recursive-link', (dir) {
var link = new Link('${dir.path}/recursive')..createSync('.');
@@ -186,6 +163,29 @@ void main() {
expect(result, equals([true, true, true, true, true, true]));
});
});
+
+ testVirtualDir('encoded-path', (dir) {
+ var virDir = new VirtualDirectory(dir.path);
+ new Directory('${dir.path}/javascript:alert(document);"').createSync();
Søren Gjesse 2014/04/07 07:53:54 Long line.
Anders Johnsen 2014/04/07 09:11:43 Done.
+ virDir.allowDirectoryListing = true;
+
+ return getAsString(virDir, '/')
+ .then((result) {
+ expect(result, contains('%2Fjavascript%3Aalert(document)%3B%22'));
+ });
+ });
+
+ testVirtualDir('encoded-special', (dir) {
+ var virDir = new VirtualDirectory(dir.path);
+ new Directory('${dir.path}/<>&"').createSync();
+ virDir.allowDirectoryListing = true;
+
+ return getAsString(virDir, '/')
+ .then((result) {
+ expect(result, contains('&lt;&gt;&amp;&quot;&#x2F;'));
+ expect(result, contains('href="%2F%3C%3E%26%22"'));
+ });
+ });
}
});
« 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