| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 autofill::TabAutofillManagerDelegate::FromWebContents(web_contents()); | 288 autofill::TabAutofillManagerDelegate::FromWebContents(web_contents()); |
| 289 | 289 |
| 290 personal_data_.reset(new TestPersonalDataManager()); | 290 personal_data_.reset(new TestPersonalDataManager()); |
| 291 personal_data_->set_database(manager_delegate->GetDatabase()); | 291 personal_data_->set_database(manager_delegate->GetDatabase()); |
| 292 personal_data_->set_pref_service(profile()->GetPrefs()); | 292 personal_data_->set_pref_service(profile()->GetPrefs()); |
| 293 autofill_driver_.reset(new TestAutofillDriver(web_contents())); | 293 autofill_driver_.reset(new TestAutofillDriver(web_contents())); |
| 294 autofill_manager_.reset(new TestAutofillManager( | 294 autofill_manager_.reset(new TestAutofillManager( |
| 295 autofill_driver_.get(), manager_delegate, personal_data_.get())); | 295 autofill_driver_.get(), manager_delegate, personal_data_.get())); |
| 296 | 296 |
| 297 external_delegate_.reset(new AutofillExternalDelegate( | 297 external_delegate_.reset(new AutofillExternalDelegate( |
| 298 web_contents(), | |
| 299 autofill_manager_.get(), | 298 autofill_manager_.get(), |
| 300 autofill_driver_.get())); | 299 autofill_driver_.get())); |
| 301 autofill_manager_->SetExternalDelegate(external_delegate_.get()); | 300 autofill_manager_->SetExternalDelegate(external_delegate_.get()); |
| 302 } | 301 } |
| 303 | 302 |
| 304 void AutofillMetricsTest::TearDown() { | 303 void AutofillMetricsTest::TearDown() { |
| 305 // Order of destruction is important as AutofillManager relies on | 304 // Order of destruction is important as AutofillManager relies on |
| 306 // PersonalDataManager to be around when it gets destroyed. Also, a real | 305 // PersonalDataManager to be around when it gets destroyed. Also, a real |
| 307 // AutofillManager is tied to the lifetime of the WebContents, so it must | 306 // AutofillManager is tied to the lifetime of the WebContents, so it must |
| 308 // be destroyed at the destruction of the WebContents. | 307 // be destroyed at the destruction of the WebContents. |
| (...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1556 TimeTicks::FromInternalValue(5)); | 1555 TimeTicks::FromInternalValue(5)); |
| 1557 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), | 1556 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), |
| 1558 TimeTicks::FromInternalValue(3)); | 1557 TimeTicks::FromInternalValue(3)); |
| 1559 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17)); | 1558 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17)); |
| 1560 autofill_manager_->Reset(); | 1559 autofill_manager_->Reset(); |
| 1561 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger()); | 1560 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger()); |
| 1562 } | 1561 } |
| 1563 } | 1562 } |
| 1564 | 1563 |
| 1565 } // namespace autofill | 1564 } // namespace autofill |
| OLD | NEW |