OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 void(const std::string& experiment_id)); | 75 void(const std::string& experiment_id)); |
76 MOCK_CONST_METHOD1(LogServerExperimentIdForUpload, | 76 MOCK_CONST_METHOD1(LogServerExperimentIdForUpload, |
77 void(const std::string& experiment_id)); | 77 void(const std::string& experiment_id)); |
78 | 78 |
79 private: | 79 private: |
80 DISALLOW_COPY_AND_ASSIGN(MockAutofillMetrics); | 80 DISALLOW_COPY_AND_ASSIGN(MockAutofillMetrics); |
81 }; | 81 }; |
82 | 82 |
83 class TestPersonalDataManager : public PersonalDataManager { | 83 class TestPersonalDataManager : public PersonalDataManager { |
84 public: | 84 public: |
85 TestPersonalDataManager() : autofill_enabled_(true) { | 85 TestPersonalDataManager() |
| 86 : PersonalDataManager("en-US"), |
| 87 autofill_enabled_(true) { |
86 set_metric_logger(new testing::NiceMock<MockAutofillMetrics>()); | 88 set_metric_logger(new testing::NiceMock<MockAutofillMetrics>()); |
87 CreateTestAutofillProfiles(&web_profiles_); | 89 CreateTestAutofillProfiles(&web_profiles_); |
88 } | 90 } |
89 | 91 |
90 void SetBrowserContext(content::BrowserContext* context) { | 92 void SetBrowserContext(content::BrowserContext* context) { |
91 set_browser_context(context); | 93 set_browser_context(context); |
92 } | 94 } |
93 | 95 |
94 // Overridden to avoid a trip to the database. This should be a no-op except | 96 // Overridden to avoid a trip to the database. This should be a no-op except |
95 // for the side-effect of logging the profile count. | 97 // for the side-effect of logging the profile count. |
(...skipping 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1566 forms, TimeTicks::FromInternalValue(1), false); | 1568 forms, TimeTicks::FromInternalValue(1), false); |
1567 autofill_manager_->OnDidFillAutofillFormData( | 1569 autofill_manager_->OnDidFillAutofillFormData( |
1568 TimeTicks::FromInternalValue(5)); | 1570 TimeTicks::FromInternalValue(5)); |
1569 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), | 1571 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), |
1570 TimeTicks::FromInternalValue(3)); | 1572 TimeTicks::FromInternalValue(3)); |
1571 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17)); | 1573 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17)); |
1572 autofill_manager_->Reset(); | 1574 autofill_manager_->Reset(); |
1573 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger()); | 1575 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger()); |
1574 } | 1576 } |
1575 } | 1577 } |
OLD | NEW |