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

Unified Diff: chrome/installer/setup/install_unittest.cc

Issue 1405993006: Revert of Change shortcut install location to non-subdir. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « chrome/installer/setup/install.cc ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/install_unittest.cc
diff --git a/chrome/installer/setup/install_unittest.cc b/chrome/installer/setup/install_unittest.cc
index 0cb3e8fd26f4e2a708c1a75976d55e7c4c52a7db..6f8b9c09c152e5ad2329929a30ec979c23f263ed 100644
--- a/chrome/installer/setup/install_unittest.cc
+++ b/chrome/installer/setup/install_unittest.cc
@@ -125,21 +125,18 @@
fake_user_desktop_.path().Append(shortcut_name);
user_quick_launch_shortcut_ =
fake_user_quick_launch_.path().Append(shortcut_name);
- user_start_menu_shortcut_ = fake_start_menu_.path().Append(shortcut_name);
- user_start_menu_subdir_shortcut_ =
- fake_start_menu_.path()
- .Append(dist_->GetStartMenuShortcutSubfolder(
+ user_start_menu_shortcut_ =
+ fake_start_menu_.path().Append(
+ dist_->GetStartMenuShortcutSubfolder(
BrowserDistribution::SUBFOLDER_CHROME))
- .Append(shortcut_name);
+ .Append(shortcut_name);
system_desktop_shortcut_ =
fake_common_desktop_.path().Append(shortcut_name);
system_start_menu_shortcut_ =
- fake_common_start_menu_.path().Append(shortcut_name);
- system_start_menu_subdir_shortcut_ =
- fake_common_start_menu_.path()
- .Append(dist_->GetStartMenuShortcutSubfolder(
+ fake_common_start_menu_.path().Append(
+ dist_->GetStartMenuShortcutSubfolder(
BrowserDistribution::SUBFOLDER_CHROME))
- .Append(shortcut_name);
+ .Append(shortcut_name);
user_alternate_desktop_shortcut_ =
fake_user_desktop_.path().Append(alternate_shortcut_name);
}
@@ -148,9 +145,7 @@
// Try to unpin potentially pinned shortcuts (although pinning isn't tested,
// the call itself might still have pinned the Start Menu shortcuts).
base::win::UnpinShortcutFromTaskbar(user_start_menu_shortcut_);
- base::win::UnpinShortcutFromTaskbar(user_start_menu_subdir_shortcut_);
base::win::UnpinShortcutFromTaskbar(system_start_menu_shortcut_);
- base::win::UnpinShortcutFromTaskbar(system_start_menu_subdir_shortcut_);
CoUninitialize();
}
@@ -205,10 +200,8 @@
base::FilePath user_desktop_shortcut_;
base::FilePath user_quick_launch_shortcut_;
base::FilePath user_start_menu_shortcut_;
- base::FilePath user_start_menu_subdir_shortcut_;
base::FilePath system_desktop_shortcut_;
base::FilePath system_start_menu_shortcut_;
- base::FilePath system_start_menu_subdir_shortcut_;
base::FilePath user_alternate_desktop_shortcut_;
};
@@ -382,69 +375,6 @@
ASSERT_FALSE(base::PathExists(user_start_menu_shortcut_));
}
-class MigrateShortcutTest : public InstallShortcutTest,
- public testing::WithParamInterface<
- testing::tuple<
- installer::InstallShortcutOperation,
- installer::InstallShortcutLevel>> {
- public:
- MigrateShortcutTest() : shortcut_operation_(testing::get<0>(GetParam())),
- shortcut_level_(testing::get<1>(GetParam())) {}
-
- protected:
- const installer::InstallShortcutOperation shortcut_operation_;
- const installer::InstallShortcutLevel shortcut_level_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MigrateShortcutTest);
-};
-
-TEST_P(MigrateShortcutTest, MigrateAwayFromDeprecatedStartMenuTest) {
- base::win::ShortcutProperties dummy_properties;
- base::FilePath dummy_target;
- ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &dummy_target));
- dummy_properties.set_target(expected_properties_.target);
- dummy_properties.set_working_dir(fake_user_desktop_.path());
- dummy_properties.set_arguments(L"--dummy --args");
- dummy_properties.set_app_id(L"El.Dummiest");
-
- base::FilePath start_menu_shortcut;
- base::FilePath start_menu_subdir_shortcut;
- if (shortcut_level_ == installer::CURRENT_USER) {
- start_menu_shortcut = user_start_menu_shortcut_;
- start_menu_subdir_shortcut = user_start_menu_subdir_shortcut_;
- } else {
- start_menu_shortcut = system_start_menu_shortcut_;
- start_menu_subdir_shortcut = system_start_menu_subdir_shortcut_;
- }
-
- ASSERT_TRUE(base::CreateDirectory(start_menu_subdir_shortcut.DirName()));
- ASSERT_FALSE(base::PathExists(start_menu_subdir_shortcut));
- ASSERT_TRUE(base::win::CreateOrUpdateShortcutLink(
- start_menu_subdir_shortcut, dummy_properties,
- base::win::SHORTCUT_CREATE_ALWAYS));
- ASSERT_TRUE(base::PathExists(start_menu_subdir_shortcut));
- ASSERT_FALSE(base::PathExists(start_menu_shortcut));
-
- installer::CreateOrUpdateShortcuts(chrome_exe_, *product_, *prefs_,
- shortcut_level_, shortcut_operation_);
- ASSERT_FALSE(base::PathExists(start_menu_subdir_shortcut));
- ASSERT_TRUE(base::PathExists(start_menu_shortcut));
-}
-
-// Verify that any installer operation for any installation level triggers
-// the migration from sub-folder to root of start-menu.
-INSTANTIATE_TEST_CASE_P(
- MigrateShortcutTests, MigrateShortcutTest,
- testing::Combine(
- testing::Values(
- installer::INSTALL_SHORTCUT_REPLACE_EXISTING,
- installer::INSTALL_SHORTCUT_CREATE_EACH_IF_NO_SYSTEM_LEVEL,
- installer::INSTALL_SHORTCUT_CREATE_ALL),
- testing::Values(
- installer::CURRENT_USER,
- installer::ALL_USERS)));
-
TEST_F(InstallShortcutTest, CreateIfNoSystemLevelAllSystemShortcutsExist) {
base::win::ShortcutProperties dummy_properties;
base::FilePath dummy_target;
« no previous file with comments | « chrome/installer/setup/install.cc ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698