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

Side by Side Diff: base/file_path_unittest.cc

Issue 5754002: Moving away from shell api to support long path names on windows for filesystem. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/file_path.h" 6 #include "base/file_path.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "testing/platform_test.h" 10 #include "testing/platform_test.h"
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 { FPL("/\\foo\\/bar"), FPL("\\\\foo\\\\bar") }, 1080 { FPL("/\\foo\\/bar"), FPL("\\\\foo\\\\bar") },
1081 }; 1081 };
1082 for (size_t i = 0; i < arraysize(cases); ++i) { 1082 for (size_t i = 0; i < arraysize(cases); ++i) {
1083 FilePath input(cases[i].input); 1083 FilePath input(cases[i].input);
1084 FilePath observed = input.NormalizeWindowsPathSeparators(); 1084 FilePath observed = input.NormalizeWindowsPathSeparators();
1085 EXPECT_EQ(FilePath::StringType(cases[i].expected), observed.value()) << 1085 EXPECT_EQ(FilePath::StringType(cases[i].expected), observed.value()) <<
1086 "i: " << i << ", input: " << input.value(); 1086 "i: " << i << ", input: " << input.value();
1087 } 1087 }
1088 } 1088 }
1089 #endif 1089 #endif
1090
1091 #if defined(OS_WIN)
1092 TEST_F(FilePathTest, TestStartsWithExtendedPathPrefix) {
1093 FilePath::StringType prefix_str(FilePath::kExtendedPathPrefix);
1094 FilePath with_extended_path_prefix(prefix_str);
1095 EXPECT_TRUE(with_extended_path_prefix.StartsWithExtendedPathPrefix());
1096 FilePath longer_with_extended_path_prefix(
1097 prefix_str.append(FPL("/\\foo\\/bar")));
1098 EXPECT_TRUE(longer_with_extended_path_prefix.StartsWithExtendedPathPrefix());
1099 FilePath without_extended_path_prefix(FPL("/\\foo\\/bar"));
1100 EXPECT_FALSE(without_extended_path_prefix.StartsWithExtendedPathPrefix());
1101 }
1102 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698