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

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

Issue 2810193003: [Payments] Change how the dialog gets destroyed. (Closed)
Patch Set: added comment 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 <vector> 5 #include <vector>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/ui/browser_commands.h" 9 #include "chrome/browser/ui/browser_commands.h"
10 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" 10 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, OpenAndReload) { 74 IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, OpenAndReload) {
75 InvokePaymentRequestUI(); 75 InvokePaymentRequestUI();
76 76
77 ResetEventObserver(DialogEvent::DIALOG_CLOSED); 77 ResetEventObserver(DialogEvent::DIALOG_CLOSED);
78 78
79 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); 79 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB);
80 80
81 WaitForObservedEvent(); 81 WaitForObservedEvent();
82 } 82 }
83 83
84 IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, OpenAndClickCancel) {
85 InvokePaymentRequestUI();
86
87 ResetEventObserver(DialogEvent::DIALOG_CLOSED);
88
89 ClickOnDialogViewAndWait(DialogViewID::CANCEL_BUTTON,
90 /*wait_for_animation=*/false);
91 }
92
93 IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest,
94 OrderSummaryAndClickCancel) {
95 InvokePaymentRequestUI();
96
97 OpenOrderSummaryScreen();
98
99 ResetEventObserver(DialogEvent::DIALOG_CLOSED);
100
101 ClickOnDialogViewAndWait(DialogViewID::CANCEL_BUTTON,
102 /*wait_for_animation=*/false);
103 }
104
84 IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, PayWithVisa) { 105 IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, PayWithVisa) {
85 autofill::AutofillProfile billing_address = autofill::test::GetFullProfile(); 106 autofill::AutofillProfile billing_address = autofill::test::GetFullProfile();
86 AddAutofillProfile(billing_address); 107 AddAutofillProfile(billing_address);
87 autofill::CreditCard card = autofill::test::GetCreditCard(); 108 autofill::CreditCard card = autofill::test::GetCreditCard();
88 card.set_billing_address_id(billing_address.guid()); 109 card.set_billing_address_id(billing_address.guid());
89 AddCreditCard(card); // Visa. 110 AddCreditCard(card); // Visa.
90 111
91 InvokePaymentRequestUI(); 112 InvokePaymentRequestUI();
92 113
93 ResetEventObserver(DialogEvent::DIALOG_CLOSED); 114 ResetEventObserver(DialogEvent::DIALOG_CLOSED);
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 EXPECT_EQ(1u, requests.size()); 295 EXPECT_EQ(1u, requests.size());
275 std::vector<std::string> supported_card_networks = 296 std::vector<std::string> supported_card_networks =
276 requests[0]->spec()->supported_card_networks(); 297 requests[0]->spec()->supported_card_networks();
277 EXPECT_EQ(3u, supported_card_networks.size()); 298 EXPECT_EQ(3u, supported_card_networks.size());
278 EXPECT_EQ("mastercard", supported_card_networks[0]); 299 EXPECT_EQ("mastercard", supported_card_networks[0]);
279 EXPECT_EQ("visa", supported_card_networks[1]); 300 EXPECT_EQ("visa", supported_card_networks[1]);
280 EXPECT_EQ("jcb", supported_card_networks[2]); 301 EXPECT_EQ("jcb", supported_card_networks[2]);
281 } 302 }
282 303
283 } // namespace payments 304 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698