| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/payments/content/payment_response_helper.h" | 5 #include "components/payments/content/payment_response_helper.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "components/autofill/core/browser/autofill_profile.h" | 11 #include "components/autofill/core/browser/autofill_profile.h" |
| 12 #include "components/autofill/core/browser/autofill_test_utils.h" | 12 #include "components/autofill/core/browser/autofill_test_utils.h" |
| 13 #include "components/autofill/core/browser/credit_card.h" | 13 #include "components/autofill/core/browser/credit_card.h" |
| 14 #include "components/autofill/core/browser/test_personal_data_manager.h" | 14 #include "components/autofill/core/browser/test_personal_data_manager.h" |
| 15 #include "components/payments/content/payment_request.mojom.h" |
| 15 #include "components/payments/content/payment_request_spec.h" | 16 #include "components/payments/content/payment_request_spec.h" |
| 16 #include "components/payments/core/autofill_payment_instrument.h" | 17 #include "components/payments/core/autofill_payment_instrument.h" |
| 17 #include "components/payments/core/payment_request_delegate.h" | 18 #include "components/payments/core/payment_request_delegate.h" |
| 18 #include "components/payments/mojom/payment_request.mojom.h" | |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 | 20 |
| 21 namespace payments { | 21 namespace payments { |
| 22 | 22 |
| 23 class FakePaymentRequestDelegate : public PaymentRequestDelegate { | 23 class FakePaymentRequestDelegate : public PaymentRequestDelegate { |
| 24 public: | 24 public: |
| 25 FakePaymentRequestDelegate( | 25 FakePaymentRequestDelegate( |
| 26 autofill::PersonalDataManager* personal_data_manager) | 26 autofill::PersonalDataManager* personal_data_manager) |
| 27 : personal_data_manager_(personal_data_manager), locale_("en-US") {} | 27 : personal_data_manager_(personal_data_manager), locale_("en-US") {} |
| 28 void ShowDialog(PaymentRequest* request) override {} | 28 void ShowDialog(PaymentRequest* request) override {} |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 PaymentResponseHelper helper("en-US", spec(), test_instrument(), | 260 PaymentResponseHelper helper("en-US", spec(), test_instrument(), |
| 261 test_address(), test_address(), this); | 261 test_address(), test_address(), this); |
| 262 | 262 |
| 263 // Check that the name was set, but not the other values. | 263 // Check that the name was set, but not the other values. |
| 264 EXPECT_EQ("John H. Doe", response()->payer_name.value()); | 264 EXPECT_EQ("John H. Doe", response()->payer_name.value()); |
| 265 EXPECT_FALSE(response()->payer_phone.has_value()); | 265 EXPECT_FALSE(response()->payer_phone.has_value()); |
| 266 EXPECT_FALSE(response()->payer_email.has_value()); | 266 EXPECT_FALSE(response()->payer_email.has_value()); |
| 267 } | 267 } |
| 268 | 268 |
| 269 } // namespace payments | 269 } // namespace payments |
| OLD | NEW |