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

Unified Diff: chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc

Issue 2318033002: c/browser, c/common, components M-N: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Fix ItunesFileUtilTest 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
Index: chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc
diff --git a/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc
index 9f9323c57721757259e1f4a7eed92e696b2fbd20..256b56ebf83b5667ed4417971877ad06317d3a78 100644
--- a/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc
+++ b/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc
@@ -83,19 +83,22 @@ class TestITunesDataProvider : public ITunesDataProvider {
}
const base::FilePath& auto_add_path() const override {
- return fake_auto_add_dir_.path();
+ return fake_auto_add_dir_path_;
}
void SetProvideAutoAddDir(bool provide_auto_add_dir) {
if (provide_auto_add_dir) {
if (!fake_auto_add_dir_.IsValid())
ASSERT_TRUE(fake_auto_add_dir_.CreateUniqueTempDir());
+ fake_auto_add_dir_path_ = fake_auto_add_dir_.GetPath();
} else {
ASSERT_TRUE(fake_auto_add_dir_.Delete());
+ fake_auto_add_dir_path_.clear();
}
}
private:
+ base::FilePath fake_auto_add_dir_path_;
vabr (Chromium) 2016/09/14 16:22:17 Before: ScopedTempDir needed to trust the code cal
Reilly Grant (use Gerrit) 2016/09/14 18:06:19 You could add an ASSERT_FALSE(fake_auto_add_dir_pa
vabr (Chromium) 2016/09/14 20:14:39 The trouble is that it can actually be empty: Itun
base::ScopedTempDir fake_auto_add_dir_;
};
@@ -143,15 +146,12 @@ class ItunesFileUtilTest : public testing::Test {
void SetUpDataProvider() {
ASSERT_TRUE(fake_library_dir_.CreateUniqueTempDir());
- ASSERT_EQ(
- 0,
- base::WriteFile(
- fake_library_dir_.path().AppendASCII(kITunesLibraryXML),
- NULL,
- 0));
+ ASSERT_EQ(0, base::WriteFile(
+ fake_library_dir_.GetPath().AppendASCII(kITunesLibraryXML),
+ NULL, 0));
itunes_data_provider_.reset(
- new TestITunesDataProvider(fake_library_dir_.path()));
+ new TestITunesDataProvider(fake_library_dir_.GetPath()));
}
void SetUp() override {
@@ -176,7 +176,7 @@ class ItunesFileUtilTest : public testing::Test {
media_path_filter_.reset(new MediaPathFilter());
ScopedVector<storage::FileSystemBackend> additional_providers;
additional_providers.push_back(new TestMediaFileSystemBackend(
- profile_dir_.path(),
+ profile_dir_.GetPath(),
new TestITunesFileUtil(media_path_filter_.get(),
itunes_data_provider_.get())));
@@ -185,8 +185,8 @@ class ItunesFileUtilTest : public testing::Test {
base::ThreadTaskRunnerHandle::Get().get(),
storage::ExternalMountPoints::CreateRefCounted().get(),
storage_policy.get(), NULL, std::move(additional_providers),
- std::vector<storage::URLRequestAutoMountHandler>(), profile_dir_.path(),
- content::CreateAllowFileAccessOptions());
+ std::vector<storage::URLRequestAutoMountHandler>(),
+ profile_dir_.GetPath(), content::CreateAllowFileAccessOptions());
}
protected:

Powered by Google App Engine
This is Rietveld 408576698