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

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

Issue 432273005: Fix shortcut tests and remove legacy shortcut code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't check system-level Quick Launch folder on uninstall. Created 6 years, 4 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/util/shell_util.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 ed2fd975f296cb950322d934d0e44054997cd811..54b3629cd0558eff260edf36e61de395fb8cfecc 100644
--- a/chrome/installer/setup/install_unittest.cc
+++ b/chrome/installer/setup/install_unittest.cc
@@ -94,7 +94,6 @@ class InstallShortcutTest : public testing::Test {
ASSERT_TRUE(fake_user_desktop_.CreateUniqueTempDir());
ASSERT_TRUE(fake_common_desktop_.CreateUniqueTempDir());
ASSERT_TRUE(fake_user_quick_launch_.CreateUniqueTempDir());
- ASSERT_TRUE(fake_default_user_quick_launch_.CreateUniqueTempDir());
ASSERT_TRUE(fake_start_menu_.CreateUniqueTempDir());
ASSERT_TRUE(fake_common_start_menu_.CreateUniqueTempDir());
user_desktop_override_.reset(
@@ -106,9 +105,6 @@ class InstallShortcutTest : public testing::Test {
user_quick_launch_override_.reset(
new base::ScopedPathOverride(base::DIR_USER_QUICK_LAUNCH,
fake_user_quick_launch_.path()));
- default_user_quick_launch_override_.reset(
- new base::ScopedPathOverride(base::DIR_DEFAULT_USER_QUICK_LAUNCH,
- fake_default_user_quick_launch_.path()));
start_menu_override_.reset(
new base::ScopedPathOverride(base::DIR_START_MENU,
fake_start_menu_.path()));
@@ -134,8 +130,6 @@ class InstallShortcutTest : public testing::Test {
.Append(shortcut_name);
system_desktop_shortcut_ =
fake_common_desktop_.path().Append(shortcut_name);
- system_quick_launch_shortcut_ =
- fake_default_user_quick_launch_.path().Append(shortcut_name);
system_start_menu_shortcut_ =
fake_common_start_menu_.path().Append(
dist_->GetStartMenuShortcutSubfolder(
@@ -195,13 +189,11 @@ class InstallShortcutTest : public testing::Test {
base::ScopedTempDir fake_user_desktop_;
base::ScopedTempDir fake_common_desktop_;
base::ScopedTempDir fake_user_quick_launch_;
- base::ScopedTempDir fake_default_user_quick_launch_;
base::ScopedTempDir fake_start_menu_;
base::ScopedTempDir fake_common_start_menu_;
scoped_ptr<base::ScopedPathOverride> user_desktop_override_;
scoped_ptr<base::ScopedPathOverride> common_desktop_override_;
scoped_ptr<base::ScopedPathOverride> user_quick_launch_override_;
- scoped_ptr<base::ScopedPathOverride> default_user_quick_launch_override_;
scoped_ptr<base::ScopedPathOverride> start_menu_override_;
scoped_ptr<base::ScopedPathOverride> common_start_menu_override_;
@@ -209,7 +201,6 @@ class InstallShortcutTest : public testing::Test {
base::FilePath user_quick_launch_shortcut_;
base::FilePath user_start_menu_shortcut_;
base::FilePath system_desktop_shortcut_;
- base::FilePath system_quick_launch_shortcut_;
base::FilePath system_start_menu_shortcut_;
base::FilePath user_alternate_desktop_shortcut_;
};
@@ -264,16 +255,17 @@ TEST_F(InstallShortcutTest, CreateAllShortcuts) {
expected_start_menu_properties_);
}
-// Disabled failing test; http://crbug.com/329239.
-TEST_F(InstallShortcutTest, DISABLED_CreateAllShortcutsSystemLevel) {
+TEST_F(InstallShortcutTest, CreateAllShortcutsSystemLevel) {
installer::CreateOrUpdateShortcuts(
chrome_exe_, *product_, *prefs_, installer::ALL_USERS,
installer::INSTALL_SHORTCUT_CREATE_ALL);
base::win::ValidateShortcut(system_desktop_shortcut_, expected_properties_);
- base::win::ValidateShortcut(system_quick_launch_shortcut_,
- expected_properties_);
base::win::ValidateShortcut(system_start_menu_shortcut_,
expected_start_menu_properties_);
+ // The quick launch shortcut is always created per-user for the admin running
+ // the install (other users will get it via Active Setup).
+ base::win::ValidateShortcut(user_quick_launch_shortcut_,
+ expected_properties_);
}
TEST_F(InstallShortcutTest, CreateAllShortcutsAlternateDesktopName) {
@@ -376,9 +368,6 @@ TEST_F(InstallShortcutTest, CreateIfNoSystemLevelAllSystemShortcutsExist) {
ASSERT_TRUE(base::win::CreateOrUpdateShortcutLink(
system_desktop_shortcut_, dummy_properties,
base::win::SHORTCUT_CREATE_ALWAYS));
- ASSERT_TRUE(base::win::CreateOrUpdateShortcutLink(
- system_quick_launch_shortcut_, dummy_properties,
- base::win::SHORTCUT_CREATE_ALWAYS));
ASSERT_TRUE(base::CreateDirectory(
system_start_menu_shortcut_.DirName()));
ASSERT_TRUE(base::win::CreateOrUpdateShortcutLink(
@@ -389,8 +378,10 @@ TEST_F(InstallShortcutTest, CreateIfNoSystemLevelAllSystemShortcutsExist) {
chrome_exe_, *product_, *prefs_, installer::CURRENT_USER,
installer::INSTALL_SHORTCUT_CREATE_EACH_IF_NO_SYSTEM_LEVEL);
ASSERT_FALSE(base::PathExists(user_desktop_shortcut_));
- ASSERT_FALSE(base::PathExists(user_quick_launch_shortcut_));
ASSERT_FALSE(base::PathExists(user_start_menu_shortcut_));
+ // There is no system-level quick launch shortcut, so creating the user-level
+ // one should always succeed.
+ ASSERT_TRUE(base::PathExists(user_quick_launch_shortcut_));
}
TEST_F(InstallShortcutTest, CreateIfNoSystemLevelNoSystemShortcutsExist) {
« no previous file with comments | « chrome/installer/setup/install.cc ('k') | chrome/installer/util/shell_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698