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

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

Issue 707173004: Refactor Autofill for out of process iframes (OOPIF). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update tests, respond to review comments, cleanup Created 6 years, 1 month 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/password_form_manager_unittest.cc
diff --git a/components/password_manager/core/browser/password_form_manager_unittest.cc b/components/password_manager/core/browser/password_form_manager_unittest.cc
index c38ed9aad5b183094dcd6875c38404fc82e57dcc..de53de52234e549d875c3f8bc6ccdc5b6dd43c67 100644
--- a/components/password_manager/core/browser/password_form_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_form_manager_unittest.cc
@@ -106,7 +106,6 @@ class TestPasswordManagerClient : public StubPasswordManagerClient {
virtual PrefService* GetPrefs() override { return &prefs_; }
virtual PasswordStore* GetPasswordStore() override { return password_store_; }
- virtual PasswordManagerDriver* GetDriver() override { return &driver_; }
void SetFormToFilter(const autofill::PasswordForm& form) {
form_to_filter_ = form;
@@ -124,10 +123,11 @@ class TestPasswordManagerClient : public StubPasswordManagerClient {
class TestPasswordManager : public PasswordManager {
public:
- explicit TestPasswordManager(PasswordManagerClient* client)
+ explicit TestPasswordManager(TestPasswordManagerClient* client)
: PasswordManager(client) {}
- void Autofill(const autofill::PasswordForm& form_for_autofill,
+ void Autofill(password_manager::PasswordManagerDriver* driver,
+ const autofill::PasswordForm& form_for_autofill,
const autofill::PasswordFormMap& best_matches,
const autofill::PasswordForm& preferred_match,
bool wait_for_username) const override {
@@ -413,7 +413,7 @@ TEST_F(PasswordFormManagerTest, TestUpdatePasswordFromNewPasswordElement) {
TestPasswordManagerClient client_with_store(mock_store());
PasswordFormManager manager(NULL,
&client_with_store,
- client_with_store.GetDriver(),
+ client_with_store.mock_driver(),
*observed_form(),
false);
EXPECT_CALL(*client_with_store.mock_driver(), IsOffTheRecord())
@@ -535,7 +535,7 @@ TEST_F(PasswordFormManagerTest, TestAlternateUsername) {
TestPasswordManager password_manager(&client_with_store);
PasswordFormManager manager(&password_manager,
&client_with_store,
- client_with_store.GetDriver(),
+ client_with_store.mock_driver(),
*observed_form(),
false);
EXPECT_CALL(*client_with_store.mock_driver(),
@@ -573,7 +573,7 @@ TEST_F(PasswordFormManagerTest, TestAlternateUsername) {
// This time use an alternate username
PasswordFormManager manager_alt(&password_manager,
&client_with_store,
- client_with_store.GetDriver(),
+ client_with_store.mock_driver(),
*observed_form(),
false);
EXPECT_CALL(*client_with_store.mock_driver(),
@@ -697,7 +697,7 @@ TEST_F(PasswordFormManagerTest, TestSendNotBlacklistedMessage) {
TestPasswordManager password_manager(client());
PasswordFormManager manager_no_creds(&password_manager,
client(),
- client()->GetDriver(),
+ client()->mock_driver(),
*observed_form(),
false);
@@ -716,7 +716,7 @@ TEST_F(PasswordFormManagerTest, TestSendNotBlacklistedMessage) {
// should be called to send the "not blacklisted" message.
PasswordFormManager manager_creds(&password_manager,
client(),
- client()->GetDriver(),
+ client()->mock_driver(),
*observed_form(),
false);
EXPECT_CALL(*(client()->mock_driver()), AllowPasswordGenerationForForm(_))
@@ -737,7 +737,7 @@ TEST_F(PasswordFormManagerTest, TestSendNotBlacklistedMessage) {
PasswordFormManager manager_dropped_creds(&password_manager,
client(),
- client()->GetDriver(),
+ client()->mock_driver(),
signup_form,
false);
EXPECT_CALL(*(client()->mock_driver()), AllowPasswordGenerationForForm(_))
@@ -755,7 +755,7 @@ TEST_F(PasswordFormManagerTest, TestSendNotBlacklistedMessage) {
// should not be called and no "not blacklisted" message sent.
PasswordFormManager manager_blacklisted(&password_manager,
client(),
- client()->GetDriver(),
+ client()->mock_driver(),
*observed_form(),
false);
EXPECT_CALL(*(client()->mock_driver()), AllowPasswordGenerationForForm(_))
@@ -774,7 +774,7 @@ TEST_F(PasswordFormManagerTest, TestForceInclusionOfGeneratedPasswords) {
TestPasswordManager password_manager(client());
PasswordFormManager manager_match(&password_manager,
client(),
- client()->GetDriver(),
+ client()->mock_driver(),
*observed_form(),
false);
EXPECT_CALL(*(client()->mock_driver()), AllowPasswordGenerationForForm(_))
@@ -797,7 +797,7 @@ TEST_F(PasswordFormManagerTest, TestForceInclusionOfGeneratedPasswords) {
// well are generated. They should now be sent to Autofill().
PasswordFormManager manager_no_match(&password_manager,
client(),
- client()->GetDriver(),
+ client()->mock_driver(),
*observed_form(),
false);
EXPECT_CALL(*(client()->mock_driver()), AllowPasswordGenerationForForm(_))
@@ -1087,7 +1087,7 @@ TEST_F(PasswordFormManagerTest, CorrectlyUpdatePasswordsWithSameUsername) {
PasswordFormManager storing_manager(&password_manager,
&client_with_store,
- client_with_store.GetDriver(),
+ client_with_store.mock_driver(),
*observed_form(),
false);
storing_manager.FetchMatchingLoginsFromPasswordStore(
@@ -1112,7 +1112,7 @@ TEST_F(PasswordFormManagerTest, CorrectlyUpdatePasswordsWithSameUsername) {
PasswordFormManager retrieving_manager(&password_manager,
&client_with_store,
- client_with_store.GetDriver(),
+ client_with_store.mock_driver(),
*observed_form(),
false);
@@ -1153,7 +1153,7 @@ TEST_F(PasswordFormManagerTest, UploadFormData_NewPassword) {
// For newly saved passwords, upload a vote for autofill::PASSWORD.
PasswordFormManager form_manager(&password_manager,
&client_with_store,
- client_with_store.GetDriver(),
+ client_with_store.mock_driver(),
form,
false);
SimulateMatchingPhase(&form_manager, RESULT_NO_MATCH);
@@ -1174,7 +1174,7 @@ TEST_F(PasswordFormManagerTest, UploadFormData_NewPassword) {
// Do not upload a vote if the user is blacklisting the form.
PasswordFormManager blacklist_form_manager(&password_manager,
&client_with_store,
- client_with_store.GetDriver(),
+ client_with_store.mock_driver(),
form,
false);
SimulateMatchingPhase(&blacklist_form_manager, RESULT_NO_MATCH);
@@ -1206,7 +1206,7 @@ TEST_F(PasswordFormManagerTest, UploadFormData_AccountCreationPassword) {
PasswordFormManager form_manager(&password_manager,
&client_with_store,
- client_with_store.GetDriver(),
+ client_with_store.mock_driver(),
form,
false);
std::vector<PasswordForm*> result;
@@ -1262,7 +1262,7 @@ TEST_F(PasswordFormManagerTest, CorrectlySavePasswordWithoutUsernameFields) {
PasswordFormManager storing_manager(&password_manager,
&client_with_store,
- client_with_store.GetDriver(),
+ client_with_store.mock_driver(),
*observed_form(),
false);
storing_manager.FetchMatchingLoginsFromPasswordStore(
@@ -1278,7 +1278,7 @@ TEST_F(PasswordFormManagerTest, CorrectlySavePasswordWithoutUsernameFields) {
PasswordFormManager retrieving_manager(&password_manager,
&client_with_store,
- client_with_store.GetDriver(),
+ client_with_store.mock_driver(),
*observed_form(),
false);

Powered by Google App Engine
This is Rietveld 408576698