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

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

Issue 184103016: Autofill: Refactoring to support fetching password after a username is selected (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error on Chrome OS. Created 6 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/password_manager_unittest.cc
diff --git a/components/password_manager/core/browser/password_manager_unittest.cc b/components/password_manager/core/browser/password_manager_unittest.cc
index 44a5f39e2b82191bd212f02f2f787ddf48252443..1e04ebd31fa0f7320941f3fc8adad00570dc6ae8 100644
--- a/components/password_manager/core/browser/password_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_manager_unittest.cc
@@ -11,6 +11,7 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "components/password_manager/core/browser/mock_password_store.h"
+#include "components/password_manager/core/browser/password_autofill_manager.h"
#include "components/password_manager/core/browser/password_manager.h"
#include "components/password_manager/core/browser/password_manager_client.h"
#include "components/password_manager/core/browser/password_manager_driver.h"
@@ -66,6 +67,9 @@ class MockPasswordManagerDriver : public PasswordManagerDriver {
MOCK_METHOD1(AllowPasswordGenerationForForm, void(autofill::PasswordForm*));
MOCK_METHOD1(AccountCreationFormsFound,
void(const std::vector<autofill::FormData>&));
+ MOCK_METHOD2(AcceptPasswordAutofillSuggestion,
+ void(const base::string16&, const base::string16&));
+ MOCK_METHOD0(GetPasswordAutofillManager, PasswordAutofillManager*());
};
ACTION_P(InvokeConsumer, forms) { arg0->OnGetPasswordStoreResults(forms); }
@@ -78,10 +82,6 @@ class TestPasswordManager : public PasswordManager {
: PasswordManager(client) {}
virtual ~TestPasswordManager() {}
- virtual void OnPasswordFormSubmitted(const PasswordForm& form) OVERRIDE {
- PasswordManager::OnPasswordFormSubmitted(form);
- }
-
private:
DISALLOW_COPY_AND_ASSIGN(TestPasswordManager);
};
@@ -102,6 +102,8 @@ class PasswordManagerTest : public testing::Test {
EXPECT_CALL(client_, GetDriver()).WillRepeatedly(Return(&driver_));
manager_.reset(new TestPasswordManager(&client_));
+ password_autofill_manager_.reset(
+ new PasswordAutofillManager(&client_, NULL));
EXPECT_CALL(driver_, DidLastPageLoadEncounterSSLErrors())
.WillRepeatedly(Return(false));
@@ -111,6 +113,8 @@ class PasswordManagerTest : public testing::Test {
EXPECT_CALL(driver_, GetPasswordManager())
.WillRepeatedly(Return(manager_.get()));
EXPECT_CALL(driver_, AllowPasswordGenerationForForm(_)).Times(AnyNumber());
+ EXPECT_CALL(driver_, GetPasswordAutofillManager())
+ .WillRepeatedly(Return(password_autofill_manager_.get()));
EXPECT_CALL(*store_, ReportMetricsImpl()).Times(AnyNumber());
}
@@ -207,6 +211,7 @@ class PasswordManagerTest : public testing::Test {
scoped_refptr<MockPasswordStore> store_;
MockPasswordManagerClient client_;
MockPasswordManagerDriver driver_;
+ scoped_ptr<PasswordAutofillManager> password_autofill_manager_;
scoped_ptr<TestPasswordManager> manager_;
PasswordForm submitted_form_;
};

Powered by Google App Engine
This is Rietveld 408576698