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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/password_manager/password_store_factory.h" | 9 #include "chrome/browser/password_manager/password_store_factory.h" |
10 #include "chrome/browser/profiles/profile_info_cache.h" | 10 #include "chrome/browser/profiles/profile_info_cache.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 void SetUpCommandLine(base::CommandLine* command_line) override { | 238 void SetUpCommandLine(base::CommandLine* command_line) override { |
239 // Use a user hash other than the default chrome::kTestUserProfileDir | 239 // Use a user hash other than the default chrome::kTestUserProfileDir |
240 // so that the prefix case is tested. | 240 // so that the prefix case is tested. |
241 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, | 241 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, |
242 "test-user-hash"); | 242 "test-user-hash"); |
243 } | 243 } |
244 }; | 244 }; |
245 | 245 |
246 IN_PROC_BROWSER_TEST_F(ProfileManagerCrOSBrowserTest, GetLastUsedProfile) { | 246 IN_PROC_BROWSER_TEST_F(ProfileManagerCrOSBrowserTest, GetLastUsedProfile) { |
247 // Make sure that last used profile is correct. | 247 // Make sure that last used profile is correct. |
248 Profile* last_used_profile = ProfileManager::GetLastUsedProfile(); | 248 Profile* last_used_profile = |
| 249 g_browser_process->profile_manager()->GetLastUsedProfile(); |
249 EXPECT_TRUE(last_used_profile != NULL); | 250 EXPECT_TRUE(last_used_profile != NULL); |
250 | 251 |
251 base::FilePath profile_path; | 252 base::FilePath profile_path; |
252 PathService::Get(chrome::DIR_USER_DATA, &profile_path); | 253 PathService::Get(chrome::DIR_USER_DATA, &profile_path); |
253 | 254 |
254 profile_path = profile_path.AppendASCII( | 255 profile_path = profile_path.AppendASCII( |
255 std::string(chrome::kProfileDirPrefix) + "test-user-hash"); | 256 std::string(chrome::kProfileDirPrefix) + "test-user-hash"); |
256 EXPECT_EQ(profile_path.value(), last_used_profile->GetPath().value()); | 257 EXPECT_EQ(profile_path.value(), last_used_profile->GetPath().value()); |
257 } | 258 } |
258 | 259 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 profile_manager->ScheduleProfileForDeletion( | 458 profile_manager->ScheduleProfileForDeletion( |
458 profile->GetPath(), base::Bind(&OnUnblockOnProfileCreation, &run_loop)); | 459 profile->GetPath(), base::Bind(&OnUnblockOnProfileCreation, &run_loop)); |
459 run_loop.Run(); | 460 run_loop.Run(); |
460 | 461 |
461 PasswordStoreConsumerVerifier verify_delete; | 462 PasswordStoreConsumerVerifier verify_delete; |
462 password_store->GetAutofillableLogins(&verify_delete); | 463 password_store->GetAutofillableLogins(&verify_delete); |
463 verify_delete.Wait(); | 464 verify_delete.Wait(); |
464 EXPECT_EQ(0u, verify_delete.GetPasswords().size()); | 465 EXPECT_EQ(0u, verify_delete.GetPasswords().size()); |
465 } | 466 } |
466 #endif // !defined(OS_WIN) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 467 #endif // !defined(OS_WIN) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
OLD | NEW |