| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "base/test/test_file_util.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
| 12 #include "chrome/browser/profiles/profile_shortcut_manager.h" | 13 #include "chrome/browser/profiles/profile_shortcut_manager.h" |
| 13 #include "chrome/installer/util/browser_distribution.h" | 14 #include "chrome/installer/util/browser_distribution.h" |
| 14 #include "chrome/installer/util/shell_util.h" | 15 #include "chrome/installer/util/shell_util.h" |
| 15 #include "chrome/test/base/testing_browser_process.h" | 16 #include "chrome/test/base/testing_browser_process.h" |
| 16 #include "chrome/test/base/testing_pref_service.h" | 17 #include "chrome/test/base/testing_pref_service.h" |
| 17 #include "chrome/test/base/testing_profile.h" | 18 #include "chrome/test/base/testing_profile.h" |
| 18 #include "chrome/test/base/testing_profile_manager.h" | 19 #include "chrome/test/base/testing_profile_manager.h" |
| 19 #include "content/public/test/test_browser_thread.h" | 20 #include "content/public/test/test_browser_thread.h" |
| 20 #include "grit/theme_resources.h" | 21 #include "grit/theme_resources.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 22 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
| 23 | 24 |
| 24 using content::BrowserThread; | 25 using content::BrowserThread; |
| 25 | 26 |
| 26 namespace { | 27 namespace { |
| 27 | 28 |
| 28 ShellUtil::VerifyShortcutStatus VerifyProfileShortcut( | 29 file_util::VerifyShortcutStatus VerifyProfileShortcut( |
| 29 const string16& profile_name) { | 30 const string16& profile_name) { |
| 30 FilePath exe_path; | 31 FilePath exe_path; |
| 31 CHECK(PathService::Get(base::FILE_EXE, &exe_path)); | 32 EXPECT_TRUE(PathService::Get(base::FILE_EXE, &exe_path)); |
| 32 | 33 |
| 33 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 34 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 34 | 35 |
| 35 // Get the desktop path of the current user. | 36 // Get the desktop path of the current user. |
| 36 FilePath shortcut_path; | 37 FilePath shortcut_path; |
| 37 ShellUtil::GetDesktopPath(false, &shortcut_path); | 38 ShellUtil::GetDesktopPath(false, &shortcut_path); |
| 38 // Get the name of the shortcut with profile attached | 39 // Get the name of the shortcut with profile attached |
| 39 string16 shortcut_name; | 40 string16 shortcut_name; |
| 40 ShellUtil::GetChromeShortcutName(dist, false, profile_name, | 41 ShellUtil::GetChromeShortcutName(dist, false, profile_name, |
| 41 &shortcut_name); | 42 &shortcut_name); |
| 42 shortcut_path = shortcut_path.Append(shortcut_name); | 43 shortcut_path = shortcut_path.Append(shortcut_name); |
| 43 | 44 |
| 44 return ShellUtil::VerifyChromeShortcut( | 45 // TODO(hallielaine): With this new struct method for VerifyShortcut you can |
| 45 exe_path.value(), shortcut_path.value(), dist->GetAppDescription(), | 46 // now test more properties like: arguments, icon, icon_index, and app_id. |
| 46 0); | 47 file_util::ShortcutProperties expected_properties; |
| 48 expected_properties.set_target(exe_path.value()); |
| 49 expected_properties.set_description(dist->GetAppDescription()); |
| 50 expected_properties.set_dual_mode(false); |
| 51 return file_util::VerifyShortcut(shortcut_path.value(), expected_properties); |
| 47 } | 52 } |
| 48 | 53 |
| 49 } // namespace | 54 } // namespace |
| 50 | 55 |
| 51 class ProfileShortcutManagerTest : public testing::Test { | 56 class ProfileShortcutManagerTest : public testing::Test { |
| 52 protected: | 57 protected: |
| 53 ProfileShortcutManagerTest() | 58 ProfileShortcutManagerTest() |
| 54 : ui_thread_(BrowserThread::UI, &message_loop_), | 59 : ui_thread_(BrowserThread::UI, &message_loop_), |
| 55 file_thread_(BrowserThread::FILE, &message_loop_) { | 60 file_thread_(BrowserThread::FILE, &message_loop_) { |
| 56 } | 61 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 87 profile_manager_->profile_info_cache()->GetPathOfProfileAtIndex(0); | 92 profile_manager_->profile_info_cache()->GetPathOfProfileAtIndex(0); |
| 88 string16 profile_name; | 93 string16 profile_name; |
| 89 if (i != num_profiles - 1) { | 94 if (i != num_profiles - 1) { |
| 90 profile_name = | 95 profile_name = |
| 91 profile_manager_->profile_info_cache()->GetNameOfProfileAtIndex(0); | 96 profile_manager_->profile_info_cache()->GetNameOfProfileAtIndex(0); |
| 92 } | 97 } |
| 93 profile_manager_->profile_info_cache()->DeleteProfileFromCache( | 98 profile_manager_->profile_info_cache()->DeleteProfileFromCache( |
| 94 profile_path); | 99 profile_path); |
| 95 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 100 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 96 MessageLoop::current()->Run(); | 101 MessageLoop::current()->Run(); |
| 97 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_FAILURE_UNEXPECTED, | 102 EXPECT_EQ(file_util::VERIFY_SHORTCUT_FAILURE_FILE_NOT_FOUND, |
| 98 VerifyProfileShortcut(profile_name)); | 103 VerifyProfileShortcut(profile_name)); |
| 99 ASSERT_FALSE(file_util::PathExists(profile_path.Append( | 104 ASSERT_FALSE(file_util::PathExists(profile_path.Append( |
| 100 FILE_PATH_LITERAL("Google Profile.ico")))); | 105 FILE_PATH_LITERAL("Google Profile.ico")))); |
| 101 } | 106 } |
| 102 } | 107 } |
| 103 | 108 |
| 104 void SetupDefaultProfileShortcut() { | 109 void SetupDefaultProfileShortcut() { |
| 105 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_FAILURE_UNEXPECTED, | 110 EXPECT_EQ(file_util::VERIFY_SHORTCUT_FAILURE_FILE_NOT_FOUND, |
| 106 VerifyProfileShortcut(profile_name_)); | 111 VerifyProfileShortcut(profile_name_)); |
| 107 | 112 |
| 108 profile_manager_->profile_info_cache()->AddProfileToCache( | 113 profile_manager_->profile_info_cache()->AddProfileToCache( |
| 109 dest_path_, profile_name_, string16(), 0); | 114 dest_path_, profile_name_, string16(), 0); |
| 110 profile_manager_->profile_manager()->profile_shortcut_manager()-> | 115 profile_manager_->profile_manager()->profile_shortcut_manager()-> |
| 111 CreateProfileShortcut(dest_path_); | 116 CreateProfileShortcut(dest_path_); |
| 112 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 117 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 113 MessageLoop::current()->Run(); | 118 MessageLoop::current()->Run(); |
| 114 // We now have 1 profile, so we expect a new shortcut with no profile | 119 // We now have 1 profile, so we expect a new shortcut with no profile |
| 115 // information. | 120 // information. |
| 116 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_SUCCESS, | 121 EXPECT_EQ(file_util::VERIFY_SHORTCUT_SUCCESS, |
| 117 VerifyProfileShortcut(string16())); | 122 VerifyProfileShortcut(string16())); |
| 118 } | 123 } |
| 119 | 124 |
| 120 void SetupAndCreateTwoShortcuts() { | 125 void SetupAndCreateTwoShortcuts() { |
| 121 ASSERT_EQ(0, profile_manager_->profile_info_cache()->GetNumberOfProfiles()); | 126 ASSERT_EQ(0, profile_manager_->profile_info_cache()->GetNumberOfProfiles()); |
| 122 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_FAILURE_UNEXPECTED, | 127 EXPECT_EQ(file_util::VERIFY_SHORTCUT_FAILURE_FILE_NOT_FOUND, |
| 123 VerifyProfileShortcut(profile_name_)); | 128 VerifyProfileShortcut(profile_name_)); |
| 124 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_FAILURE_UNEXPECTED, | 129 EXPECT_EQ(file_util::VERIFY_SHORTCUT_FAILURE_FILE_NOT_FOUND, |
| 125 VerifyProfileShortcut(second_profile_name_)); | 130 VerifyProfileShortcut(second_profile_name_)); |
| 126 | 131 |
| 127 profile_manager_->profile_info_cache()->AddProfileToCache( | 132 profile_manager_->profile_info_cache()->AddProfileToCache( |
| 128 dest_path_, profile_name_, string16(), 0); | 133 dest_path_, profile_name_, string16(), 0); |
| 129 profile_manager_->profile_info_cache()->AddProfileToCache( | 134 profile_manager_->profile_info_cache()->AddProfileToCache( |
| 130 second_dest_path_, second_profile_name_, string16(), 0); | 135 second_dest_path_, second_profile_name_, string16(), 0); |
| 131 profile_manager_->profile_manager()->profile_shortcut_manager()-> | 136 profile_manager_->profile_manager()->profile_shortcut_manager()-> |
| 132 CreateProfileShortcut(dest_path_); | 137 CreateProfileShortcut(dest_path_); |
| 133 profile_manager_->profile_manager()->profile_shortcut_manager()-> | 138 profile_manager_->profile_manager()->profile_shortcut_manager()-> |
| 134 CreateProfileShortcut(second_dest_path_); | 139 CreateProfileShortcut(second_dest_path_); |
| 135 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 140 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 136 MessageLoop::current()->Run(); | 141 MessageLoop::current()->Run(); |
| 137 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_SUCCESS, | 142 EXPECT_EQ(file_util::VERIFY_SHORTCUT_SUCCESS, |
| 138 VerifyProfileShortcut(profile_name_)); | 143 VerifyProfileShortcut(profile_name_)); |
| 139 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_SUCCESS, | 144 EXPECT_EQ(file_util::VERIFY_SHORTCUT_SUCCESS, |
| 140 VerifyProfileShortcut(second_profile_name_)); | 145 VerifyProfileShortcut(second_profile_name_)); |
| 141 } | 146 } |
| 142 | 147 |
| 143 MessageLoopForUI message_loop_; | 148 MessageLoopForUI message_loop_; |
| 144 content::TestBrowserThread ui_thread_; | 149 content::TestBrowserThread ui_thread_; |
| 145 content::TestBrowserThread file_thread_; | 150 content::TestBrowserThread file_thread_; |
| 146 scoped_ptr<TestingProfileManager> profile_manager_; | 151 scoped_ptr<TestingProfileManager> profile_manager_; |
| 147 FilePath dest_path_; | 152 FilePath dest_path_; |
| 148 string16 profile_name_; | 153 string16 profile_name_; |
| 149 FilePath second_dest_path_; | 154 FilePath second_dest_path_; |
| 150 string16 second_profile_name_; | 155 string16 second_profile_name_; |
| 151 }; | 156 }; |
| 152 | 157 |
| 153 TEST_F(ProfileShortcutManagerTest, DesktopShortcutsCreate) { | 158 TEST_F(ProfileShortcutManagerTest, DesktopShortcutsCreate) { |
| 154 if (!profile_manager_->profile_manager()->profile_shortcut_manager()) | 159 if (!profile_manager_->profile_manager()->profile_shortcut_manager()) |
| 155 return; | 160 return; |
| 156 ProfileShortcutManagerTest::SetupDefaultProfileShortcut(); | 161 ProfileShortcutManagerTest::SetupDefaultProfileShortcut(); |
| 157 | 162 |
| 158 profile_manager_->profile_info_cache()->AddProfileToCache( | 163 profile_manager_->profile_info_cache()->AddProfileToCache( |
| 159 second_dest_path_, second_profile_name_, string16(), 0); | 164 second_dest_path_, second_profile_name_, string16(), 0); |
| 160 profile_manager_->profile_manager()->profile_shortcut_manager()-> | 165 profile_manager_->profile_manager()->profile_shortcut_manager()-> |
| 161 CreateProfileShortcut(second_dest_path_); | 166 CreateProfileShortcut(second_dest_path_); |
| 162 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 167 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 163 MessageLoop::current()->Run(); | 168 MessageLoop::current()->Run(); |
| 164 | 169 |
| 165 // We now have 2 profiles, so we expect a new shortcut with profile | 170 // We now have 2 profiles, so we expect a new shortcut with profile |
| 166 // information for this 2nd profile. | 171 // information for this 2nd profile. |
| 167 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_SUCCESS, | 172 EXPECT_EQ(file_util::VERIFY_SHORTCUT_SUCCESS, |
| 168 VerifyProfileShortcut(second_profile_name_)); | 173 VerifyProfileShortcut(second_profile_name_)); |
| 169 ASSERT_TRUE(file_util::PathExists(second_dest_path_.Append( | 174 ASSERT_TRUE(file_util::PathExists(second_dest_path_.Append( |
| 170 FILE_PATH_LITERAL("Google Profile.ico")))); | 175 FILE_PATH_LITERAL("Google Profile.ico")))); |
| 171 } | 176 } |
| 172 | 177 |
| 173 TEST_F(ProfileShortcutManagerTest, DesktopShortcutsUpdate) { | 178 TEST_F(ProfileShortcutManagerTest, DesktopShortcutsUpdate) { |
| 174 if (!profile_manager_->profile_manager()->profile_shortcut_manager()) | 179 if (!profile_manager_->profile_manager()->profile_shortcut_manager()) |
| 175 return; | 180 return; |
| 176 ProfileShortcutManagerTest::SetupDefaultProfileShortcut(); | 181 ProfileShortcutManagerTest::SetupDefaultProfileShortcut(); |
| 177 | 182 |
| 178 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_FAILURE_UNEXPECTED, | 183 EXPECT_EQ(file_util::VERIFY_SHORTCUT_FAILURE_FILE_NOT_FOUND, |
| 179 VerifyProfileShortcut(second_profile_name_)); | 184 VerifyProfileShortcut(second_profile_name_)); |
| 180 | 185 |
| 181 profile_manager_->profile_info_cache()->AddProfileToCache( | 186 profile_manager_->profile_info_cache()->AddProfileToCache( |
| 182 second_dest_path_, second_profile_name_, string16(), 0); | 187 second_dest_path_, second_profile_name_, string16(), 0); |
| 183 profile_manager_->profile_manager()->profile_shortcut_manager()-> | 188 profile_manager_->profile_manager()->profile_shortcut_manager()-> |
| 184 CreateProfileShortcut(second_dest_path_); | 189 CreateProfileShortcut(second_dest_path_); |
| 185 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 190 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 186 MessageLoop::current()->Run(); | 191 MessageLoop::current()->Run(); |
| 187 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_SUCCESS, | 192 EXPECT_EQ(file_util::VERIFY_SHORTCUT_SUCCESS, |
| 188 VerifyProfileShortcut(second_profile_name_)); | 193 VerifyProfileShortcut(second_profile_name_)); |
| 189 | 194 |
| 190 // Cause an update in ProfileShortcutManager by modifying the profile info | 195 // Cause an update in ProfileShortcutManager by modifying the profile info |
| 191 // cache. | 196 // cache. |
| 192 string16 new_profile_name = ASCIIToUTF16("New Profile Name"); | 197 string16 new_profile_name = ASCIIToUTF16("New Profile Name"); |
| 193 profile_manager_->profile_info_cache()->SetNameOfProfileAtIndex( | 198 profile_manager_->profile_info_cache()->SetNameOfProfileAtIndex( |
| 194 profile_manager_->profile_info_cache()->GetIndexOfProfileWithPath( | 199 profile_manager_->profile_info_cache()->GetIndexOfProfileWithPath( |
| 195 second_dest_path_), | 200 second_dest_path_), |
| 196 new_profile_name); | 201 new_profile_name); |
| 197 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 202 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 198 MessageLoop::current()->Run(); | 203 MessageLoop::current()->Run(); |
| 199 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_FAILURE_UNEXPECTED, | 204 EXPECT_EQ(file_util::VERIFY_SHORTCUT_FAILURE_FILE_NOT_FOUND, |
| 200 VerifyProfileShortcut(second_profile_name_)); | 205 VerifyProfileShortcut(second_profile_name_)); |
| 201 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_SUCCESS, | 206 EXPECT_EQ(file_util::VERIFY_SHORTCUT_SUCCESS, |
| 202 VerifyProfileShortcut(new_profile_name)); | 207 VerifyProfileShortcut(new_profile_name)); |
| 203 } | 208 } |
| 204 | 209 |
| 205 TEST_F(ProfileShortcutManagerTest, DesktopShortcutsDeleteSecondToLast) { | 210 TEST_F(ProfileShortcutManagerTest, DesktopShortcutsDeleteSecondToLast) { |
| 206 if (!profile_manager_->profile_manager()->profile_shortcut_manager()) | 211 if (!profile_manager_->profile_manager()->profile_shortcut_manager()) |
| 207 return; | 212 return; |
| 208 ProfileShortcutManagerTest::SetupAndCreateTwoShortcuts(); | 213 ProfileShortcutManagerTest::SetupAndCreateTwoShortcuts(); |
| 209 | 214 |
| 210 // Delete one shortcut | 215 // Delete one shortcut |
| 211 profile_manager_->profile_info_cache()->DeleteProfileFromCache( | 216 profile_manager_->profile_info_cache()->DeleteProfileFromCache( |
| 212 second_dest_path_); | 217 second_dest_path_); |
| 213 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 218 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 214 MessageLoop::current()->Run(); | 219 MessageLoop::current()->Run(); |
| 215 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_FAILURE_UNEXPECTED, | 220 EXPECT_EQ(file_util::VERIFY_SHORTCUT_FAILURE_FILE_NOT_FOUND, |
| 216 VerifyProfileShortcut(second_profile_name_)); | 221 VerifyProfileShortcut(second_profile_name_)); |
| 217 | 222 |
| 218 // Verify that the profile name has been removed from the remaining shortcut | 223 // Verify that the profile name has been removed from the remaining shortcut |
| 219 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_SUCCESS, | 224 EXPECT_EQ(file_util::VERIFY_SHORTCUT_SUCCESS, |
| 220 VerifyProfileShortcut(string16())); | 225 VerifyProfileShortcut(string16())); |
| 221 // Verify that an additional shortcut, with the default profile's name does | 226 // Verify that an additional shortcut, with the default profile's name does |
| 222 // not exist | 227 // not exist |
| 223 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_FAILURE_UNEXPECTED, | 228 EXPECT_EQ(file_util::VERIFY_SHORTCUT_FAILURE_FILE_NOT_FOUND, |
| 224 VerifyProfileShortcut(profile_name_)); | 229 VerifyProfileShortcut(profile_name_)); |
| 225 } | 230 } |
| 226 | 231 |
| 227 TEST_F(ProfileShortcutManagerTest, DesktopShortcutsCreateSecond) { | 232 TEST_F(ProfileShortcutManagerTest, DesktopShortcutsCreateSecond) { |
| 228 if (!profile_manager_->profile_manager()->profile_shortcut_manager()) | 233 if (!profile_manager_->profile_manager()->profile_shortcut_manager()) |
| 229 return; | 234 return; |
| 230 ProfileShortcutManagerTest::SetupAndCreateTwoShortcuts(); | 235 ProfileShortcutManagerTest::SetupAndCreateTwoShortcuts(); |
| 231 | 236 |
| 232 // Delete one shortcut | 237 // Delete one shortcut |
| 233 profile_manager_->profile_info_cache()->DeleteProfileFromCache( | 238 profile_manager_->profile_info_cache()->DeleteProfileFromCache( |
| 234 second_dest_path_); | 239 second_dest_path_); |
| 235 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 240 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 236 MessageLoop::current()->Run(); | 241 MessageLoop::current()->Run(); |
| 237 | 242 |
| 238 // Verify that a default shortcut exists (no profile name/avatar) | 243 // Verify that a default shortcut exists (no profile name/avatar) |
| 239 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_SUCCESS, | 244 EXPECT_EQ(file_util::VERIFY_SHORTCUT_SUCCESS, |
| 240 VerifyProfileShortcut(string16())); | 245 VerifyProfileShortcut(string16())); |
| 241 // Verify that an additional shortcut, with the default profile's name does | 246 // Verify that an additional shortcut, with the default profile's name does |
| 242 // not exist | 247 // not exist |
| 243 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_FAILURE_UNEXPECTED, | 248 EXPECT_EQ(file_util::VERIFY_SHORTCUT_FAILURE_FILE_NOT_FOUND, |
| 244 VerifyProfileShortcut(profile_name_)); | 249 VerifyProfileShortcut(profile_name_)); |
| 245 | 250 |
| 246 // Create a second profile and shortcut | 251 // Create a second profile and shortcut |
| 247 profile_manager_->profile_info_cache()->AddProfileToCache( | 252 profile_manager_->profile_info_cache()->AddProfileToCache( |
| 248 second_dest_path_, second_profile_name_, string16(), 0); | 253 second_dest_path_, second_profile_name_, string16(), 0); |
| 249 profile_manager_->profile_manager()->profile_shortcut_manager()-> | 254 profile_manager_->profile_manager()->profile_shortcut_manager()-> |
| 250 CreateProfileShortcut(second_dest_path_); | 255 CreateProfileShortcut(second_dest_path_); |
| 251 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 256 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 252 MessageLoop::current()->Run(); | 257 MessageLoop::current()->Run(); |
| 253 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_SUCCESS, | 258 EXPECT_EQ(file_util::VERIFY_SHORTCUT_SUCCESS, |
| 254 VerifyProfileShortcut(second_profile_name_)); | 259 VerifyProfileShortcut(second_profile_name_)); |
| 255 | 260 |
| 256 // Verify that the original shortcut received the profile's name | 261 // Verify that the original shortcut received the profile's name |
| 257 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_SUCCESS, | 262 EXPECT_EQ(file_util::VERIFY_SHORTCUT_SUCCESS, |
| 258 VerifyProfileShortcut(profile_name_)); | 263 VerifyProfileShortcut(profile_name_)); |
| 259 // Verify that a default shortcut no longer exists | 264 // Verify that a default shortcut no longer exists |
| 260 EXPECT_EQ(ShellUtil::VERIFY_SHORTCUT_FAILURE_UNEXPECTED, | 265 EXPECT_EQ(file_util::VERIFY_SHORTCUT_FAILURE_FILE_NOT_FOUND, |
| 261 VerifyProfileShortcut(string16())); | 266 VerifyProfileShortcut(string16())); |
| 262 } | 267 } |
| 263 | 268 |
| OLD | NEW |