Commit 16e5f602 authored by vabr's avatar vabr Committed by Commit bot

misc files A-P: Change ScopedTempDir::path() to GetPath()

path() is being deprecated, GetPath() has better checking against wrong use.

For more context, see https://codereview.chromium.org/2275553005/.

BUG=640599
TBR=rsleevi@chromium.org, alexclarke@chromium.org, vitalybuka@chromium.org, nyquist@chromium.org, boliu@chromium.org, benwells@chromium.org, sdefresne@chromium.org, rogerta@chromium.org, rockot@chromium.org, alokp@chromium.org

Review-Url: https://codereview.chromium.org/2322573002
Cr-Commit-Position: refs/heads/master@{#418904}
parent 965572be
...@@ -40,7 +40,7 @@ class AwFormDatabaseServiceTest : public Test { ...@@ -40,7 +40,7 @@ class AwFormDatabaseServiceTest : public Test {
ASSERT_TRUE(env_ != NULL); ASSERT_TRUE(env_ != NULL);
ASSERT_TRUE(l10n_util::RegisterLocalizationUtil(env_)); ASSERT_TRUE(l10n_util::RegisterLocalizationUtil(env_));
service_.reset(new AwFormDatabaseService(temp_dir_.path())); service_.reset(new AwFormDatabaseService(temp_dir_.GetPath()));
} }
void TearDown() override { service_->Shutdown(); } void TearDown() override { service_->Shutdown(); }
......
...@@ -117,13 +117,13 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, FileAccessIsSavedToPrefs) { ...@@ -117,13 +117,13 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, FileAccessIsSavedToPrefs) {
base::ScopedTempDir temp_directory; base::ScopedTempDir temp_directory;
ASSERT_TRUE(temp_directory.CreateUniqueTempDir()); ASSERT_TRUE(temp_directory.CreateUniqueTempDir());
base::FilePath temp_file; base::FilePath temp_file;
ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_directory.path(), ASSERT_TRUE(
&temp_file)); base::CreateTemporaryFileInDir(temp_directory.GetPath(), &temp_file));
FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest(
&temp_file); &temp_file);
FileSystemChooseEntryFunction::RegisterTempExternalFileSystemForTest( FileSystemChooseEntryFunction::RegisterTempExternalFileSystemForTest(
"temp", temp_directory.path()); "temp", temp_directory.GetPath());
const Extension* extension = LoadAndLaunchPlatformApp( const Extension* extension = LoadAndLaunchPlatformApp(
"file_access_saved_to_prefs_test", "fileWritten"); "file_access_saved_to_prefs_test", "fileWritten");
...@@ -157,13 +157,13 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MAYBE_FileAccessIsRestored) { ...@@ -157,13 +157,13 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MAYBE_FileAccessIsRestored) {
base::ScopedTempDir temp_directory; base::ScopedTempDir temp_directory;
ASSERT_TRUE(temp_directory.CreateUniqueTempDir()); ASSERT_TRUE(temp_directory.CreateUniqueTempDir());
base::FilePath temp_file; base::FilePath temp_file;
ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_directory.path(), ASSERT_TRUE(
&temp_file)); base::CreateTemporaryFileInDir(temp_directory.GetPath(), &temp_file));
FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest(
&temp_file); &temp_file);
FileSystemChooseEntryFunction::RegisterTempExternalFileSystemForTest( FileSystemChooseEntryFunction::RegisterTempExternalFileSystemForTest(
"temp", temp_directory.path()); "temp", temp_directory.GetPath());
ExtensionTestMessageListener access_ok_listener( ExtensionTestMessageListener access_ok_listener(
"restartedFileAccessOK", false); "restartedFileAccessOK", false);
......
...@@ -58,7 +58,7 @@ class BlimpEngineConfigTest : public testing::Test { ...@@ -58,7 +58,7 @@ class BlimpEngineConfigTest : public testing::Test {
base::FilePath GetFilepathForSwitch( base::FilePath GetFilepathForSwitch(
const std::string& filepath_switch) const { const std::string& filepath_switch) const {
return temp_dir_.path().Append(filepath_switch); return temp_dir_.GetPath().Append(filepath_switch);
} }
const std::vector<std::string> all_filepath_switches_ = { const std::vector<std::string> all_filepath_switches_ = {
......
...@@ -113,7 +113,7 @@ class CastCrashReporterClientTest : public testing::Test { ...@@ -113,7 +113,7 @@ class CastCrashReporterClientTest : public testing::Test {
} }
base::FilePath minidump_path() { return minidump_.path(); } base::FilePath minidump_path() { return minidump_.path(); }
base::FilePath home_path() { return fake_home_dir_.path(); } base::FilePath home_path() { return fake_home_dir_.GetPath(); }
private: private:
base::ScopedTempDir fake_home_dir_; base::ScopedTempDir fake_home_dir_;
......
...@@ -24,10 +24,10 @@ class ErrorCodesTest : public testing::Test { ...@@ -24,10 +24,10 @@ class ErrorCodesTest : public testing::Test {
// Set up a temporary directory which will be used as our fake home dir. // Set up a temporary directory which will be used as our fake home dir.
ASSERT_TRUE(fake_home_dir_.CreateUniqueTempDir()); ASSERT_TRUE(fake_home_dir_.CreateUniqueTempDir());
path_override_.reset( path_override_.reset(
new base::ScopedPathOverride(base::DIR_HOME, fake_home_dir_.path())); new base::ScopedPathOverride(base::DIR_HOME, fake_home_dir_.GetPath()));
} }
base::FilePath home_path() const { return fake_home_dir_.path(); } base::FilePath home_path() const { return fake_home_dir_.GetPath(); }
private: private:
base::ScopedTempDir fake_home_dir_; base::ScopedTempDir fake_home_dir_;
......
...@@ -22,8 +22,8 @@ TEST(DummyMinidumpGeneratorTest, GenerateFailsWithInvalidPath) { ...@@ -22,8 +22,8 @@ TEST(DummyMinidumpGeneratorTest, GenerateFailsWithInvalidPath) {
// Attempt to generate a minidump from an invalid path. // Attempt to generate a minidump from an invalid path.
DummyMinidumpGenerator generator("/path/does/not/exist/minidump.dmp"); DummyMinidumpGenerator generator("/path/does/not/exist/minidump.dmp");
ASSERT_FALSE( ASSERT_FALSE(generator.Generate(
generator.Generate(minidump_dir.path().Append("minidump.dmp").value())); minidump_dir.GetPath().Append("minidump.dmp").value()));
} }
TEST(DummyMinidumpGeneratorTest, GenerateSucceedsWithSmallSource) { TEST(DummyMinidumpGeneratorTest, GenerateSucceedsWithSmallSource) {
...@@ -38,7 +38,7 @@ TEST(DummyMinidumpGeneratorTest, GenerateSucceedsWithSmallSource) { ...@@ -38,7 +38,7 @@ TEST(DummyMinidumpGeneratorTest, GenerateSucceedsWithSmallSource) {
base::WriteFile(fake_minidump.path(), data.c_str(), data.size())); base::WriteFile(fake_minidump.path(), data.c_str(), data.size()));
DummyMinidumpGenerator generator(fake_minidump.path().value()); DummyMinidumpGenerator generator(fake_minidump.path().value());
base::FilePath new_minidump = minidump_dir.path().Append("minidump.dmp"); base::FilePath new_minidump = minidump_dir.GetPath().Append("minidump.dmp");
EXPECT_TRUE(generator.Generate(new_minidump.value())); EXPECT_TRUE(generator.Generate(new_minidump.value()));
// Original file should not exist, and new file should contain original // Original file should not exist, and new file should contain original
...@@ -64,7 +64,7 @@ TEST(DummyMinidumpGeneratorTest, GenerateSucceedsWithLargeSource) { ...@@ -64,7 +64,7 @@ TEST(DummyMinidumpGeneratorTest, GenerateSucceedsWithLargeSource) {
ASSERT_EQ(static_cast<int>(data.size()), ASSERT_EQ(static_cast<int>(data.size()),
base::WriteFile(fake_minidump.path(), data.c_str(), data.size())); base::WriteFile(fake_minidump.path(), data.c_str(), data.size()));
base::FilePath new_minidump = minidump_dir.path().Append("minidump.dmp"); base::FilePath new_minidump = minidump_dir.GetPath().Append("minidump.dmp");
DummyMinidumpGenerator generator(fake_minidump.path().value()); DummyMinidumpGenerator generator(fake_minidump.path().value());
ASSERT_TRUE(generator.Generate(new_minidump.value())); ASSERT_TRUE(generator.Generate(new_minidump.value()));
......
...@@ -75,9 +75,9 @@ class MinidumpUploaderTest : public testing::Test { ...@@ -75,9 +75,9 @@ class MinidumpUploaderTest : public testing::Test {
// Set up a temporary directory which will be used as our fake home dir. // Set up a temporary directory which will be used as our fake home dir.
ASSERT_TRUE(fake_home_dir_.CreateUniqueTempDir()); ASSERT_TRUE(fake_home_dir_.CreateUniqueTempDir());
path_override_.reset( path_override_.reset(
new base::ScopedPathOverride(base::DIR_HOME, fake_home_dir_.path())); new base::ScopedPathOverride(base::DIR_HOME, fake_home_dir_.GetPath()));
minidump_dir_ = fake_home_dir_.path().Append(kMinidumpSubdir); minidump_dir_ = fake_home_dir_.GetPath().Append(kMinidumpSubdir);
lockfile_ = minidump_dir_.Append(kLockfileName); lockfile_ = minidump_dir_.Append(kLockfileName);
metadata_ = minidump_dir_.Append(kMetadataName); metadata_ = minidump_dir_.Append(kMetadataName);
......
...@@ -51,9 +51,9 @@ class MinidumpWriterTest : public testing::Test { ...@@ -51,9 +51,9 @@ class MinidumpWriterTest : public testing::Test {
// Set up a temporary directory which will be used as our fake home dir. // Set up a temporary directory which will be used as our fake home dir.
ASSERT_TRUE(fake_home_dir_.CreateUniqueTempDir()); ASSERT_TRUE(fake_home_dir_.CreateUniqueTempDir());
home_.reset( home_.reset(
new base::ScopedPathOverride(base::DIR_HOME, fake_home_dir_.path())); new base::ScopedPathOverride(base::DIR_HOME, fake_home_dir_.GetPath()));
minidump_dir_ = fake_home_dir_.path().Append(kMinidumpSubdir); minidump_dir_ = fake_home_dir_.GetPath().Append(kMinidumpSubdir);
dumplog_file_ = minidump_dir_.Append(kDumplogFile); dumplog_file_ = minidump_dir_.Append(kDumplogFile);
lockfile_path_ = minidump_dir_.Append(kLockfileName); lockfile_path_ = minidump_dir_.Append(kLockfileName);
metadata_path_ = minidump_dir_.Append(kMetadataName); metadata_path_ = minidump_dir_.Append(kMetadataName);
......
...@@ -147,9 +147,9 @@ class SynchronizedMinidumpManagerTest : public testing::Test { ...@@ -147,9 +147,9 @@ class SynchronizedMinidumpManagerTest : public testing::Test {
// Set up a temporary directory which will be used as our fake home dir. // Set up a temporary directory which will be used as our fake home dir.
ASSERT_TRUE(fake_home_dir_.CreateUniqueTempDir()); ASSERT_TRUE(fake_home_dir_.CreateUniqueTempDir());
path_override_.reset( path_override_.reset(
new base::ScopedPathOverride(base::DIR_HOME, fake_home_dir_.path())); new base::ScopedPathOverride(base::DIR_HOME, fake_home_dir_.GetPath()));
minidump_dir_ = fake_home_dir_.path().Append(kMinidumpSubdir); minidump_dir_ = fake_home_dir_.GetPath().Append(kMinidumpSubdir);
lockfile_ = minidump_dir_.Append(kLockfileName); lockfile_ = minidump_dir_.Append(kLockfileName);
metadata_ = minidump_dir_.Append(kMetadataName); metadata_ = minidump_dir_.Append(kMetadataName);
......
...@@ -18,7 +18,7 @@ ScopedTestNSSChromeOSUser::ScopedTestNSSChromeOSUser( ...@@ -18,7 +18,7 @@ ScopedTestNSSChromeOSUser::ScopedTestNSSChromeOSUser(
// This opens a software DB in the given folder. In production code that is in // This opens a software DB in the given folder. In production code that is in
// the home folder, but for testing the temp folder is used. // the home folder, but for testing the temp folder is used.
constructed_successfully_ = constructed_successfully_ =
InitializeNSSForChromeOSUser(username_hash, temp_dir_.path()); InitializeNSSForChromeOSUser(username_hash, temp_dir_.GetPath());
} }
ScopedTestNSSChromeOSUser::~ScopedTestNSSChromeOSUser() { ScopedTestNSSChromeOSUser::~ScopedTestNSSChromeOSUser() {
......
...@@ -24,7 +24,7 @@ ScopedTestNSSDB::ScopedTestNSSDB() { ...@@ -24,7 +24,7 @@ ScopedTestNSSDB::ScopedTestNSSDB() {
return; return;
const char kTestDescription[] = "Test DB"; const char kTestDescription[] = "Test DB";
slot_ = OpenSoftwareNSSDB(temp_dir_.path(), kTestDescription); slot_ = OpenSoftwareNSSDB(temp_dir_.GetPath(), kTestDescription);
} }
ScopedTestNSSDB::~ScopedTestNSSDB() { ScopedTestNSSDB::~ScopedTestNSSDB() {
......
...@@ -55,7 +55,7 @@ class BaseRequestsServerTest : public testing::Test { ...@@ -55,7 +55,7 @@ class BaseRequestsServerTest : public testing::Test {
// Returns a temporary file path suitable for storing the cache file. // Returns a temporary file path suitable for storing the cache file.
base::FilePath GetTestCachedFilePath(const base::FilePath& file_name) { base::FilePath GetTestCachedFilePath(const base::FilePath& file_name) {
return temp_dir_.path().Append(file_name); return temp_dir_.GetPath().Append(file_name);
} }
base::MessageLoopForIO message_loop_; // Test server needs IO thread. base::MessageLoopForIO message_loop_; // Test server needs IO thread.
......
...@@ -1056,7 +1056,7 @@ TEST_F(DriveApiRequestsTest, UploadNewFileRequest) { ...@@ -1056,7 +1056,7 @@ TEST_F(DriveApiRequestsTest, UploadNewFileRequest) {
const char kTestContentType[] = "text/plain"; const char kTestContentType[] = "text/plain";
const std::string kTestContent(100, 'a'); const std::string kTestContent(100, 'a');
const base::FilePath kTestFilePath = const base::FilePath kTestFilePath =
temp_dir_.path().AppendASCII("upload_file.txt"); temp_dir_.GetPath().AppendASCII("upload_file.txt");
ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent)); ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent));
DriveApiErrorCode error = DRIVE_OTHER_ERROR; DriveApiErrorCode error = DRIVE_OTHER_ERROR;
...@@ -1154,7 +1154,7 @@ TEST_F(DriveApiRequestsTest, UploadNewEmptyFileRequest) { ...@@ -1154,7 +1154,7 @@ TEST_F(DriveApiRequestsTest, UploadNewEmptyFileRequest) {
const char kTestContentType[] = "text/plain"; const char kTestContentType[] = "text/plain";
const char kTestContent[] = ""; const char kTestContent[] = "";
const base::FilePath kTestFilePath = const base::FilePath kTestFilePath =
temp_dir_.path().AppendASCII("empty_file.txt"); temp_dir_.GetPath().AppendASCII("empty_file.txt");
ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent)); ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent));
DriveApiErrorCode error = DRIVE_OTHER_ERROR; DriveApiErrorCode error = DRIVE_OTHER_ERROR;
...@@ -1243,7 +1243,7 @@ TEST_F(DriveApiRequestsTest, UploadNewLargeFileRequest) { ...@@ -1243,7 +1243,7 @@ TEST_F(DriveApiRequestsTest, UploadNewLargeFileRequest) {
const size_t kNumChunkBytes = 10; // Num bytes in a chunk. const size_t kNumChunkBytes = 10; // Num bytes in a chunk.
const std::string kTestContent(100, 'a'); const std::string kTestContent(100, 'a');
const base::FilePath kTestFilePath = const base::FilePath kTestFilePath =
temp_dir_.path().AppendASCII("upload_file.txt"); temp_dir_.GetPath().AppendASCII("upload_file.txt");
ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent)); ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent));
DriveApiErrorCode error = DRIVE_OTHER_ERROR; DriveApiErrorCode error = DRIVE_OTHER_ERROR;
...@@ -1476,7 +1476,7 @@ TEST_F(DriveApiRequestsTest, UploadExistingFileRequest) { ...@@ -1476,7 +1476,7 @@ TEST_F(DriveApiRequestsTest, UploadExistingFileRequest) {
const char kTestContentType[] = "text/plain"; const char kTestContentType[] = "text/plain";
const std::string kTestContent(100, 'a'); const std::string kTestContent(100, 'a');
const base::FilePath kTestFilePath = const base::FilePath kTestFilePath =
temp_dir_.path().AppendASCII("upload_file.txt"); temp_dir_.GetPath().AppendASCII("upload_file.txt");
ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent)); ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent));
DriveApiErrorCode error = DRIVE_OTHER_ERROR; DriveApiErrorCode error = DRIVE_OTHER_ERROR;
...@@ -1568,7 +1568,7 @@ TEST_F(DriveApiRequestsTest, UploadExistingFileRequestWithETag) { ...@@ -1568,7 +1568,7 @@ TEST_F(DriveApiRequestsTest, UploadExistingFileRequestWithETag) {
const char kTestContentType[] = "text/plain"; const char kTestContentType[] = "text/plain";
const std::string kTestContent(100, 'a'); const std::string kTestContent(100, 'a');
const base::FilePath kTestFilePath = const base::FilePath kTestFilePath =
temp_dir_.path().AppendASCII("upload_file.txt"); temp_dir_.GetPath().AppendASCII("upload_file.txt");
ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent)); ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent));
DriveApiErrorCode error = DRIVE_OTHER_ERROR; DriveApiErrorCode error = DRIVE_OTHER_ERROR;
...@@ -1702,7 +1702,7 @@ TEST_F(DriveApiRequestsTest, ...@@ -1702,7 +1702,7 @@ TEST_F(DriveApiRequestsTest,
const char kTestContentType[] = "text/plain"; const char kTestContentType[] = "text/plain";
const std::string kTestContent(100, 'a'); const std::string kTestContent(100, 'a');
const base::FilePath kTestFilePath = const base::FilePath kTestFilePath =
temp_dir_.path().AppendASCII("upload_file.txt"); temp_dir_.GetPath().AppendASCII("upload_file.txt");
ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent)); ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent));
DriveApiErrorCode error = DRIVE_OTHER_ERROR; DriveApiErrorCode error = DRIVE_OTHER_ERROR;
...@@ -1851,7 +1851,7 @@ TEST_F(DriveApiRequestsTest, UploadExistingFileWithMetadataRequest) { ...@@ -1851,7 +1851,7 @@ TEST_F(DriveApiRequestsTest, UploadExistingFileWithMetadataRequest) {
TEST_F(DriveApiRequestsTest, DownloadFileRequest) { TEST_F(DriveApiRequestsTest, DownloadFileRequest) {
const base::FilePath kDownloadedFilePath = const base::FilePath kDownloadedFilePath =
temp_dir_.path().AppendASCII("cache_file"); temp_dir_.GetPath().AppendASCII("cache_file");
const std::string kTestId("dummyId"); const std::string kTestId("dummyId");
DriveApiErrorCode result_code = DRIVE_OTHER_ERROR; DriveApiErrorCode result_code = DRIVE_OTHER_ERROR;
...@@ -1888,7 +1888,7 @@ TEST_F(DriveApiRequestsTest, DownloadFileRequest) { ...@@ -1888,7 +1888,7 @@ TEST_F(DriveApiRequestsTest, DownloadFileRequest) {
TEST_F(DriveApiRequestsTest, DownloadFileRequest_GetContentCallback) { TEST_F(DriveApiRequestsTest, DownloadFileRequest_GetContentCallback) {
const base::FilePath kDownloadedFilePath = const base::FilePath kDownloadedFilePath =
temp_dir_.path().AppendASCII("cache_file"); temp_dir_.GetPath().AppendASCII("cache_file");
const std::string kTestId("dummyId"); const std::string kTestId("dummyId");
DriveApiErrorCode result_code = DRIVE_OTHER_ERROR; DriveApiErrorCode result_code = DRIVE_OTHER_ERROR;
...@@ -2001,7 +2001,7 @@ TEST_F(DriveApiRequestsTest, BatchUploadRequest) { ...@@ -2001,7 +2001,7 @@ TEST_F(DriveApiRequestsTest, BatchUploadRequest) {
const char kTestContentType[] = "text/plain"; const char kTestContentType[] = "text/plain";
const std::string kTestContent(10, 'a'); const std::string kTestContent(10, 'a');
const base::FilePath kTestFilePath = const base::FilePath kTestFilePath =
temp_dir_.path().AppendASCII("upload_file.txt"); temp_dir_.GetPath().AppendASCII("upload_file.txt");
ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent)); ASSERT_TRUE(test_util::WriteStringToFile(kTestFilePath, kTestContent));
// Create batch request. // Create batch request.
......
...@@ -88,7 +88,7 @@ std::unique_ptr<GCMStoreImpl> GCMStoreImplTest::BuildGCMStore() { ...@@ -88,7 +88,7 @@ std::unique_ptr<GCMStoreImpl> GCMStoreImplTest::BuildGCMStore() {
// Pass an non-existent directory as store path to match the exact // Pass an non-existent directory as store path to match the exact
// behavior in the production code. Currently GCMStoreImpl checks if // behavior in the production code. Currently GCMStoreImpl checks if
// the directory exist or not to determine the store existence. // the directory exist or not to determine the store existence.
temp_directory_.path().Append(FILE_PATH_LITERAL("GCM Store")), temp_directory_.GetPath().Append(FILE_PATH_LITERAL("GCM Store")),
task_runner_, base::WrapUnique<Encryptor>(new FakeEncryptor))); task_runner_, base::WrapUnique<Encryptor>(new FakeEncryptor)));
} }
......
...@@ -205,7 +205,7 @@ void MCSClientTest::SetUp() { ...@@ -205,7 +205,7 @@ void MCSClientTest::SetUp() {
void MCSClientTest::BuildMCSClient() { void MCSClientTest::BuildMCSClient() {
gcm_store_.reset( gcm_store_.reset(
new GCMStoreImpl(temp_directory_.path(), message_loop_.task_runner(), new GCMStoreImpl(temp_directory_.GetPath(), message_loop_.task_runner(),
base::WrapUnique<Encryptor>(new FakeEncryptor))); base::WrapUnique<Encryptor>(new FakeEncryptor)));
mcs_client_.reset(new TestMCSClient(&clock_, mcs_client_.reset(new TestMCSClient(&clock_,
&connection_factory_, &connection_factory_,
......
...@@ -213,12 +213,12 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, UserDataDir) { ...@@ -213,12 +213,12 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, UserDataDir) {
ASSERT_TRUE(user_data_dir.CreateUniqueTempDir()); ASSERT_TRUE(user_data_dir.CreateUniqueTempDir());
// Newly created temp directory should be empty. // Newly created temp directory should be empty.
EXPECT_TRUE(base::IsDirectoryEmpty(user_data_dir.path())); EXPECT_TRUE(base::IsDirectoryEmpty(user_data_dir.GetPath()));
HeadlessBrowserContext* browser_context = HeadlessBrowserContext* browser_context =
browser() browser()
->CreateBrowserContextBuilder() ->CreateBrowserContextBuilder()
.SetUserDataDir(user_data_dir.path()) .SetUserDataDir(user_data_dir.GetPath())
.SetIncognitoMode(false) .SetIncognitoMode(false)
.Build(); .Build();
...@@ -232,7 +232,7 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, UserDataDir) { ...@@ -232,7 +232,7 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, UserDataDir) {
// Something should be written to this directory. // Something should be written to this directory.
// If it is not the case, more complex page may be needed. // If it is not the case, more complex page may be needed.
// ServiceWorkers may be a good option. // ServiceWorkers may be a good option.
EXPECT_FALSE(base::IsDirectoryEmpty(user_data_dir.path())); EXPECT_FALSE(base::IsDirectoryEmpty(user_data_dir.GetPath()));
} }
IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, IncognitoMode) { IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, IncognitoMode) {
...@@ -246,12 +246,12 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, IncognitoMode) { ...@@ -246,12 +246,12 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, IncognitoMode) {
ASSERT_TRUE(user_data_dir.CreateUniqueTempDir()); ASSERT_TRUE(user_data_dir.CreateUniqueTempDir());
// Newly created temp directory should be empty. // Newly created temp directory should be empty.
EXPECT_TRUE(base::IsDirectoryEmpty(user_data_dir.path())); EXPECT_TRUE(base::IsDirectoryEmpty(user_data_dir.GetPath()));
HeadlessBrowserContext* browser_context = HeadlessBrowserContext* browser_context =
browser() browser()
->CreateBrowserContextBuilder() ->CreateBrowserContextBuilder()
.SetUserDataDir(user_data_dir.path()) .SetUserDataDir(user_data_dir.GetPath())
.SetIncognitoMode(true) .SetIncognitoMode(true)
.Build(); .Build();
...@@ -264,7 +264,7 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, IncognitoMode) { ...@@ -264,7 +264,7 @@ IN_PROC_BROWSER_TEST_F(HeadlessBrowserTest, IncognitoMode) {
// Similar to test above, but now we are in incognito mode, // Similar to test above, but now we are in incognito mode,
// so nothing should be written to this directory. // so nothing should be written to this directory.
EXPECT_TRUE(base::IsDirectoryEmpty(user_data_dir.path())); EXPECT_TRUE(base::IsDirectoryEmpty(user_data_dir.GetPath()));
} }
} // namespace headless } // namespace headless
...@@ -112,7 +112,7 @@ base::FilePath CreateTempBrowserStateDir(base::ScopedTempDir* temp_dir) { ...@@ -112,7 +112,7 @@ base::FilePath CreateTempBrowserStateDir(base::ScopedTempDir* temp_dir) {
CHECK(temp_dir->Set(system_tmp_dir)); CHECK(temp_dir->Set(system_tmp_dir));
} }
} }
return temp_dir->path(); return temp_dir->GetPath();
} }
} // namespace } // namespace
......
...@@ -820,8 +820,8 @@ TEST_F(IPCAttachmentBrokerMacTest, SendPosixFDAndMachPort) { ...@@ -820,8 +820,8 @@ TEST_F(IPCAttachmentBrokerMacTest, SendPosixFDAndMachPort) {
base::ScopedTempDir temp_dir; base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
base::FilePath fp1, fp2; base::FilePath fp1, fp2;
ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.path(), &fp1)); ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.GetPath(), &fp1));
ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.path(), &fp2)); ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.GetPath(), &fp2));
CommonSetUp("SendPosixFDAndMachPort"); CommonSetUp("SendPosixFDAndMachPort");
......
...@@ -255,7 +255,8 @@ class IPCAttachmentBrokerPrivilegedWinTest : public IPCTestBase { ...@@ -255,7 +255,8 @@ class IPCAttachmentBrokerPrivilegedWinTest : public IPCTestBase {
void SetUp() override { void SetUp() override {
IPCTestBase::SetUp(); IPCTestBase::SetUp();
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &temp_path_)); ASSERT_TRUE(
base::CreateTemporaryFileInDir(temp_dir_.GetPath(), &temp_path_));
} }
void TearDown() override { IPCTestBase::TearDown(); } void TearDown() override { IPCTestBase::TearDown(); }
......
...@@ -1378,7 +1378,7 @@ TEST_F(IPCChannelMojoTest, SendPlatformHandle) { ...@@ -1378,7 +1378,7 @@ TEST_F(IPCChannelMojoTest, SendPlatformHandle) {
base::ScopedTempDir temp_dir; base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
base::File file(HandleSendingHelper::GetSendingFilePath(temp_dir.path()), base::File file(HandleSendingHelper::GetSendingFilePath(temp_dir.GetPath()),
base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE | base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE |
base::File::FLAG_READ); base::File::FLAG_READ);
HandleSendingHelper::WriteFileThenSend(channel(), file); HandleSendingHelper::WriteFileThenSend(channel(), file);
...@@ -1434,7 +1434,7 @@ TEST_F(IPCChannelMojoTest, SendPlatformHandleAndPipe) { ...@@ -1434,7 +1434,7 @@ TEST_F(IPCChannelMojoTest, SendPlatformHandleAndPipe) {
base::ScopedTempDir temp_dir; base::ScopedTempDir temp_dir;
ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
base::File file(HandleSendingHelper::GetSendingFilePath(temp_dir.path()), base::File file(HandleSendingHelper::GetSendingFilePath(temp_dir.GetPath()),
base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE | base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE |
base::File::FLAG_READ); base::File::FLAG_READ);
TestingMessagePipe pipe; TestingMessagePipe pipe;
......
...@@ -153,7 +153,7 @@ TEST_F(PlatformChannelPairPosixTest, SendReceiveFDs) { ...@@ -153,7 +153,7 @@ TEST_F(PlatformChannelPairPosixTest, SendReceiveFDs) {
for (size_t j = 1; j <= i; j++) { for (size_t j = 1; j <= i; j++) {
base::FilePath unused; base::FilePath unused;
base::ScopedFILE fp( base::ScopedFILE fp(
base::CreateAndOpenTemporaryFileInDir(temp_dir.path(), &unused)); base::CreateAndOpenTemporaryFileInDir(temp_dir.GetPath(), &unused));
ASSERT_TRUE(fp); ASSERT_TRUE(fp);
ASSERT_EQ(j, fwrite(std::string(j, c).data(), 1, j, fp.get())); ASSERT_EQ(j, fwrite(std::string(j, c).data(), 1, j, fp.get()));
platform_handles->push_back( platform_handles->push_back(
...@@ -209,7 +209,7 @@ TEST_F(PlatformChannelPairPosixTest, AppendReceivedFDs) { ...@@ -209,7 +209,7 @@ TEST_F(PlatformChannelPairPosixTest, AppendReceivedFDs) {
{ {
base::FilePath unused; base::FilePath unused;
base::ScopedFILE fp( base::ScopedFILE fp(
base::CreateAndOpenTemporaryFileInDir(temp_dir.path(), &unused)); base::CreateAndOpenTemporaryFileInDir(temp_dir.GetPath(), &unused));
ASSERT_TRUE(fp); ASSERT_TRUE(fp);
ASSERT_EQ(file_contents.size(), ASSERT_EQ(file_contents.size(),