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

Side by Side Diff: chrome/browser/ui/views/payments/payment_sheet_view_controller_browsertest.cc

Issue 2814173002: [Web Payments] Prettify the payment sheet rows in some states. (Closed)
Patch Set: Rebase Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 54
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,
64 DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION))); 64 dialog_view()->GetViewByID(static_cast<int>(
65 DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION_BUTTON)));
65 EXPECT_EQ(nullptr, 66 EXPECT_EQ(nullptr,
66 dialog_view()->GetViewByID(static_cast<int>( 67 dialog_view()->GetViewByID(static_cast<int>(
67 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION))); 68 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION)));
68 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>( 69 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>(
69 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION))); 70 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION)));
70 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>( 71 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>(
71 DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION))); 72 DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION)));
72 } 73 }
73 74
74 // Accepts 'visa' cards and requests the full contact details. 75 // Accepts 'visa' cards and requests the full contact details.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 EXPECT_FALSE(IsPayButtonEnabled()); 140 EXPECT_FALSE(IsPayButtonEnabled());
140 } 141 }
141 142
142 // If shipping and contact info are requested, show all the rows. 143 // If shipping and contact info are requested, show all the rows.
143 IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerContactDetailsTest, 144 IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerContactDetailsTest,
144 AllRowsPresent) { 145 AllRowsPresent) {
145 InvokePaymentRequestUI(); 146 InvokePaymentRequestUI();
146 147
147 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( 148 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>(
148 DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION))); 149 DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION)));
150 EXPECT_NE(nullptr,
151 dialog_view()->GetViewByID(static_cast<int>(
152 DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION_BUTTON)));
153 EXPECT_NE(nullptr,
154 dialog_view()->GetViewByID(static_cast<int>(
155 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION_BUTTON)));
156 EXPECT_NE(nullptr,
157 dialog_view()->GetViewByID(static_cast<int>(
158 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION_BUTTON)));
159 EXPECT_NE(nullptr,
160 dialog_view()->GetViewByID(static_cast<int>(
161 DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION_BUTTON)));
162 }
163
164 IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerContactDetailsTest,
165 AllClickableRowsPresent) {
166 AddCreditCard(autofill::test::GetCreditCard()); // Visa card.
167 AddAutofillProfile(autofill::test::GetFullProfile());
168 InvokePaymentRequestUI();
169
170 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>(
171 DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION)));
149 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( 172 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>(
150 DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION))); 173 DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION)));
151 EXPECT_NE(nullptr, 174 EXPECT_NE(nullptr,
152 dialog_view()->GetViewByID(static_cast<int>( 175 dialog_view()->GetViewByID(static_cast<int>(
153 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION))); 176 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION)));
154 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( 177 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>(
155 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION))); 178 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION)));
156 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( 179 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>(
157 DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION))); 180 DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION)));
158 } 181 }
159 182
160 } // namespace payments 183 } // namespace payments
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/payments/payment_sheet_view_controller.cc ('k') | components/components_strings.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698