| OLD | NEW |
| 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 "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" | 5 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 201 |
| 202 void PaymentRequestBrowserTestBase::OpenOrderSummaryScreen() { | 202 void PaymentRequestBrowserTestBase::OpenOrderSummaryScreen() { |
| 203 ResetEventObserver(DialogEvent::ORDER_SUMMARY_OPENED); | 203 ResetEventObserver(DialogEvent::ORDER_SUMMARY_OPENED); |
| 204 | 204 |
| 205 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION); | 205 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void PaymentRequestBrowserTestBase::OpenPaymentMethodScreen() { | 208 void PaymentRequestBrowserTestBase::OpenPaymentMethodScreen() { |
| 209 ResetEventObserver(DialogEvent::PAYMENT_METHOD_OPENED); | 209 ResetEventObserver(DialogEvent::PAYMENT_METHOD_OPENED); |
| 210 | 210 |
| 211 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION); | 211 views::View* view = delegate_->dialog_view()->GetViewByID( |
| 212 static_cast<int>(DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION)); |
| 213 if (!view) { |
| 214 view = delegate_->dialog_view()->GetViewByID(static_cast<int>( |
| 215 DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION_BUTTON)); |
| 216 } |
| 217 |
| 218 EXPECT_TRUE(view); |
| 219 |
| 220 ClickOnDialogViewAndWait(view); |
| 212 } | 221 } |
| 213 | 222 |
| 214 void PaymentRequestBrowserTestBase::OpenShippingAddressSectionScreen() { | 223 void PaymentRequestBrowserTestBase::OpenShippingAddressSectionScreen() { |
| 215 ResetEventObserver(DialogEvent::SHIPPING_ADDRESS_SECTION_OPENED); | 224 ResetEventObserver(DialogEvent::SHIPPING_ADDRESS_SECTION_OPENED); |
| 216 | 225 |
| 217 ClickOnDialogViewAndWait( | 226 views::View* view = delegate_->dialog_view()->GetViewByID( |
| 218 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION); | 227 static_cast<int>(DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION)); |
| 228 if (!view) { |
| 229 view = delegate_->dialog_view()->GetViewByID(static_cast<int>( |
| 230 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION_BUTTON)); |
| 231 } |
| 232 |
| 233 EXPECT_TRUE(view); |
| 234 |
| 235 ClickOnDialogViewAndWait(view); |
| 219 } | 236 } |
| 220 | 237 |
| 221 void PaymentRequestBrowserTestBase::OpenShippingOptionSectionScreen() { | 238 void PaymentRequestBrowserTestBase::OpenShippingOptionSectionScreen() { |
| 222 ResetEventObserver(DialogEvent::SHIPPING_OPTION_SECTION_OPENED); | 239 ResetEventObserver(DialogEvent::SHIPPING_OPTION_SECTION_OPENED); |
| 223 | 240 |
| 241 views::View* view = delegate_->dialog_view()->GetViewByID( |
| 242 static_cast<int>(DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION)); |
| 243 if (!view) { |
| 244 view = delegate_->dialog_view()->GetViewByID(static_cast<int>( |
| 245 DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION_BUTTON)); |
| 246 } |
| 247 |
| 248 EXPECT_TRUE(view); |
| 249 |
| 224 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION); | 250 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION); |
| 225 } | 251 } |
| 226 void PaymentRequestBrowserTestBase::OpenCreditCardEditorScreen() { | 252 void PaymentRequestBrowserTestBase::OpenCreditCardEditorScreen() { |
| 227 ResetEventObserver(DialogEvent::CREDIT_CARD_EDITOR_OPENED); | 253 ResetEventObserver(DialogEvent::CREDIT_CARD_EDITOR_OPENED); |
| 228 | 254 |
| 229 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_METHOD_ADD_CARD_BUTTON); | 255 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_METHOD_ADD_CARD_BUTTON); |
| 230 } | 256 } |
| 231 | 257 |
| 232 void PaymentRequestBrowserTestBase::OpenShippingAddressEditorScreen() { | 258 void PaymentRequestBrowserTestBase::OpenShippingAddressEditorScreen() { |
| 233 ResetEventObserver(DialogEvent::SHIPPING_ADDRESS_EDITOR_OPENED); | 259 ResetEventObserver(DialogEvent::SHIPPING_ADDRESS_EDITOR_OPENED); |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 std::list<DialogEvent> event_sequence) { | 567 std::list<DialogEvent> event_sequence) { |
| 542 event_observer_ = | 568 event_observer_ = |
| 543 base::MakeUnique<DialogEventObserver>(std::move(event_sequence)); | 569 base::MakeUnique<DialogEventObserver>(std::move(event_sequence)); |
| 544 } | 570 } |
| 545 | 571 |
| 546 void PaymentRequestBrowserTestBase::WaitForObservedEvent() { | 572 void PaymentRequestBrowserTestBase::WaitForObservedEvent() { |
| 547 event_observer_->Wait(); | 573 event_observer_->Wait(); |
| 548 } | 574 } |
| 549 | 575 |
| 550 } // namespace payments | 576 } // namespace payments |
| OLD | NEW |