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

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

Issue 2734693002: [Payments] Convert interactive tests to browsertests (Closed)
Patch Set: Initial Created 3 years, 9 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_dialog_view_ids.h" 7 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h"
7 #include "chrome/browser/ui/views/payments/payment_request_interactive_uitest_ba se.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"
11 #include "components/autofill/core/browser/field_types.h" 11 #include "components/autofill/core/browser/field_types.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace payments { 14 namespace payments {
15 15
16 // A simple PaymentRequest which simply requests 'visa' or 'mastercard' and 16 // A simple PaymentRequest which simply requests 'visa' or 'mastercard' and
17 // nothing else. 17 // nothing else.
18 class PaymentSheetViewControllerNoShippingTest 18 class PaymentSheetViewControllerNoShippingTest
19 : public PaymentRequestInteractiveTestBase { 19 : public PaymentRequestBrowserTestBase {
20 protected: 20 protected:
21 PaymentSheetViewControllerNoShippingTest() 21 PaymentSheetViewControllerNoShippingTest()
22 : PaymentRequestInteractiveTestBase( 22 : PaymentRequestBrowserTestBase(
23 "/payment_request_no_shipping_test.html") {} 23 "/payment_request_no_shipping_test.html") {}
24 24
25 private: 25 private:
26 DISALLOW_COPY_AND_ASSIGN(PaymentSheetViewControllerNoShippingTest); 26 DISALLOW_COPY_AND_ASSIGN(PaymentSheetViewControllerNoShippingTest);
27 }; 27 };
28 28
29 // With no data present, the pay button should be disabled. 29 // With no data present, the pay button should be disabled.
30 IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerNoShippingTest, NoData) { 30 IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerNoShippingTest, NoData) {
31 InvokePaymentRequestUI(); 31 InvokePaymentRequestUI();
32 32
(...skipping 30 matching lines...) Expand all
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, dialog_view()->GetViewByID(static_cast<int>( 65 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>(
66 DialogViewID::PAYMENT_SHEET_SHIPPING_SECTION))); 66 DialogViewID::PAYMENT_SHEET_SHIPPING_SECTION)));
67 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>( 67 EXPECT_EQ(nullptr, dialog_view()->GetViewByID(static_cast<int>(
68 DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION))); 68 DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION)));
69 } 69 }
70 70
71 // Accepts 'visa' cards and requests the full contact details. 71 // Accepts 'visa' cards and requests the full contact details.
72 class PaymentSheetViewControllerContactDetailsTest 72 class PaymentSheetViewControllerContactDetailsTest
73 : public PaymentRequestInteractiveTestBase { 73 : public PaymentRequestBrowserTestBase {
74 protected: 74 protected:
75 PaymentSheetViewControllerContactDetailsTest() 75 PaymentSheetViewControllerContactDetailsTest()
76 : PaymentRequestInteractiveTestBase( 76 : PaymentRequestBrowserTestBase(
77 "/payment_request_contact_details_and_free_shipping_test.html") {} 77 "/payment_request_contact_details_and_free_shipping_test.html") {}
78 78
79 private: 79 private:
80 DISALLOW_COPY_AND_ASSIGN(PaymentSheetViewControllerContactDetailsTest); 80 DISALLOW_COPY_AND_ASSIGN(PaymentSheetViewControllerContactDetailsTest);
81 }; 81 };
82 82
83 // With no data present, the pay button should be disabled. 83 // With no data present, the pay button should be disabled.
84 IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerContactDetailsTest, NoData) { 84 IN_PROC_BROWSER_TEST_F(PaymentSheetViewControllerContactDetailsTest, NoData) {
85 InvokePaymentRequestUI(); 85 InvokePaymentRequestUI();
86 86
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION))); 145 DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION)));
146 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( 146 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>(
147 DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION))); 147 DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION)));
148 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( 148 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>(
149 DialogViewID::PAYMENT_SHEET_SHIPPING_SECTION))); 149 DialogViewID::PAYMENT_SHEET_SHIPPING_SECTION)));
150 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>( 150 EXPECT_NE(nullptr, dialog_view()->GetViewByID(static_cast<int>(
151 DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION))); 151 DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION)));
152 } 152 }
153 153
154 } // namespace payments 154 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698