Chromium Code Reviews| Index: base/files/file_util_unittest.cc |
| diff --git a/base/files/file_util_unittest.cc b/base/files/file_util_unittest.cc |
| index a0d0a28927f6eae9c672fa201f30291765300369..a158212d9a7c4cc4aba3aac5c8d9f8b4b715bc17 100644 |
| --- a/base/files/file_util_unittest.cc |
| +++ b/base/files/file_util_unittest.cc |
| @@ -54,6 +54,11 @@ namespace base { |
| namespace { |
| +struct UnaryBooleanTestData { |
| + const FilePath::CharType* input; |
| + bool expected; |
| +}; |
| + |
| // To test that NormalizeFilePath() deals with NTFS reparse points correctly, |
| // we need functions to create and delete reparse points. |
| #if defined(OS_WIN) |
| @@ -1664,6 +1669,30 @@ TEST_F(FileUtilTest, GetTempDirTest) { |
| ::_tputenv_s(kTmpKey, _T("")); |
| } |
| } |
| + |
| +TEST_F(FileUtilTest, IsOnNetworkDrive) { |
| + const struct UnaryBooleanTestData cases[] = { |
| + { FPL(""), false }, |
| + { FPL("c:\\"), false }, |
| + { FPL("c:"), false }, |
| + { FPL("c:\\windows\\notepad.exe"), false }, |
| + /* |
|
cpu_(ooo_6.6-7.5)
2016/04/15 20:55:33
hmmm ... rather use an environment variable, so ev
|
| + // Uncomment and edit, for manual testing only. |
| + { FPL("\\\\server\\share\\file.txt"), true }, |
| + { FPL("\\\\server\\share"), true }, |
| + { FPL("\\\\server\\share\\"), true }, |
| + { FPL("\\\\server\\"), false }, |
| + { FPL("\\\\server"), false }, |
| + */ |
| + }; |
| + |
| + for (size_t i = 0; i < arraysize(cases); ++i) { |
| + FilePath input(cases[i].input); |
| + bool observed = IsOnNetworkDrive(input); |
| + EXPECT_EQ(cases[i].expected, observed) << |
| + "i: " << i << ", input: " << input.value(); |
| + } |
| +} |
| #endif // OS_WIN |
| TEST_F(FileUtilTest, CreateTemporaryFileTest) { |