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

Unified Diff: net/base/filename_util_unittest.cc

Issue 1704163003: FileURLToFilePath: Don't unescape '/' and '\\'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made comment less scary Created 4 years, 10 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 | « net/base/filename_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/filename_util_unittest.cc
diff --git a/net/base/filename_util_unittest.cc b/net/base/filename_util_unittest.cc
index 5e3fb7e1c9f91fe59b5702ce274034d87c6ce5aa..4ca7f02c30d8f613956fdd8bd30326eb8f50c262 100644
--- a/net/base/filename_util_unittest.cc
+++ b/net/base/filename_util_unittest.cc
@@ -239,6 +239,9 @@ TEST(FilenameUtilTest, FileURLConversion) {
{L"\\\\foo\\bar.txt", "file:/foo/bar.txt"},
{L"\\\\foo\\bar.txt", "file://foo\\bar.txt"},
{L"C:\\foo\\bar.txt", "file:\\\\\\c:/foo/bar.txt"},
+ // %2f ('/') and %5c ('\\') are left alone by both GURL and
+ // FileURLToFilePath.
+ {L"C:\\foo%2f..%5cbar", "file:///C:\\foo%2f..%5cbar"},
#elif defined(OS_POSIX)
{L"/c:/foo/bar.txt", "file:/c:/foo/bar.txt"},
{L"/c:/foo/bar.txt", "file:///c:/foo/bar.txt"},
@@ -253,6 +256,9 @@ TEST(FilenameUtilTest, FileURLConversion) {
{L"/foo/bar.txt", "file:////foo////bar.txt"},
{L"/c:/foo/bar.txt", "file:\\\\\\c:/foo/bar.txt"},
{L"/c:/foo/bar.txt", "file:c:/foo/bar.txt"},
+ // %2f ('/') and %5c ('\\') are left alone by both GURL and
+ // FileURLToFilePath.
+ {L"/foo%2f..%5cbar", "file:///foo%2f..%5cbar"},
// We get these wrong because GURL turns back slashes into forward
// slashes.
// {L"/foo%5Cbar.txt", "file://foo\\bar.txt"},
« no previous file with comments | « net/base/filename_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698