Chromium Code Reviews| Index: chrome/installer/util/shell_util_unittest.cc |
| diff --git a/chrome/installer/util/shell_util_unittest.cc b/chrome/installer/util/shell_util_unittest.cc |
| index 45b57386337db54971c2d31a8726f0cdd29cdc23..026f6aedfae2ff62d87adc5a773aa1e9f4ff4f2d 100644 |
| --- a/chrome/installer/util/shell_util_unittest.cc |
| +++ b/chrome/installer/util/shell_util_unittest.cc |
| @@ -100,7 +100,8 @@ class ShellUtilShortcutTest : public testing::Test { |
| case ShellUtil::SHORTCUT_LOCATION_START_MENU: |
| expected_path = (properties.level == ShellUtil::CURRENT_USER) ? |
| fake_start_menu_.path() : fake_common_start_menu_.path(); |
| - expected_path = expected_path.Append(dist_->GetAppShortCutName()); |
| + expected_path = expected_path.Append( |
| + dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME)); |
|
gab
2013/07/22 16:09:14
This should be GetSubfolder().
calamity
2013/08/13 10:29:08
Done.
|
| break; |
| default: |
| ADD_FAILURE() << "Unknown location"; |
| @@ -108,10 +109,12 @@ class ShellUtilShortcutTest : public testing::Test { |
| } |
| string16 shortcut_name; |
| - if (properties.has_shortcut_name()) |
| + if (properties.has_shortcut_name()) { |
| shortcut_name = properties.shortcut_name; |
| - else |
| - shortcut_name = dist_->GetAppShortCutName(); |
| + } else { |
| + shortcut_name = |
| + dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME); |
| + } |
| shortcut_name.append(installer::kLnkExt); |
| expected_path = expected_path.Append(shortcut_name); |
| @@ -132,7 +135,7 @@ class ShellUtilShortcutTest : public testing::Test { |
| if (properties.has_icon()) { |
| expected_properties.set_icon(properties.icon, 0); |
| } else { |
| - int icon_index = dist->GetIconIndex(); |
| + int icon_index = dist->GetIconIndex(BrowserDistribution::SHORTCUT_CHROME); |
| expected_properties.set_icon(chrome_exe_, icon_index); |
| } |
| @@ -192,10 +195,13 @@ TEST_F(ShellUtilShortcutTest, GetShortcutPath) { |
| EXPECT_EQ(fake_default_user_quick_launch_.path(), path); |
| ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_START_MENU, dist_, |
| ShellUtil::CURRENT_USER, &path); |
| - EXPECT_EQ(fake_start_menu_.path().Append(dist_->GetAppShortCutName()), path); |
| + EXPECT_EQ(fake_start_menu_.path().Append( |
| + dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME)), |
|
gab
2013/07/22 16:09:14
This should be GetSubFolder().
calamity
2013/08/13 10:29:08
Done.
|
| + path); |
| ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_START_MENU, dist_, |
| ShellUtil::SYSTEM_LEVEL, &path); |
| - EXPECT_EQ(fake_common_start_menu_.path().Append(dist_->GetAppShortCutName()), |
| + EXPECT_EQ(fake_common_start_menu_.path().Append( |
| + dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME)), |
|
gab
2013/07/22 16:09:14
This should be GetSubFolder().
calamity
2013/08/13 10:29:08
Done.
|
| path); |
| } |
| @@ -299,7 +305,9 @@ TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevel) { |
| } |
| TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevelWithSystemLevelPresent) { |
| - string16 shortcut_name(dist_->GetAppShortCutName() + installer::kLnkExt); |
| + string16 shortcut_name( |
| + dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME) + |
| + installer::kLnkExt); |
| test_properties_->level = ShellUtil::SYSTEM_LEVEL; |
| ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( |
| @@ -328,7 +336,9 @@ TEST_F(ShellUtilShortcutTest, CreateIfNoSystemLevelStartMenu) { |
| } |
| TEST_F(ShellUtilShortcutTest, CreateAlwaysUserWithSystemLevelPresent) { |
| - string16 shortcut_name(dist_->GetAppShortCutName() + installer::kLnkExt); |
| + string16 shortcut_name( |
| + dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME) + |
| + installer::kLnkExt); |
| test_properties_->level = ShellUtil::SYSTEM_LEVEL; |
| ASSERT_TRUE(ShellUtil::CreateOrUpdateShortcut( |
| @@ -353,7 +363,9 @@ TEST_F(ShellUtilShortcutTest, RemoveChromeShortcut) { |
| *test_properties_, |
| ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); |
| - string16 shortcut_name(dist_->GetAppShortCutName() + installer::kLnkExt); |
| + string16 shortcut_name( |
| + dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME) + |
| + installer::kLnkExt); |
| base::FilePath shortcut_path(fake_user_desktop_.path().Append(shortcut_name)); |
| ASSERT_TRUE(base::PathExists(shortcut_path)); |
| @@ -371,7 +383,9 @@ TEST_F(ShellUtilShortcutTest, RemoveSystemLevelChromeShortcut) { |
| *test_properties_, |
| ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); |
| - string16 shortcut_name(dist_->GetAppShortCutName() + installer::kLnkExt); |
| + string16 shortcut_name( |
| + dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME) + |
| + installer::kLnkExt); |
| base::FilePath shortcut_path( |
| fake_common_desktop_.path().Append(shortcut_name)); |
| ASSERT_TRUE(base::PathExists(shortcut_path)); |
| @@ -423,7 +437,9 @@ TEST_F(ShellUtilShortcutTest, UpdateChromeShortcut) { |
| *test_properties_, |
| ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); |
| - string16 shortcut_name(dist_->GetAppShortCutName() + installer::kLnkExt); |
| + string16 shortcut_name( |
| + dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME) + |
| + installer::kLnkExt); |
| base::FilePath shortcut_path(fake_user_desktop_.path().Append(shortcut_name)); |
| ASSERT_TRUE(base::PathExists(shortcut_path)); |
| @@ -448,7 +464,9 @@ TEST_F(ShellUtilShortcutTest, UpdateSystemLevelChromeShortcut) { |
| *test_properties_, |
| ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); |
| - string16 shortcut_name(dist_->GetAppShortCutName() + installer::kLnkExt); |
| + string16 shortcut_name( |
| + dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME) + |
| + installer::kLnkExt); |
| base::FilePath shortcut_path( |
| fake_common_desktop_.path().Append(shortcut_name)); |
| ASSERT_TRUE(base::PathExists(shortcut_path)); |
| @@ -526,7 +544,8 @@ TEST_F(ShellUtilShortcutTest, CreateMultipleStartMenuShortcutsAndRemoveFolder) { |
| ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); |
| base::FilePath shortcut_folder( |
| - fake_start_menu_.path().Append(dist_->GetAppShortCutName())); |
| + fake_start_menu_.path().Append( |
| + dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME))); |
|
gab
2013/07/22 16:09:14
This should be GetSubFolder().
calamity
2013/08/13 10:29:08
Done.
calamity
2013/08/13 10:29:08
Done.
|
| base::FileEnumerator file_counter(shortcut_folder, false, |
| base::FileEnumerator::FILES); |
| int count = 0; |
| @@ -554,7 +573,9 @@ TEST_F(ShellUtilShortcutTest, DontRemoveChromeShortcutIfPointsToAnotherChrome) { |
| *test_properties_, |
| ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS)); |
| - string16 shortcut_name(dist_->GetAppShortCutName() + installer::kLnkExt); |
| + string16 shortcut_name( |
| + dist_->GetShortcutName(BrowserDistribution::SHORTCUT_CHROME) + |
| + installer::kLnkExt); |
| base::FilePath shortcut_path(fake_user_desktop_.path().Append(shortcut_name)); |
| ASSERT_TRUE(base::PathExists(shortcut_path)); |