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

Unified Diff: base/path_service_unittest.cc

Issue 10909228: Add PathService::RemoveOverride to clear path overrides. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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
« base/path_service.cc ('K') | « base/path_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/path_service_unittest.cc
diff --git a/base/path_service_unittest.cc b/base/path_service_unittest.cc
index 81d1fef0b96c61379712f4c9ee2a87e720b2a37a..b63e6306d425d65c3b69b550600094467c6cdd79 100644
--- a/base/path_service_unittest.cc
+++ b/base/path_service_unittest.cc
@@ -111,3 +111,24 @@ TEST_F(PathServiceTest, Override) {
true));
EXPECT_TRUE(file_util::PathExists(fake_cache_dir2));
}
+
+TEST_F(PathServiceTest, RemoveOverride) {
+ // Before we start the test we have to call RemoveOverride at least once to
+ // clear any overrides that might have been left from other tests.
+ PathService::RemoveOverride(base::DIR_TEMP);
+
+ FilePath original_user_data_dir;
+ EXPECT_TRUE(PathService::Get(base::DIR_TEMP, &original_user_data_dir));
+ EXPECT_FALSE(PathService::RemoveOverride(base::DIR_TEMP));
+
+ ScopedTempDir temp_dir;
+ ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
+ EXPECT_TRUE(PathService::Override(base::DIR_TEMP, temp_dir.path()));
+ FilePath new_user_data_dir;
+ EXPECT_TRUE(PathService::Get(base::DIR_TEMP, &new_user_data_dir));
+ EXPECT_NE(original_user_data_dir, new_user_data_dir);
+
+ EXPECT_TRUE(PathService::RemoveOverride(base::DIR_TEMP));
+ EXPECT_TRUE(PathService::Get(base::DIR_TEMP, &new_user_data_dir));
+ EXPECT_EQ(original_user_data_dir, new_user_data_dir);
+}
« base/path_service.cc ('K') | « base/path_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698