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

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: Actually fix compile failure. Created 6 years, 8 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 2fab3b8851b7c2fbfe5b038863acc7c9973701a6..fdaec85ecdec1f362fbace2f55e2c7093169a2eb 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_driver.h"
#include "components/password_manager/core/browser/password_store.h"
@@ -57,6 +58,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); }
@@ -69,10 +73,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);
};
@@ -93,6 +93,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));
@@ -102,6 +104,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());
}
@@ -198,6 +202,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