Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3575)

Unified Diff: chrome/browser/ui/views/payments/payment_sheet_view_controller_interactive_uitest.cc

Issue 2725963002: [Payments] Only show the required rows in the Payment Request dialog (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « chrome/browser/ui/views/payments/payment_sheet_view_controller.cc ('k') | components/payments/content/payment_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698