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

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

Issue 2756543004: Remove MockFormFetcherImpl from FormFetcherImplTest (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | 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/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 4dd2d5931d820a303b38f94cd9df5b241babbd36..864a2b6f46c09be01c1e48c02d42e26c2b53c69d 100644
--- a/components/password_manager/core/browser/form_fetcher_impl_unittest.cc
+++ b/components/password_manager/core/browser/form_fetcher_impl_unittest.cc
@@ -154,23 +154,6 @@ std::vector<std::unique_ptr<PasswordForm>> MakeResults(
return results;
}
-class MockFormFetcherImpl : public FormFetcherImpl {
- public:
- // Inherit constructors.
- using FormFetcherImpl::FormFetcherImpl;
-
- // Google Mock is currently unable to mock |ProcessMigratedForms| due to the
- // presence of move-only types. In order to ensure it is called, a dummy is
- // added which can be passed to |EXPECT_CALL|.
- void ProcessMigratedForms(
- std::vector<std::unique_ptr<autofill::PasswordForm>> results) override {
- FormFetcherImpl::ProcessMigratedForms(std::move(results));
- ProcessMigratedFormsDummy();
- }
-
- MOCK_METHOD0(ProcessMigratedFormsDummy, void());
-};
-
ACTION_P(GetAndAssignWeakPtr, ptr) {
*ptr = arg0->GetWeakPtr();
}
@@ -417,7 +400,7 @@ TEST_F(FormFetcherImplTest, DoNotTryToMigrateHTTPPasswordsOnHTTPSites) {
// A new form fetcher is created to be able to set the form digest and
// migration flag.
- form_fetcher_ = base::MakeUnique<MockFormFetcherImpl>(
+ form_fetcher_ = base::MakeUnique<FormFetcherImpl>(
form_digest_, &client_, /* should_migrate_http_passwords */ true);
EXPECT_CALL(consumer_, ProcessMatches(IsEmpty(), 0u));
form_fetcher_->AddConsumer(&consumer_);
@@ -459,7 +442,7 @@ TEST_F(FormFetcherImplTest, TryToMigrateHTTPPasswordsOnHTTPSSites) {
// A new form fetcher is created to be able to set the form digest and
// migration flag.
- form_fetcher_ = base::MakeUnique<MockFormFetcherImpl>(
+ form_fetcher_ = base::MakeUnique<FormFetcherImpl>(
form_digest_, &client_, /* should_migrate_http_passwords */ true);
EXPECT_CALL(consumer_, ProcessMatches(IsEmpty(), 0u));
form_fetcher_->AddConsumer(&consumer_);
@@ -492,8 +475,6 @@ TEST_F(FormFetcherImplTest, TryToMigrateHTTPPasswordsOnHTTPSSites) {
// Now perform the actual migration.
EXPECT_CALL(*mock_store_, AddLogin(https_form));
- EXPECT_CALL(*static_cast<MockFormFetcherImpl*>(form_fetcher_.get()),
- ProcessMigratedFormsDummy());
EXPECT_CALL(consumer_,
ProcessMatches(UnorderedElementsAre(Pointee(https_form)), 0u));
static_cast<HttpPasswordMigrator*>(migrator_ptr.get())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698