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" |
11 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" | 11 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" |
12 #include "chrome/browser/autofill/autofill_common_test.h" | 12 #include "chrome/browser/autofill/autofill_common_test.h" |
13 #include "chrome/browser/autofill/autofill_manager.h" | 13 #include "chrome/browser/autofill/autofill_manager.h" |
14 #include "chrome/browser/autofill/autofill_metrics.h" | 14 #include "chrome/browser/autofill/autofill_metrics.h" |
15 #include "chrome/browser/autofill/personal_data_manager.h" | 15 #include "chrome/browser/autofill/personal_data_manager.h" |
16 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 16 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
17 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 17 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
18 #include "chrome/browser/ui/tab_contents/test_tab_contents.h" | 18 #include "chrome/browser/ui/tab_contents/test_tab_contents.h" |
19 #include "chrome/browser/webdata/web_data_service.h" | 19 #include "chrome/browser/webdata/web_data_service.h" |
20 #include "chrome/test/base/testing_profile.h" | 20 #include "chrome/test/base/testing_profile.h" |
21 #include "content/public/test/test_browser_thread.h" | 21 #include "content/public/test/test_browser_thread.h" |
22 #include "testing/gmock/include/gmock/gmock.h" | 22 #include "testing/gmock/include/gmock/gmock.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 #include "ui/gfx/rect.h" | 24 #include "ui/gfx/rect.h" |
25 #include "webkit/forms/form_data.h" | 25 #include "webkit/forms/form_data.h" |
26 #include "webkit/forms/form_field.h" | 26 #include "webkit/forms/form_field.h" |
27 | 27 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 server_experiment_id_ = server_experiment_id; | 164 server_experiment_id_ = server_experiment_id; |
165 } | 165 } |
166 | 166 |
167 private: | 167 private: |
168 std::string server_experiment_id_; | 168 std::string server_experiment_id_; |
169 DISALLOW_COPY_AND_ASSIGN(TestFormStructure); | 169 DISALLOW_COPY_AND_ASSIGN(TestFormStructure); |
170 }; | 170 }; |
171 | 171 |
172 class TestAutofillManager : public AutofillManager { | 172 class TestAutofillManager : public AutofillManager { |
173 public: | 173 public: |
174 TestAutofillManager(TabContentsWrapper* tab_contents, | 174 TestAutofillManager(TabContents* tab_contents, |
175 TestPersonalDataManager* personal_manager) | 175 TestPersonalDataManager* personal_manager) |
176 : AutofillManager(tab_contents, personal_manager), | 176 : AutofillManager(tab_contents, personal_manager), |
177 autofill_enabled_(true), | 177 autofill_enabled_(true), |
178 did_finish_async_form_submit_(false), | 178 did_finish_async_form_submit_(false), |
179 message_loop_is_running_(false) { | 179 message_loop_is_running_(false) { |
180 set_metric_logger(new MockAutofillMetrics); | 180 set_metric_logger(new MockAutofillMetrics); |
181 } | 181 } |
182 | 182 |
183 virtual bool IsAutofillEnabled() const { return autofill_enabled_; } | 183 virtual bool IsAutofillEnabled() const { return autofill_enabled_; } |
184 | 184 |
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1460 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), | 1460 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), |
1461 TimeTicks::FromInternalValue(3)); | 1461 TimeTicks::FromInternalValue(3)); |
1462 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17)); | 1462 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17)); |
1463 autofill_manager_->Reset(); | 1463 autofill_manager_->Reset(); |
1464 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger()); | 1464 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger()); |
1465 } | 1465 } |
1466 | 1466 |
1467 // Restore the global Gmock verbosity level to its default value. | 1467 // Restore the global Gmock verbosity level to its default value. |
1468 ::testing::FLAGS_gmock_verbose = "warning"; | 1468 ::testing::FLAGS_gmock_verbose = "warning"; |
1469 } | 1469 } |
OLD | NEW |