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

Unified Diff: components/autofill/browser/autofill_metrics_unittest.cc

Issue 16286020: Abstract WebContentsObserver from Autofill shared code (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Nit Created 7 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
Index: components/autofill/browser/autofill_metrics_unittest.cc
diff --git a/components/autofill/browser/autofill_metrics_unittest.cc b/components/autofill/browser/autofill_metrics_unittest.cc
index d716226e9fd24c0a7f29813c8ad699088a525d02..a2aa03e8f6aeef471736d0fa62cf1da5a0c2504b 100644
--- a/components/autofill/browser/autofill_metrics_unittest.cc
+++ b/components/autofill/browser/autofill_metrics_unittest.cc
@@ -20,6 +20,7 @@
#include "components/autofill/browser/autofill_manager_delegate.h"
#include "components/autofill/browser/autofill_metrics.h"
#include "components/autofill/browser/personal_data_manager.h"
+#include "components/autofill/browser/test_autofill_driver.h"
#include "components/autofill/common/form_data.h"
#include "components/autofill/common/form_field_data.h"
#include "components/autofill/common/forms_seen_state.h"
@@ -184,10 +185,10 @@ class TestFormStructure : public FormStructure {
class TestAutofillManager : public AutofillManager {
public:
- TestAutofillManager(content::WebContents* web_contents,
+ TestAutofillManager(AutofillDriver* driver,
AutofillManagerDelegate* manager_delegate,
TestPersonalDataManager* personal_manager)
- : AutofillManager(web_contents, manager_delegate, personal_manager),
+ : AutofillManager(driver, manager_delegate, personal_manager),
autofill_enabled_(true) {
set_metric_logger(new testing::NiceMock<MockAutofillMetrics>);
}
@@ -266,6 +267,7 @@ class AutofillMetricsTest : public ChromeRenderViewHostTestHarness {
scoped_ptr<ConfirmInfoBarDelegate> CreateDelegate(
MockAutofillMetrics* metric_logger);
+ scoped_ptr<TestAutofillDriver> autofill_driver_;
scoped_ptr<TestAutofillManager> autofill_manager_;
scoped_ptr<TestPersonalDataManager> personal_data_;
};
@@ -291,8 +293,9 @@ void AutofillMetricsTest::SetUp() {
personal_data_.reset(new TestPersonalDataManager());
personal_data_->SetBrowserContext(profile);
+ autofill_driver_.reset(new TestAutofillDriver(web_contents()));
autofill_manager_.reset(new TestAutofillManager(
- web_contents(),
+ autofill_driver_.get(),
TabAutofillManagerDelegate::FromWebContents(web_contents()),
personal_data_.get()));
}
@@ -303,6 +306,7 @@ void AutofillMetricsTest::TearDown() {
// AutofillManager is tied to the lifetime of the WebContents, so it must
// be destroyed at the destruction of the WebContents.
autofill_manager_.reset();
+ autofill_driver_.reset();
personal_data_.reset();
profile()->ResetRequestContext();
ChromeRenderViewHostTestHarness::TearDown();

Powered by Google App Engine
This is Rietveld 408576698