OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/autofill/core/browser/autofill_metrics.h" | 5 #include "components/autofill/core/browser/autofill_metrics.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 AutofillMetricsTest::~AutofillMetricsTest() { | 254 AutofillMetricsTest::~AutofillMetricsTest() { |
255 // Order of destruction is important as AutofillManager relies on | 255 // Order of destruction is important as AutofillManager relies on |
256 // PersonalDataManager to be around when it gets destroyed. | 256 // PersonalDataManager to be around when it gets destroyed. |
257 autofill_manager_.reset(); | 257 autofill_manager_.reset(); |
258 } | 258 } |
259 | 259 |
260 void AutofillMetricsTest::SetUp() { | 260 void AutofillMetricsTest::SetUp() { |
261 ChromeRenderViewHostTestHarness::SetUp(); | 261 ChromeRenderViewHostTestHarness::SetUp(); |
262 | 262 |
263 // Ensure Mac OS X does not pop up a modal dialog for the Address Book. | 263 // Ensure Mac OS X does not pop up a modal dialog for the Address Book. |
264 autofill::test::DisableSystemServices(profile()); | 264 autofill::test::DisableSystemServices(profile()->GetPrefs()); |
265 | 265 |
266 PersonalDataManagerFactory::GetInstance()->SetTestingFactory(profile(), NULL); | 266 PersonalDataManagerFactory::GetInstance()->SetTestingFactory(profile(), NULL); |
267 | 267 |
268 TabAutofillManagerDelegate::CreateForWebContents(web_contents()); | 268 TabAutofillManagerDelegate::CreateForWebContents(web_contents()); |
269 autofill::TabAutofillManagerDelegate* manager_delegate = | 269 autofill::TabAutofillManagerDelegate* manager_delegate = |
270 autofill::TabAutofillManagerDelegate::FromWebContents(web_contents()); | 270 autofill::TabAutofillManagerDelegate::FromWebContents(web_contents()); |
271 | 271 |
272 personal_data_.reset(new TestPersonalDataManager()); | 272 personal_data_.reset(new TestPersonalDataManager()); |
273 personal_data_->set_database(manager_delegate->GetDatabase()); | 273 personal_data_->set_database(manager_delegate->GetDatabase()); |
274 personal_data_->SetPrefService(profile()->GetPrefs()); | 274 personal_data_->SetPrefService(profile()->GetPrefs()); |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 TimeTicks::FromInternalValue(5)); | 1126 TimeTicks::FromInternalValue(5)); |
1127 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), | 1127 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), |
1128 TimeTicks::FromInternalValue(3)); | 1128 TimeTicks::FromInternalValue(3)); |
1129 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17)); | 1129 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17)); |
1130 autofill_manager_->Reset(); | 1130 autofill_manager_->Reset(); |
1131 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger()); | 1131 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger()); |
1132 } | 1132 } |
1133 } | 1133 } |
1134 | 1134 |
1135 } // namespace autofill | 1135 } // namespace autofill |
OLD | NEW |