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

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

Issue 1615653005: [Password manager] Human readable origins for Android credentials on chrome://settings/passwords (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Inlined the variable androidUriSuffix Created 4 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/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

Powered by Google App Engine
This is Rietveld 408576698