| 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 "base/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
| 6 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" | 6 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" |
| 7 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" | 7 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" |
| 8 #include "components/autofill/core/browser/autofill_profile.h" | 8 #include "components/autofill/core/browser/autofill_profile.h" |
| 9 #include "components/autofill/core/browser/autofill_test_utils.h" | 9 #include "components/autofill/core/browser/autofill_test_utils.h" |
| 10 #include "components/autofill/core/browser/credit_card.h" | 10 #include "components/autofill/core/browser/credit_card.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // If shipping and contact info are not requested, their rows should not be | 55 // If shipping and contact info are not requested, their rows should not be |
| 56 // present. | 56 // present. |
| 57 IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerNoShippingTest, | 57 IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerNoShippingTest, |
| 58 NoShippingNoContactRows) { | 58 NoShippingNoContactRows) { |
| 59 InvokePaymentRequestUI(); | 59 InvokePaymentRequestUI(); |
| 60 | 60 |
| 61 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( | 61 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( |
| 62 DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION))); | 62 DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION))); |
| 63 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( | 63 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( |
| 64 DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION))); | 64 DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION))); |
| 65 EXPECT_EQ(nullptr, |
| 66 dialog_view()->GetViewByID(static_cast<int>( |
| 67 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION))); |
| 65 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>( | 68 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>( |
| 66 DialogViewID::PAYMENT_SHEET_SHIPPING_SECTION))); | 69 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION))); |
| 67 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>( | 70 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>( |
| 68 DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION))); | 71 DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION))); |
| 69 } | 72 } |
| 70 | 73 |
| 71 // Accepts 'visa' cards and requests the full contact details. | 74 // Accepts 'visa' cards and requests the full contact details. |
| 72 class PaymentSheetViewControllerContactDetailsTest | 75 class PaymentSheetViewControllerContactDetailsTest |
| 73 : public PaymentRequestBrowserTestBase { | 76 : public PaymentRequestBrowserTestBase { |
| 74 protected: | 77 protected: |
| 75 PaymentSheetViewControllerContactDetailsTest() | 78 PaymentSheetViewControllerContactDetailsTest() |
| 76 : PaymentRequestBrowserTestBase( | 79 : PaymentRequestBrowserTestBase( |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 141 |
| 139 // If shipping and contact info are requested, show all the rows. | 142 // If shipping and contact info are requested, show all the rows. |
| 140 IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerContactDetailsTest, | 143 IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerContactDetailsTest, |
| 141 AllRowsPresent) { | 144 AllRowsPresent) { |
| 142 InvokePaymentRequestUI(); | 145 InvokePaymentRequestUI(); |
| 143 | 146 |
| 144 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( | 147 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( |
| 145 DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION))); | 148 DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION))); |
| 146 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( | 149 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( |
| 147 DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION))); | 150 DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION))); |
| 151 EXPECT_NE(nullptr, |
| 152 dialog_view()->GetViewByID(static_cast<int>( |
| 153 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION))); |
| 148 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( | 154 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( |
| 149 DialogViewID::PAYMENT_SHEET_SHIPPING_SECTION))); | 155 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION))); |
| 150 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( | 156 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( |
| 151 DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION))); | 157 DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION))); |
| 152 } | 158 } |
| 153 | 159 |
| 154 } // namespace payments | 160 } // namespace payments |
| OLD | NEW |