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

Unified Diff: chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc

Issue 12300036: Fix spurious profile shortcuts created with a system-level install. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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 | « no previous file | chrome/browser/profiles/profile_shortcut_manager_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc
===================================================================
--- chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc (revision 183222)
+++ chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc (working copy)
@@ -693,6 +693,36 @@
ValidateProfileShortcut(FROM_HERE, profile_1_name_, profile_1_path_);
ValidateProfileShortcut(FROM_HERE, profile_2_name_, profile_2_path_);
EXPECT_TRUE(file_util::PathExists(system_level_shortcut_path));
+
+ // Create a third profile without a shortcut and ensure it doesn't get one.
+ profile_info_cache_->AddProfileToCache(profile_3_path_, profile_3_name_,
+ string16(), 0, false);
+ RunPendingTasks();
+ EXPECT_FALSE(ProfileShortcutExistsAtDefaultPath(profile_3_name_));
+
+ // Ensure that changing the avatar icon and the name does not result in a
+ // shortcut being created.
+ profile_info_cache_->SetAvatarIconOfProfileAtIndex(
+ profile_info_cache_->GetIndexOfProfileWithPath(profile_3_path_), 3);
+ RunPendingTasks();
+ EXPECT_FALSE(ProfileShortcutExistsAtDefaultPath(profile_3_name_));
+
+ const string16 new_profile_3_name = L"New Name 3";
+ profile_info_cache_->SetNameOfProfileAtIndex(
+ profile_info_cache_->GetIndexOfProfileWithPath(profile_3_path_),
+ new_profile_3_name);
+ RunPendingTasks();
+ EXPECT_FALSE(ProfileShortcutExistsAtDefaultPath(profile_3_name_));
+ EXPECT_FALSE(ProfileShortcutExistsAtDefaultPath(new_profile_3_name));
+
+ // Rename the second profile and ensure its shortcut got renamed.
+ const string16 new_profile_2_name = L"New Name 2";
+ profile_info_cache_->SetNameOfProfileAtIndex(
+ profile_info_cache_->GetIndexOfProfileWithPath(profile_2_path_),
+ new_profile_2_name);
+ RunPendingTasks();
+ EXPECT_FALSE(ProfileShortcutExistsAtDefaultPath(profile_2_name_));
+ ValidateProfileShortcut(FROM_HERE, new_profile_2_name, profile_2_path_);
}
TEST_F(ProfileShortcutManagerTest,
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_shortcut_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698