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

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

Issue 2760653002: Add FormFetcher::RemoveConsumer (Closed)
Patch Set: Rebased Created 3 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: components/password_manager/core/browser/form_fetcher_impl_unittest.cc
diff --git a/components/password_manager/core/browser/form_fetcher_impl_unittest.cc b/components/password_manager/core/browser/form_fetcher_impl_unittest.cc
index 9372dbdfb1e76f48249a13dba430c0e6deb08667..310c7baf939816a588aabb72160809a4492659ad 100644
--- a/components/password_manager/core/browser/form_fetcher_impl_unittest.cc
+++ b/components/password_manager/core/browser/form_fetcher_impl_unittest.cc
@@ -617,4 +617,14 @@ TEST_F(FormFetcherImplTest, Clone_Stats) {
EXPECT_EQ(1u, clone->GetInteractionsStats().size());
}
+// Check that removing consumers stops them from receiving store updates.
+TEST_F(FormFetcherImplTest, RemoveConsumer) {
+ Fetch();
+ form_fetcher_->AddConsumer(&consumer_);
+ form_fetcher_->RemoveConsumer(&consumer_);
+ EXPECT_CALL(consumer_, ProcessMatches(_, _)).Times(0);
+ form_fetcher_->OnGetPasswordStoreResults(
+ std::vector<std::unique_ptr<PasswordForm>>());
+}
+
} // namespace password_manager

Powered by Google App Engine
This is Rietveld 408576698