| 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 17 matching lines...) Expand all Loading... |
| 28 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
| 29 #include "base/path_service.h" | 29 #include "base/path_service.h" |
| 30 #include "chrome/common/chrome_constants.h" | 30 #include "chrome/common/chrome_constants.h" |
| 31 #include "chrome/common/chrome_paths.h" | 31 #include "chrome/common/chrome_paths.h" |
| 32 #include "chromeos/chromeos_switches.h" | 32 #include "chromeos/chromeos_switches.h" |
| 33 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 const profiles::ProfileSwitchingDoneCallback kOnProfileSwitchDoNothing; | 38 const ProfileManager::CreateCallback kOnProfileSwitchDoNothing; |
| 39 | 39 |
| 40 // An observer that returns back to test code after a new profile is | 40 // An observer that returns back to test code after a new profile is |
| 41 // initialized. | 41 // initialized. |
| 42 void OnUnblockOnProfileCreation(Profile* profile, | 42 void OnUnblockOnProfileCreation(Profile* profile, |
| 43 Profile::CreateStatus status) { | 43 Profile::CreateStatus status) { |
| 44 if (status == Profile::CREATE_STATUS_INITIALIZED) | 44 if (status == Profile::CREATE_STATUS_INITIALIZED) |
| 45 base::MessageLoop::current()->Quit(); | 45 base::MessageLoop::current()->Quit(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void ProfileCreationComplete(Profile* profile, Profile::CreateStatus status) { | 48 void ProfileCreationComplete(Profile* profile, Profile::CreateStatus status) { |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 run_loop.QuitClosure()); | 443 run_loop.QuitClosure()); |
| 444 EXPECT_TRUE(password_store->ScheduleTask(task)); | 444 EXPECT_TRUE(password_store->ScheduleTask(task)); |
| 445 run_loop.Run(); | 445 run_loop.Run(); |
| 446 | 446 |
| 447 EXPECT_TRUE(verify_add.IsCalled()); | 447 EXPECT_TRUE(verify_add.IsCalled()); |
| 448 EXPECT_EQ(1u, verify_add.GetPasswords().size()); | 448 EXPECT_EQ(1u, verify_add.GetPasswords().size()); |
| 449 EXPECT_TRUE(verify_delete.IsCalled()); | 449 EXPECT_TRUE(verify_delete.IsCalled()); |
| 450 EXPECT_EQ(0u, verify_delete.GetPasswords().size()); | 450 EXPECT_EQ(0u, verify_delete.GetPasswords().size()); |
| 451 } | 451 } |
| 452 #endif // !defined(OS_WIN) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 452 #endif // !defined(OS_WIN) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
| OLD | NEW |