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_manager.h" | 5 #include "components/autofill/core/browser/autofill_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "components/autofill/core/browser/test_autofill_external_delegate.h" | 42 #include "components/autofill/core/browser/test_autofill_external_delegate.h" |
43 #include "components/autofill/core/browser/validation.h" | 43 #include "components/autofill/core/browser/validation.h" |
44 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 44 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
45 #include "components/autofill/core/common/autofill_pref_names.h" | 45 #include "components/autofill/core/common/autofill_pref_names.h" |
46 #include "components/autofill/core/common/autofill_switches.h" | 46 #include "components/autofill/core/common/autofill_switches.h" |
47 #include "components/autofill/core/common/autofill_util.h" | 47 #include "components/autofill/core/common/autofill_util.h" |
48 #include "components/autofill/core/common/form_data.h" | 48 #include "components/autofill/core/common/form_data.h" |
49 #include "components/autofill/core/common/form_field_data.h" | 49 #include "components/autofill/core/common/form_field_data.h" |
50 #include "components/prefs/pref_service.h" | 50 #include "components/prefs/pref_service.h" |
51 #include "components/rappor/test_rappor_service.h" | 51 #include "components/rappor/test_rappor_service.h" |
52 #include "components/security_state/core/switches.h" | 52 #include "components/security_state/core/security_state.h" |
53 #include "components/variations/variations_associated_data.h" | 53 #include "components/variations/variations_associated_data.h" |
54 #include "grit/components_strings.h" | 54 #include "grit/components_strings.h" |
55 #include "net/url_request/url_request_test_util.h" | 55 #include "net/url_request/url_request_test_util.h" |
56 #include "testing/gmock/include/gmock/gmock.h" | 56 #include "testing/gmock/include/gmock/gmock.h" |
57 #include "testing/gtest/include/gtest/gtest.h" | 57 #include "testing/gtest/include/gtest/gtest.h" |
58 #include "ui/base/l10n/l10n_util.h" | 58 #include "ui/base/l10n/l10n_util.h" |
59 #include "ui/gfx/geometry/rect.h" | 59 #include "ui/gfx/geometry/rect.h" |
60 #include "url/gurl.h" | 60 #include "url/gurl.h" |
61 | 61 |
62 using base::ASCIIToUTF16; | 62 using base::ASCIIToUTF16; |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 } | 1012 } |
1013 | 1013 |
1014 // Convenience method to cast the FullCardRequest into a CardUnmaskDelegate. | 1014 // Convenience method to cast the FullCardRequest into a CardUnmaskDelegate. |
1015 CardUnmaskDelegate* full_card_unmask_delegate() { | 1015 CardUnmaskDelegate* full_card_unmask_delegate() { |
1016 DCHECK(autofill_manager_->full_card_request_); | 1016 DCHECK(autofill_manager_->full_card_request_); |
1017 return static_cast<CardUnmaskDelegate*>( | 1017 return static_cast<CardUnmaskDelegate*>( |
1018 autofill_manager_->full_card_request_.get()); | 1018 autofill_manager_->full_card_request_.get()); |
1019 } | 1019 } |
1020 | 1020 |
1021 void SetHttpWarningEnabled() { | 1021 void SetHttpWarningEnabled() { |
1022 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 1022 scoped_feature_list_.InitAndEnableFeature( |
1023 security_state::switches::kMarkHttpAs, | 1023 security_state::kHttpFormWarningFeature); |
1024 security_state::switches:: | |
1025 kMarkHttpWithPasswordsOrCcWithChipAndFormWarning); | |
1026 } | 1024 } |
1027 | 1025 |
1028 protected: | 1026 protected: |
1029 base::MessageLoop message_loop_; | 1027 base::MessageLoop message_loop_; |
1030 MockAutofillClient autofill_client_; | 1028 MockAutofillClient autofill_client_; |
1031 std::unique_ptr<MockAutofillDriver> autofill_driver_; | 1029 std::unique_ptr<MockAutofillDriver> autofill_driver_; |
1032 std::unique_ptr<TestAutofillManager> autofill_manager_; | 1030 std::unique_ptr<TestAutofillManager> autofill_manager_; |
1033 std::unique_ptr<TestAutofillExternalDelegate> external_delegate_; | 1031 std::unique_ptr<TestAutofillExternalDelegate> external_delegate_; |
1034 scoped_refptr<net::TestURLRequestContextGetter> request_context_; | 1032 scoped_refptr<net::TestURLRequestContextGetter> request_context_; |
1035 TestPaymentsClient* payments_client_; | 1033 TestPaymentsClient* payments_client_; |
(...skipping 4496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5532 | 5530 |
5533 // The driver should always be notified. | 5531 // The driver should always be notified. |
5534 for (const FormFieldData& field : form.fields) { | 5532 for (const FormFieldData& field : form.fields) { |
5535 GetAutofillSuggestions(form, field); | 5533 GetAutofillSuggestions(form, field); |
5536 EXPECT_TRUE(autofill_driver_->did_interact_with_credit_card_form()); | 5534 EXPECT_TRUE(autofill_driver_->did_interact_with_credit_card_form()); |
5537 autofill_driver_->ClearDidInteractWithCreditCardForm(); | 5535 autofill_driver_->ClearDidInteractWithCreditCardForm(); |
5538 } | 5536 } |
5539 } | 5537 } |
5540 | 5538 |
5541 } // namespace autofill | 5539 } // namespace autofill |
OLD | NEW |