Index: components/password_manager/core/browser/mock_affiliated_match_helper.cc |
diff --git a/components/password_manager/core/browser/mock_affiliated_match_helper.cc b/components/password_manager/core/browser/mock_affiliated_match_helper.cc |
index 631a76c68c48658cd5dc559d874820ec51b0b9ab..f3a1efcc9a700e6e8b2f27356ab60abc9245f0d5 100644 |
--- a/components/password_manager/core/browser/mock_affiliated_match_helper.cc |
+++ b/components/password_manager/core/browser/mock_affiliated_match_helper.cc |
@@ -31,6 +31,12 @@ void MockAffiliatedMatchHelper::ExpectCallToGetAffiliatedWebRealms( |
.WillOnce(testing::Return(results_to_return)); |
} |
+void MockAffiliatedMatchHelper::ExpectCallToInjectAffiliatedWebRealms( |
+ const std::vector<std::string>& results_to_inject) { |
+ EXPECT_CALL(*this, OnInjectAffiliatedWebRealmsCalled()) |
+ .WillOnce(testing::Return(results_to_inject)); |
+} |
+ |
void MockAffiliatedMatchHelper::GetAffiliatedAndroidRealms( |
const autofill::PasswordForm& observed_form, |
const AffiliatedRealmsCallback& result_callback) { |
@@ -47,4 +53,15 @@ void MockAffiliatedMatchHelper::GetAffiliatedWebRealms( |
result_callback.Run(affiliated_web_realms); |
} |
+void MockAffiliatedMatchHelper::InjectAffiliatedWebRealms( |
+ ScopedVector<autofill::PasswordForm> forms, |
+ const PasswordFormsCallback& result_callback) { |
+ std::vector<std::string> affiliated_web_realms = |
+ OnInjectAffiliatedWebRealmsCalled(); |
+ DCHECK_EQ(affiliated_web_realms.size(), forms.size()); |
+ for (size_t i = 0; i < forms.size(); ++i) |
+ forms[i]->affiliated_web_realm = affiliated_web_realms[i]; |
+ result_callback.Run(std::move(forms)); |
+} |
+ |
} // namespace password_manager |