| Index: chrome/browser/shell_integration_linux_unittest.cc
|
| diff --git a/chrome/browser/shell_integration_linux_unittest.cc b/chrome/browser/shell_integration_linux_unittest.cc
|
| index b66e110087d5bd99caf23af8e74fde061ae01d29..3617daeea7c6eec0a2336d912bf9e986fd76c5b0 100644
|
| --- a/chrome/browser/shell_integration_linux_unittest.cc
|
| +++ b/chrome/browser/shell_integration_linux_unittest.cc
|
| @@ -213,7 +213,7 @@ TEST(ShellIntegrationTest, GetExistingShortcutLocations) {
|
| {
|
| base::ScopedTempDir temp_dir;
|
| ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
|
| - base::FilePath desktop_path = temp_dir.path();
|
| + base::FilePath desktop_path = temp_dir.GetPath();
|
|
|
| MockEnvironment env;
|
| ASSERT_TRUE(base::CreateDirectory(desktop_path));
|
| @@ -231,10 +231,10 @@ TEST(ShellIntegrationTest, GetExistingShortcutLocations) {
|
| {
|
| base::ScopedTempDir temp_dir;
|
| ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
|
| - base::FilePath apps_path = temp_dir.path().Append("applications");
|
| + base::FilePath apps_path = temp_dir.GetPath().Append("applications");
|
|
|
| MockEnvironment env;
|
| - env.Set("XDG_DATA_HOME", temp_dir.path().value());
|
| + env.Set("XDG_DATA_HOME", temp_dir.GetPath().value());
|
| ASSERT_TRUE(base::CreateDirectory(apps_path));
|
| ASSERT_TRUE(WriteEmptyFile(apps_path.Append(kTemplateFilename)));
|
| web_app::ShortcutLocations result =
|
| @@ -250,10 +250,10 @@ TEST(ShellIntegrationTest, GetExistingShortcutLocations) {
|
| {
|
| base::ScopedTempDir temp_dir;
|
| ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
|
| - base::FilePath apps_path = temp_dir.path().Append("applications");
|
| + base::FilePath apps_path = temp_dir.GetPath().Append("applications");
|
|
|
| MockEnvironment env;
|
| - env.Set("XDG_DATA_HOME", temp_dir.path().value());
|
| + env.Set("XDG_DATA_HOME", temp_dir.GetPath().value());
|
| ASSERT_TRUE(base::CreateDirectory(apps_path));
|
| ASSERT_TRUE(WriteString(apps_path.Append(kTemplateFilename),
|
| kNoDisplayDesktopFile));
|
| @@ -270,16 +270,16 @@ TEST(ShellIntegrationTest, GetExistingShortcutLocations) {
|
| {
|
| base::ScopedTempDir temp_dir1;
|
| ASSERT_TRUE(temp_dir1.CreateUniqueTempDir());
|
| - base::FilePath desktop_path = temp_dir1.path();
|
| + base::FilePath desktop_path = temp_dir1.GetPath();
|
|
|
| base::ScopedTempDir temp_dir2;
|
| ASSERT_TRUE(temp_dir2.CreateUniqueTempDir());
|
| - base::FilePath apps_path = temp_dir2.path().Append("applications");
|
| + base::FilePath apps_path = temp_dir2.GetPath().Append("applications");
|
|
|
| MockEnvironment env;
|
| ASSERT_TRUE(base::CreateDirectory(desktop_path));
|
| ASSERT_TRUE(WriteEmptyFile(desktop_path.Append(kTemplateFilename)));
|
| - env.Set("XDG_DATA_HOME", temp_dir2.path().value());
|
| + env.Set("XDG_DATA_HOME", temp_dir2.GetPath().value());
|
| ASSERT_TRUE(base::CreateDirectory(apps_path));
|
| ASSERT_TRUE(WriteEmptyFile(apps_path.Append(kTemplateFilename)));
|
| web_app::ShortcutLocations result = GetExistingShortcutLocations(
|
| @@ -306,14 +306,14 @@ TEST(ShellIntegrationTest, GetExistingShortcutContents) {
|
| ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
|
|
|
| MockEnvironment env;
|
| - env.Set("XDG_DATA_HOME", temp_dir.path().value());
|
| + env.Set("XDG_DATA_HOME", temp_dir.GetPath().value());
|
| // Create a file in a non-applications directory. This should be ignored.
|
| - ASSERT_TRUE(WriteString(temp_dir.path().Append(kTemplateFilename),
|
| - kTestData2));
|
| - ASSERT_TRUE(base::CreateDirectory(
|
| - temp_dir.path().Append("applications")));
|
| + ASSERT_TRUE(
|
| + WriteString(temp_dir.GetPath().Append(kTemplateFilename), kTestData2));
|
| + ASSERT_TRUE(
|
| + base::CreateDirectory(temp_dir.GetPath().Append("applications")));
|
| ASSERT_TRUE(WriteString(
|
| - temp_dir.path().Append("applications").Append(kTemplateFilename),
|
| + temp_dir.GetPath().Append("applications").Append(kTemplateFilename),
|
| kTestData1));
|
| std::string contents;
|
| ASSERT_TRUE(
|
| @@ -327,16 +327,15 @@ TEST(ShellIntegrationTest, GetExistingShortcutContents) {
|
| ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
|
|
|
| MockEnvironment env;
|
| - base::ScopedPathOverride home_override(base::DIR_HOME,
|
| - temp_dir.path(),
|
| + base::ScopedPathOverride home_override(base::DIR_HOME, temp_dir.GetPath(),
|
| true /* absolute? */,
|
| false /* create? */);
|
| ASSERT_TRUE(base::CreateDirectory(
|
| - temp_dir.path().Append(".local/share/applications")));
|
| - ASSERT_TRUE(WriteString(
|
| - temp_dir.path().Append(".local/share/applications")
|
| - .Append(kTemplateFilename),
|
| - kTestData1));
|
| + temp_dir.GetPath().Append(".local/share/applications")));
|
| + ASSERT_TRUE(WriteString(temp_dir.GetPath()
|
| + .Append(".local/share/applications")
|
| + .Append(kTemplateFilename),
|
| + kTestData1));
|
| std::string contents;
|
| ASSERT_TRUE(
|
| GetExistingShortcutContents(&env, kTemplateFilepath, &contents));
|
| @@ -349,11 +348,11 @@ TEST(ShellIntegrationTest, GetExistingShortcutContents) {
|
| ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
|
|
|
| MockEnvironment env;
|
| - env.Set("XDG_DATA_DIRS", temp_dir.path().value());
|
| - ASSERT_TRUE(base::CreateDirectory(
|
| - temp_dir.path().Append("applications")));
|
| + env.Set("XDG_DATA_DIRS", temp_dir.GetPath().value());
|
| + ASSERT_TRUE(
|
| + base::CreateDirectory(temp_dir.GetPath().Append("applications")));
|
| ASSERT_TRUE(WriteString(
|
| - temp_dir.path().Append("applications").Append(kTemplateFilename),
|
| + temp_dir.GetPath().Append("applications").Append(kTemplateFilename),
|
| kTestData2));
|
| std::string contents;
|
| ASSERT_TRUE(
|
| @@ -369,16 +368,16 @@ TEST(ShellIntegrationTest, GetExistingShortcutContents) {
|
| ASSERT_TRUE(temp_dir2.CreateUniqueTempDir());
|
|
|
| MockEnvironment env;
|
| - env.Set("XDG_DATA_DIRS", temp_dir1.path().value() + ":" +
|
| - temp_dir2.path().value());
|
| + env.Set("XDG_DATA_DIRS",
|
| + temp_dir1.GetPath().value() + ":" + temp_dir2.GetPath().value());
|
| // Create a file in a non-applications directory. This should be ignored.
|
| - ASSERT_TRUE(WriteString(temp_dir1.path().Append(kTemplateFilename),
|
| - kTestData1));
|
| + ASSERT_TRUE(
|
| + WriteString(temp_dir1.GetPath().Append(kTemplateFilename), kTestData1));
|
| // Only create a findable desktop file in the second path.
|
| - ASSERT_TRUE(base::CreateDirectory(
|
| - temp_dir2.path().Append("applications")));
|
| + ASSERT_TRUE(
|
| + base::CreateDirectory(temp_dir2.GetPath().Append("applications")));
|
| ASSERT_TRUE(WriteString(
|
| - temp_dir2.path().Append("applications").Append(kTemplateFilename),
|
| + temp_dir2.GetPath().Append("applications").Append(kTemplateFilename),
|
| kTestData2));
|
| std::string contents;
|
| ASSERT_TRUE(
|
| @@ -405,12 +404,12 @@ TEST(ShellIntegrationTest, GetExistingProfileShortcutFilenames) {
|
|
|
| base::ScopedTempDir temp_dir;
|
| ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
|
| - ASSERT_TRUE(WriteEmptyFile(temp_dir.path().Append(kApp1Filename)));
|
| - ASSERT_TRUE(WriteEmptyFile(temp_dir.path().Append(kApp2Filename)));
|
| + ASSERT_TRUE(WriteEmptyFile(temp_dir.GetPath().Append(kApp1Filename)));
|
| + ASSERT_TRUE(WriteEmptyFile(temp_dir.GetPath().Append(kApp2Filename)));
|
| // This file should not be returned in the results.
|
| - ASSERT_TRUE(WriteEmptyFile(temp_dir.path().Append(kUnrelatedAppFilename)));
|
| + ASSERT_TRUE(WriteEmptyFile(temp_dir.GetPath().Append(kUnrelatedAppFilename)));
|
| std::vector<base::FilePath> paths =
|
| - GetExistingProfileShortcutFilenames(kProfilePath, temp_dir.path());
|
| + GetExistingProfileShortcutFilenames(kProfilePath, temp_dir.GetPath());
|
| // Path order is arbitrary. Sort the output for consistency.
|
| std::sort(paths.begin(), paths.end());
|
| EXPECT_THAT(paths,
|
|
|