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

Unified Diff: base/path_service_unittest.cc

Issue 2275553005: //base: Make ScopedTempDir::path() a GetPath() with a DCHECK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 4 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
« no previous file with comments | « base/metrics/persistent_memory_allocator_unittest.cc ('k') | base/process/process_metrics_unittest.cc » ('j') | 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 2b7bea88ab11e976827acaa21e63a73d644e8ba2..599da000a9b3ba52e7cfca4f9716ba3c366fcb1e 100644
--- a/base/path_service_unittest.cc
+++ b/base/path_service_unittest.cc
@@ -129,13 +129,13 @@ TEST_F(PathServiceTest, Override) {
int my_special_key = 666;
ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- FilePath fake_cache_dir(temp_dir.path().AppendASCII("cache"));
+ FilePath fake_cache_dir(temp_dir.GetPath().AppendASCII("cache"));
// PathService::Override should always create the path provided if it doesn't
// exist.
EXPECT_TRUE(PathService::Override(my_special_key, fake_cache_dir));
EXPECT_TRUE(PathExists(fake_cache_dir));
- FilePath fake_cache_dir2(temp_dir.path().AppendASCII("cache2"));
+ FilePath fake_cache_dir2(temp_dir.GetPath().AppendASCII("cache2"));
// PathService::OverrideAndCreateIfNeeded should obey the |create| parameter.
PathService::OverrideAndCreateIfNeeded(my_special_key,
fake_cache_dir2,
@@ -150,7 +150,7 @@ TEST_F(PathServiceTest, Override) {
#if defined(OS_POSIX)
FilePath non_existent(
- MakeAbsoluteFilePath(temp_dir.path()).AppendASCII("non_existent"));
+ MakeAbsoluteFilePath(temp_dir.GetPath()).AppendASCII("non_existent"));
EXPECT_TRUE(non_existent.IsAbsolute());
EXPECT_FALSE(PathExists(non_existent));
#if !defined(OS_ANDROID)
@@ -181,12 +181,12 @@ TEST_F(PathServiceTest, OverrideMultiple) {
int my_special_key = 666;
ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- FilePath fake_cache_dir1(temp_dir.path().AppendASCII("1"));
+ FilePath fake_cache_dir1(temp_dir.GetPath().AppendASCII("1"));
EXPECT_TRUE(PathService::Override(my_special_key, fake_cache_dir1));
EXPECT_TRUE(PathExists(fake_cache_dir1));
ASSERT_EQ(1, WriteFile(fake_cache_dir1.AppendASCII("t1"), ".", 1));
- FilePath fake_cache_dir2(temp_dir.path().AppendASCII("2"));
+ FilePath fake_cache_dir2(temp_dir.GetPath().AppendASCII("2"));
EXPECT_TRUE(PathService::Override(my_special_key + 1, fake_cache_dir2));
EXPECT_TRUE(PathExists(fake_cache_dir2));
ASSERT_EQ(1, WriteFile(fake_cache_dir2.AppendASCII("t2"), ".", 1));
@@ -211,7 +211,7 @@ TEST_F(PathServiceTest, RemoveOverride) {
ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
- EXPECT_TRUE(PathService::Override(DIR_TEMP, temp_dir.path()));
+ EXPECT_TRUE(PathService::Override(DIR_TEMP, temp_dir.GetPath()));
FilePath new_user_data_dir;
EXPECT_TRUE(PathService::Get(DIR_TEMP, &new_user_data_dir));
EXPECT_NE(original_user_data_dir, new_user_data_dir);
« no previous file with comments | « base/metrics/persistent_memory_allocator_unittest.cc ('k') | base/process/process_metrics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698