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

Unified Diff: components/password_manager/core/browser/password_syncable_service_unittest.cc

Issue 183223003: Add StartSyncFlare to PasswordSyncableService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with trunk Created 6 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
« no previous file with comments | « components/password_manager/core/browser/password_syncable_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/password_syncable_service_unittest.cc
diff --git a/components/password_manager/core/browser/password_syncable_service_unittest.cc b/components/password_manager/core/browser/password_syncable_service_unittest.cc
index 0817b3a2f72580825dc0ba6caf46c3cde89402d7..78a43917660ce6fdfcd6e4eff66ce01501bf4936 100644
--- a/components/password_manager/core/browser/password_syncable_service_unittest.cc
+++ b/components/password_manager/core/browser/password_syncable_service_unittest.cc
@@ -86,6 +86,8 @@ class MockPasswordSyncableService : public PasswordSyncableService {
MOCK_METHOD1(NotifyPasswordStoreOfLoginChanges,
void (const PasswordStoreChangeList&));
+
+ MOCK_METHOD1(StartSyncFlare, void(syncer::ModelType));
};
// Class to verify the arguments passed to |PasswordStore|.
@@ -610,4 +612,23 @@ TEST_F(PasswordSyncableServiceTest, MergeDataAndPushBack) {
scoped_ptr<syncer::SyncErrorFactory>());
}
+// Calls ActOnPasswordStoreChanges without SyncChangeProcessor. StartSyncFlare
+// should be called.
+TEST_F(PasswordSyncableServiceTest, StartSyncFlare) {
+ autofill::PasswordForm form;
+ form.signon_realm = "abc";
+ PasswordStoreChangeList list;
+ list.push_back(PasswordStoreChange(PasswordStoreChange::ADD, form));
+
+ // No flare and no SyncChangeProcessor, the call shouldn't crash.
+ service()->ActOnPasswordStoreChanges(list);
+
+ // Set the flare. It should be called as there is no SyncChangeProcessor.
+ service()->InjectStartSyncFlare(
+ base::Bind(&MockPasswordSyncableService::StartSyncFlare,
+ base::Unretained(service())));
+ EXPECT_CALL(*service(), StartSyncFlare(syncer::PASSWORDS));
+ service()->ActOnPasswordStoreChanges(list);
+}
+
} // namespace
« no previous file with comments | « components/password_manager/core/browser/password_syncable_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698