| Index: chrome/browser/ui/views/payments/payment_sheet_view_controller_interactive_uitest.cc
|
| diff --git a/chrome/browser/ui/views/payments/payment_sheet_view_controller_interactive_uitest.cc b/chrome/browser/ui/views/payments/payment_sheet_view_controller_interactive_uitest.cc
|
| index 1c275a9f7f58137b410a2f428c7520d31acf3cf9..67f9276f4c1ead31d4aad22a650e0fe2c1766413 100644
|
| --- a/chrome/browser/ui/views/payments/payment_sheet_view_controller_interactive_uitest.cc
|
| +++ b/chrome/browser/ui/views/payments/payment_sheet_view_controller_interactive_uitest.cc
|
| @@ -3,6 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/strings/utf_string_conversions.h"
|
| +#include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h"
|
| #include "chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h"
|
| #include "components/autofill/core/browser/autofill_profile.h"
|
| #include "components/autofill/core/browser/autofill_test_utils.h"
|
| @@ -51,6 +52,22 @@ IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerNoShippingTest,
|
| EXPECT_FALSE(IsPayButtonEnabled());
|
| }
|
|
|
| +// If shipping and contact info are not requested, their rows should not be
|
| +// present.
|
| +IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerNoShippingTest,
|
| + NoShippingNoContactRows) {
|
| + InvokePaymentRequestUI();
|
| +
|
| + EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>(
|
| + DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION)));
|
| + EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>(
|
| + DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION)));
|
| + EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>(
|
| + DialogViewID::PAYMENT_SHEET_SHIPPING_SECTION)));
|
| + EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>(
|
| + DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION)));
|
| +}
|
| +
|
| // Accepts 'visa' cards and requests the full contact details.
|
| class PaymentSheetViewControllerContactDetailsTest
|
| : public PaymentRequestInteractiveTestBase {
|
| @@ -119,4 +136,19 @@ IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerContactDetailsTest,
|
| EXPECT_FALSE(IsPayButtonEnabled());
|
| }
|
|
|
| +// If shipping and contact info are requested, show all the rows.
|
| +IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerContactDetailsTest,
|
| + AllRowsPresent) {
|
| + InvokePaymentRequestUI();
|
| +
|
| + EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>(
|
| + DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION)));
|
| + EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>(
|
| + DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION)));
|
| + EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>(
|
| + DialogViewID::PAYMENT_SHEET_SHIPPING_SECTION)));
|
| + EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>(
|
| + DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION)));
|
| +}
|
| +
|
| } // namespace payments
|
|
|