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

Unified Diff: components/autofill/core/browser/autocomplete_history_manager_unittest.cc

Issue 306053008: Rename AutofillManagerDelegate to AutofillClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One more Android fix Created 6 years, 7 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/autofill/core/browser/autocomplete_history_manager_unittest.cc
diff --git a/components/autofill/core/browser/autocomplete_history_manager_unittest.cc b/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
index 6379f072f5ca0f829175f1380ec80e60bf3449d4..3ac46b61bb6e0d7a14ff8809177748e3c0909156 100644
--- a/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
+++ b/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
@@ -15,8 +15,8 @@
#include "components/autofill/core/browser/autofill_external_delegate.h"
#include "components/autofill/core/browser/autofill_manager.h"
#include "components/autofill/core/browser/autofill_test_utils.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/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/autofill/core/common/form_data.h"
#include "components/webdata/common/web_data_service_test_util.h"
@@ -43,15 +43,12 @@ class MockWebDataService : public AutofillWebDataService {
virtual ~MockWebDataService() {}
};
-class MockAutofillManagerDelegate
- : public autofill::TestAutofillManagerDelegate {
+class MockAutofillClient : public TestAutofillClient {
public:
- MockAutofillManagerDelegate(
- scoped_refptr<MockWebDataService> web_data_service)
+ MockAutofillClient(scoped_refptr<MockWebDataService> web_data_service)
: web_data_service_(web_data_service),
- prefs_(test::PrefServiceForTesting()) {
- }
- virtual ~MockAutofillManagerDelegate() {}
+ prefs_(test::PrefServiceForTesting()) {}
+ virtual ~MockAutofillClient() {}
virtual scoped_refptr<AutofillWebDataService>
GetDatabase() OVERRIDE { return web_data_service_; }
virtual PrefService* GetPrefs() OVERRIDE { return prefs_.get(); }
@@ -60,7 +57,7 @@ class MockAutofillManagerDelegate
scoped_refptr<MockWebDataService> web_data_service_;
scoped_ptr<PrefService> prefs_;
- DISALLOW_COPY_AND_ASSIGN(MockAutofillManagerDelegate);
+ DISALLOW_COPY_AND_ASSIGN(MockAutofillClient);
};
} // namespace
@@ -71,11 +68,10 @@ class AutocompleteHistoryManagerTest : public testing::Test {
virtual void SetUp() OVERRIDE {
web_data_service_ = new MockWebDataService();
- manager_delegate_.reset(new MockAutofillManagerDelegate(web_data_service_));
+ autofill_client_.reset(new MockAutofillClient(web_data_service_));
autofill_driver_.reset(new TestAutofillDriver());
- autocomplete_manager_.reset(
- new AutocompleteHistoryManager(autofill_driver_.get(),
- manager_delegate_.get()));
+ autocomplete_manager_.reset(new AutocompleteHistoryManager(
+ autofill_driver_.get(), autofill_client_.get()));
}
virtual void TearDown() OVERRIDE {
@@ -86,7 +82,7 @@ class AutocompleteHistoryManagerTest : public testing::Test {
scoped_refptr<MockWebDataService> web_data_service_;
scoped_ptr<AutocompleteHistoryManager> autocomplete_manager_;
scoped_ptr<AutofillDriver> autofill_driver_;
- scoped_ptr<MockAutofillManagerDelegate> manager_delegate_;
+ scoped_ptr<MockAutofillClient> autofill_client_;
};
// Tests that credit card numbers are not sent to the WebDatabase to be saved.
@@ -196,9 +192,8 @@ class MockAutofillExternalDelegate : public AutofillExternalDelegate {
class TestAutocompleteHistoryManager : public AutocompleteHistoryManager {
public:
- TestAutocompleteHistoryManager(AutofillDriver* driver,
- AutofillManagerDelegate* delegate)
- : AutocompleteHistoryManager(driver, delegate) {}
+ TestAutocompleteHistoryManager(AutofillDriver* driver, AutofillClient* client)
+ : AutocompleteHistoryManager(driver, client) {}
using AutocompleteHistoryManager::SendSuggestions;
};
@@ -208,13 +203,13 @@ class TestAutocompleteHistoryManager : public AutocompleteHistoryManager {
// Make sure our external delegate is called at the right time.
TEST_F(AutocompleteHistoryManagerTest, ExternalDelegate) {
TestAutocompleteHistoryManager autocomplete_history_manager(
- autofill_driver_.get(), manager_delegate_.get());
+ autofill_driver_.get(), autofill_client_.get());
- scoped_ptr<AutofillManager> autofill_manager(new AutofillManager(
- autofill_driver_.get(),
- manager_delegate_.get(),
- "en-US",
- AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER));
+ scoped_ptr<AutofillManager> autofill_manager(
+ new AutofillManager(autofill_driver_.get(),
+ autofill_client_.get(),
+ "en-US",
+ AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER));
MockAutofillExternalDelegate external_delegate(autofill_manager.get(),
autofill_driver_.get());
@@ -228,13 +223,13 @@ TEST_F(AutocompleteHistoryManagerTest, ExternalDelegate) {
// Verify that no autocomplete suggestion is returned for textarea.
TEST_F(AutocompleteHistoryManagerTest, NoAutocompleteSuggestionsForTextarea) {
TestAutocompleteHistoryManager autocomplete_history_manager(
- autofill_driver_.get(), manager_delegate_.get());
+ autofill_driver_.get(), autofill_client_.get());
- scoped_ptr<AutofillManager> autofill_manager(new AutofillManager(
- autofill_driver_.get(),
- manager_delegate_.get(),
- "en-US",
- AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER));
+ scoped_ptr<AutofillManager> autofill_manager(
+ new AutofillManager(autofill_driver_.get(),
+ autofill_client_.get(),
+ "en-US",
+ AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER));
MockAutofillExternalDelegate external_delegate(autofill_manager.get(),
autofill_driver_.get());

Powered by Google App Engine
This is Rietveld 408576698