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

Unified Diff: chrome/browser/sync/profile_sync_service_password_unittest.cc

Issue 9665007: Profile refactoring: Remove all PasswordStore code from the Profile interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add to factory list Created 8 years, 9 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
Index: chrome/browser/sync/profile_sync_service_password_unittest.cc
diff --git a/chrome/browser/sync/profile_sync_service_password_unittest.cc b/chrome/browser/sync/profile_sync_service_password_unittest.cc
index be460dbe62ed3d581794bf668211c03e912bb435..0cc5152a057c14af140a0b85f734f7d661c09fa3 100644
--- a/chrome/browser/sync/profile_sync_service_password_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc
@@ -12,7 +12,9 @@
#include "base/test/test_timeouts.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/password_manager/mock_password_store.h"
#include "chrome/browser/password_manager/password_store.h"
+#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/signin/signin_manager.h"
#include "chrome/browser/signin/signin_manager_factory.h"
@@ -100,28 +102,6 @@ static void QuitMessageLoop() {
MessageLoop::current()->Quit();
}
-class MockPasswordStore : public PasswordStore {
- public:
- MOCK_METHOD1(RemoveLogin, void(const PasswordForm&));
- MOCK_METHOD2(GetLogins, int(const PasswordForm&, PasswordStoreConsumer*));
- MOCK_METHOD1(AddLogin, void(const PasswordForm&));
- MOCK_METHOD1(UpdateLogin, void(const PasswordForm&));
- MOCK_METHOD0(ReportMetrics, void());
- MOCK_METHOD0(ReportMetricsImpl, void());
- MOCK_METHOD1(AddLoginImpl, void(const PasswordForm&));
- MOCK_METHOD1(UpdateLoginImpl, void(const PasswordForm&));
- MOCK_METHOD1(RemoveLoginImpl, void(const PasswordForm&));
- MOCK_METHOD2(RemoveLoginsCreatedBetweenImpl, void(const base::Time&,
- const base::Time&));
- MOCK_METHOD2(GetLoginsImpl, void(GetLoginsRequest*, const PasswordForm&));
- MOCK_METHOD1(GetAutofillableLoginsImpl, void(GetLoginsRequest*));
- MOCK_METHOD1(GetBlacklistLoginsImpl, void(GetLoginsRequest*));
- MOCK_METHOD1(FillAutofillableLogins,
- bool(std::vector<PasswordForm*>*));
- MOCK_METHOD1(FillBlacklistLogins,
- bool(std::vector<PasswordForm*>*));
-};
-
class PasswordTestProfileSyncService : public TestProfileSyncService {
public:
PasswordTestProfileSyncService(
@@ -177,7 +157,9 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest {
virtual void SetUp() {
AbstractProfileSyncServiceTest::SetUp();
profile_.CreateRequestContext();
- password_store_ = new MockPasswordStore();
+ password_store_ = static_cast<MockPasswordStore*>(
+ PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse(
+ &profile_, MockPasswordStore::Build));
registrar_.Add(&observer_,
chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
@@ -188,7 +170,7 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest {
}
virtual void TearDown() {
- password_store_->Shutdown();
+ password_store_->ShutdownOnUIThread();
service_.reset();
profile_.ResetRequestContext();
AbstractProfileSyncServiceTest::TearDown();
@@ -241,10 +223,6 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest {
token_service_->IssueAuthTokenForTest(
GaiaConstants::kSyncService, "token");
- EXPECT_CALL(profile_, GetPasswordStore(_)).
- Times(AtLeast(2)). // Can be more if we hit NEEDS_CRYPTO.
- WillRepeatedly(Return(password_store_.get()));
-
EXPECT_CALL(observer_,
Observe(
int(chrome::NOTIFICATION_SYNC_CONFIGURE_DONE),_,_));
« no previous file with comments | « chrome/browser/sync/profile_sync_service_factory.cc ('k') | chrome/browser/sync/profile_sync_service_typed_url_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698