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/api/infobars/infobar_service.h" | 11 #include "chrome/browser/api/infobars/infobar_service.h" |
12 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" | 12 #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" |
13 #include "chrome/browser/autofill/autofill_common_test.h" | 13 #include "chrome/browser/autofill/autofill_common_test.h" |
14 #include "chrome/browser/autofill/autofill_manager.h" | 14 #include "chrome/browser/autofill/autofill_manager.h" |
15 #include "chrome/browser/autofill/autofill_manager_delegate.h" | 15 #include "chrome/browser/autofill/autofill_manager_delegate.h" |
16 #include "chrome/browser/autofill/autofill_metrics.h" | 16 #include "chrome/browser/autofill/autofill_metrics.h" |
17 #include "chrome/browser/autofill/personal_data_manager.h" | 17 #include "chrome/browser/autofill/personal_data_manager.h" |
18 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 18 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
19 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" | 19 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" |
20 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 20 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
21 #include "chrome/browser/ui/tab_contents/test_tab_contents.h" | 21 #include "chrome/browser/ui/tab_contents/test_tab_contents.h" |
22 #include "chrome/browser/webdata/web_data_service.h" | 22 #include "chrome/browser/webdata/web_data_service.h" |
23 #include "chrome/test/base/testing_profile.h" | 23 #include "chrome/test/base/testing_profile.h" |
| 24 #include "content/public/common/form_data.h" |
| 25 #include "content/public/common/form_field.h" |
24 #include "content/public/test/test_browser_thread.h" | 26 #include "content/public/test/test_browser_thread.h" |
25 #include "testing/gmock/include/gmock/gmock.h" | 27 #include "testing/gmock/include/gmock/gmock.h" |
26 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
27 #include "ui/gfx/rect.h" | 29 #include "ui/gfx/rect.h" |
28 #include "webkit/forms/form_data.h" | |
29 #include "webkit/forms/form_field.h" | |
30 | 30 |
31 using content::BrowserThread; | 31 using content::BrowserThread; |
32 using ::testing::_; | 32 using ::testing::_; |
33 using ::testing::AnyNumber; | 33 using ::testing::AnyNumber; |
34 using ::testing::Mock; | 34 using ::testing::Mock; |
35 using base::TimeTicks; | 35 using base::TimeTicks; |
36 using base::TimeDelta; | 36 using base::TimeDelta; |
37 using webkit::forms::FormData; | 37 using content::FormData; |
38 using webkit::forms::FormField; | 38 using content::FormField; |
39 | 39 |
40 namespace { | 40 namespace { |
41 | 41 |
42 class MockAutofillMetrics : public AutofillMetrics { | 42 class MockAutofillMetrics : public AutofillMetrics { |
43 public: | 43 public: |
44 MockAutofillMetrics() {} | 44 MockAutofillMetrics() {} |
45 MOCK_CONST_METHOD1(LogCreditCardInfoBarMetric, void(InfoBarMetric metric)); | 45 MOCK_CONST_METHOD1(LogCreditCardInfoBarMetric, void(InfoBarMetric metric)); |
46 MOCK_CONST_METHOD3(LogHeuristicTypePrediction, | 46 MOCK_CONST_METHOD3(LogHeuristicTypePrediction, |
47 void(FieldTypeQualityMetric metric, | 47 void(FieldTypeQualityMetric metric, |
48 AutofillFieldType field_type, | 48 AutofillFieldType field_type, |
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), | 1468 autofill_manager_->OnTextFieldDidChange(form, form.fields.front(), |
1469 TimeTicks::FromInternalValue(3)); | 1469 TimeTicks::FromInternalValue(3)); |
1470 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17)); | 1470 autofill_manager_->FormSubmitted(form, TimeTicks::FromInternalValue(17)); |
1471 autofill_manager_->Reset(); | 1471 autofill_manager_->Reset(); |
1472 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger()); | 1472 Mock::VerifyAndClearExpectations(autofill_manager_->metric_logger()); |
1473 } | 1473 } |
1474 | 1474 |
1475 // Restore the global Gmock verbosity level to its default value. | 1475 // Restore the global Gmock verbosity level to its default value. |
1476 ::testing::FLAGS_gmock_verbose = "warning"; | 1476 ::testing::FLAGS_gmock_verbose = "warning"; |
1477 } | 1477 } |
OLD | NEW |