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

Unified Diff: base/files/file_util_unittest.cc

Issue 1867833003: Prefer System Flash over non-local component updated Flash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
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) {
« no previous file with comments | « base/files/file_util.h ('k') | base/files/file_util_win.cc » ('j') | base/files/file_util_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698