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

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

Issue 306053008: Rename AutofillManagerDelegate to AutofillClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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
« no previous file with comments | « components/password_manager/core/browser/password_autofill_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/password_autofill_manager_unittest.cc
diff --git a/components/password_manager/core/browser/password_autofill_manager_unittest.cc b/components/password_manager/core/browser/password_autofill_manager_unittest.cc
index c96facbe4e32d8a045f1eb1bc99974dbed1c09c2..3440764024dda3bffb35e45149135515f8cbc791 100644
--- a/components/password_manager/core/browser/password_autofill_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_autofill_manager_unittest.cc
@@ -6,8 +6,8 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/popup_item_ids.h"
+#include "components/autofill/core/browser/test_autofill_client.h"
#include "components/autofill/core/browser/test_autofill_driver.h"
-#include "components/autofill/core/browser/test_autofill_manager_delegate.h"
#include "components/password_manager/core/browser/password_autofill_manager.h"
#include "components/password_manager/core/browser/stub_password_manager_client.h"
#include "components/password_manager/core/browser/stub_password_manager_driver.h"
@@ -51,8 +51,7 @@ class TestPasswordManagerClient : public StubPasswordManagerClient {
MockPasswordManagerDriver driver_;
};
-class MockAutofillManagerDelegate
- : public autofill::TestAutofillManagerDelegate {
+class MockAutofillClient : public autofill::TestAutofillClient {
public:
MOCK_METHOD7(ShowAutofillPopup,
void(const gfx::RectF& element_bounds,
@@ -87,9 +86,9 @@ class PasswordAutofillManagerTest : public testing::Test {
void InitializePasswordAutofillManager(
PasswordManagerClient* client,
- autofill::AutofillManagerDelegate* autofill_manager_delegate) {
+ autofill::AutofillClient* autofill_client) {
password_autofill_manager_.reset(
- new PasswordAutofillManager(client, autofill_manager_delegate));
+ new PasswordAutofillManager(client, autofill_client));
password_autofill_manager_->OnAddPasswordFormMapping(username_field_,
fill_data_);
}
@@ -164,9 +163,8 @@ TEST_F(PasswordAutofillManagerTest, PreviewSuggestion) {
// suggestions.
TEST_F(PasswordAutofillManagerTest, ExternalDelegatePasswordSuggestions) {
scoped_ptr<TestPasswordManagerClient> client(new TestPasswordManagerClient);
- scoped_ptr<MockAutofillManagerDelegate> delegate(
- new MockAutofillManagerDelegate);
- InitializePasswordAutofillManager(client.get(), delegate.get());
+ scoped_ptr<MockAutofillClient> autofill_client(new MockAutofillClient);
+ InitializePasswordAutofillManager(client.get(), autofill_client.get());
gfx::RectF element_bounds;
std::vector<base::string16> suggestions;
@@ -175,17 +173,20 @@ TEST_F(PasswordAutofillManagerTest, ExternalDelegatePasswordSuggestions) {
realms.push_back(base::ASCIIToUTF16("http://foo.com/"));
// The enums must be cast to ints to prevent compile errors on linux_rel.
- EXPECT_CALL(
- *delegate,
- ShowAutofillPopup(_, _, _, _, _,
- testing::ElementsAre(
- autofill::POPUP_ITEM_ID_PASSWORD_ENTRY),
- _));
+ EXPECT_CALL(*autofill_client,
+ ShowAutofillPopup(
+ _,
+ _,
+ _,
+ _,
+ _,
+ testing::ElementsAre(autofill::POPUP_ITEM_ID_PASSWORD_ENTRY),
+ _));
password_autofill_manager_->OnShowPasswordSuggestions(
username_field_, element_bounds, suggestions, realms);
// Accepting a suggestion should trigger a call to hide the popup.
- EXPECT_CALL(*delegate, HideAutofillPopup());
+ EXPECT_CALL(*autofill_client, HideAutofillPopup());
password_autofill_manager_->DidAcceptSuggestion(
suggestions[0], autofill::POPUP_ITEM_ID_PASSWORD_ENTRY);
}
« no previous file with comments | « components/password_manager/core/browser/password_autofill_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698