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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 }; | 85 }; |
86 | 86 |
87 class TestPaymentsClient : public payments::PaymentsClient { | 87 class TestPaymentsClient : public payments::PaymentsClient { |
88 public: | 88 public: |
89 TestPaymentsClient(net::URLRequestContextGetter* context_getter, | 89 TestPaymentsClient(net::URLRequestContextGetter* context_getter, |
90 payments::PaymentsClientDelegate* delegate) | 90 payments::PaymentsClientDelegate* delegate) |
91 : PaymentsClient(context_getter, delegate), delegate_(delegate) {} | 91 : PaymentsClient(context_getter, delegate), delegate_(delegate) {} |
92 | 92 |
93 ~TestPaymentsClient() override {} | 93 ~TestPaymentsClient() override {} |
94 | 94 |
95 void GetUploadDetails(const std::vector<AutofillProfile>& addresses, | 95 void GetUploadDetails(const std::string& app_locale) override { |
96 const std::string& app_locale) override { | |
97 delegate_->OnDidGetUploadDetails( | 96 delegate_->OnDidGetUploadDetails( |
98 app_locale == "en-US" ? AutofillClient::SUCCESS | 97 app_locale == "en-US" ? AutofillClient::SUCCESS |
99 : AutofillClient::PERMANENT_FAILURE, | 98 : AutofillClient::PERMANENT_FAILURE, |
100 ASCIIToUTF16("this is a context token"), | 99 ASCIIToUTF16("this is a context token"), |
101 std::unique_ptr<base::DictionaryValue>(nullptr)); | 100 std::unique_ptr<base::DictionaryValue>(nullptr)); |
102 } | 101 } |
103 | 102 |
104 void UploadCard(const payments::PaymentsClient::UploadRequestDetails& | 103 void UploadCard(const payments::PaymentsClient::UploadRequestDetails& |
105 request_details) override { | 104 request_details) override { |
106 delegate_->OnDidUploadCard(AutofillClient::SUCCESS); | 105 delegate_->OnDidUploadCard(AutofillClient::SUCCESS); |
(...skipping 5107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5214 FormsSeen(mixed_forms); | 5213 FormsSeen(mixed_forms); |
5215 | 5214 |
5216 // Suggestions should always be displayed. | 5215 // Suggestions should always be displayed. |
5217 for (const FormFieldData& field : mixed_form.fields) { | 5216 for (const FormFieldData& field : mixed_form.fields) { |
5218 GetAutofillSuggestions(mixed_form, field); | 5217 GetAutofillSuggestions(mixed_form, field); |
5219 EXPECT_TRUE(external_delegate_->on_suggestions_returned_seen()); | 5218 EXPECT_TRUE(external_delegate_->on_suggestions_returned_seen()); |
5220 } | 5219 } |
5221 } | 5220 } |
5222 | 5221 |
5223 } // namespace autofill | 5222 } // namespace autofill |
OLD | NEW |