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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 void PaymentRequestBrowserTestBase::OnOrderSummaryOpened() { | 104 void PaymentRequestBrowserTestBase::OnOrderSummaryOpened() { |
105 if (event_observer_) | 105 if (event_observer_) |
106 event_observer_->Observe(DialogEvent::ORDER_SUMMARY_OPENED); | 106 event_observer_->Observe(DialogEvent::ORDER_SUMMARY_OPENED); |
107 } | 107 } |
108 | 108 |
109 void PaymentRequestBrowserTestBase::OnPaymentMethodOpened() { | 109 void PaymentRequestBrowserTestBase::OnPaymentMethodOpened() { |
110 if (event_observer_) | 110 if (event_observer_) |
111 event_observer_->Observe(DialogEvent::PAYMENT_METHOD_OPENED); | 111 event_observer_->Observe(DialogEvent::PAYMENT_METHOD_OPENED); |
112 } | 112 } |
113 | 113 |
114 void PaymentRequestBrowserTestBase::OnShippingSectionOpened() { | 114 void PaymentRequestBrowserTestBase::OnShippingAddressSectionOpened() { |
115 if (event_observer_) | 115 if (event_observer_) |
116 event_observer_->Observe(DialogEvent::SHIPPING_SECTION_OPENED); | 116 event_observer_->Observe(DialogEvent::SHIPPING_ADDRESS_SECTION_OPENED); |
| 117 } |
| 118 |
| 119 void PaymentRequestBrowserTestBase::OnShippingOptionSectionOpened() { |
| 120 if (event_observer_) |
| 121 event_observer_->Observe(DialogEvent::SHIPPING_OPTION_SECTION_OPENED); |
117 } | 122 } |
118 | 123 |
119 void PaymentRequestBrowserTestBase::OnCreditCardEditorOpened() { | 124 void PaymentRequestBrowserTestBase::OnCreditCardEditorOpened() { |
120 if (event_observer_) | 125 if (event_observer_) |
121 event_observer_->Observe(DialogEvent::CREDIT_CARD_EDITOR_OPENED); | 126 event_observer_->Observe(DialogEvent::CREDIT_CARD_EDITOR_OPENED); |
122 } | 127 } |
123 | 128 |
124 void PaymentRequestBrowserTestBase::OnShippingAddressEditorOpened() { | 129 void PaymentRequestBrowserTestBase::OnShippingAddressEditorOpened() { |
125 if (event_observer_) | 130 if (event_observer_) |
126 event_observer_->Observe(DialogEvent::SHIPPING_ADDRESS_EDITOR_OPENED); | 131 event_observer_->Observe(DialogEvent::SHIPPING_ADDRESS_EDITOR_OPENED); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 204 |
200 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION); | 205 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_SHEET_SUMMARY_SECTION); |
201 } | 206 } |
202 | 207 |
203 void PaymentRequestBrowserTestBase::OpenPaymentMethodScreen() { | 208 void PaymentRequestBrowserTestBase::OpenPaymentMethodScreen() { |
204 ResetEventObserver(DialogEvent::PAYMENT_METHOD_OPENED); | 209 ResetEventObserver(DialogEvent::PAYMENT_METHOD_OPENED); |
205 | 210 |
206 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION); | 211 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION); |
207 } | 212 } |
208 | 213 |
209 void PaymentRequestBrowserTestBase::OpenShippingSectionScreen() { | 214 void PaymentRequestBrowserTestBase::OpenShippingAddressSectionScreen() { |
210 ResetEventObserver(DialogEvent::SHIPPING_SECTION_OPENED); | 215 ResetEventObserver(DialogEvent::SHIPPING_ADDRESS_SECTION_OPENED); |
211 | 216 |
212 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_SHEET_SHIPPING_SECTION); | 217 ClickOnDialogViewAndWait( |
| 218 DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION); |
213 } | 219 } |
214 | 220 |
| 221 void PaymentRequestBrowserTestBase::OpenShippingOptionSectionScreen() { |
| 222 ResetEventObserver(DialogEvent::SHIPPING_OPTION_SECTION_OPENED); |
| 223 |
| 224 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_SHEET_SHIPPING_OPTION_SECTION); |
| 225 } |
215 void PaymentRequestBrowserTestBase::OpenCreditCardEditorScreen() { | 226 void PaymentRequestBrowserTestBase::OpenCreditCardEditorScreen() { |
216 ResetEventObserver(DialogEvent::CREDIT_CARD_EDITOR_OPENED); | 227 ResetEventObserver(DialogEvent::CREDIT_CARD_EDITOR_OPENED); |
217 | 228 |
218 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_METHOD_ADD_CARD_BUTTON); | 229 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_METHOD_ADD_CARD_BUTTON); |
219 } | 230 } |
220 | 231 |
221 void PaymentRequestBrowserTestBase::OpenShippingAddressEditorScreen() { | 232 void PaymentRequestBrowserTestBase::OpenShippingAddressEditorScreen() { |
222 ResetEventObserver(DialogEvent::SHIPPING_ADDRESS_EDITOR_OPENED); | 233 ResetEventObserver(DialogEvent::SHIPPING_ADDRESS_EDITOR_OPENED); |
223 | 234 |
224 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_METHOD_ADD_SHIPPING_BUTTON); | 235 ClickOnDialogViewAndWait(DialogViewID::PAYMENT_METHOD_ADD_SHIPPING_BUTTON); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 std::list<DialogEvent> event_sequence) { | 525 std::list<DialogEvent> event_sequence) { |
515 event_observer_ = | 526 event_observer_ = |
516 base::MakeUnique<DialogEventObserver>(std::move(event_sequence)); | 527 base::MakeUnique<DialogEventObserver>(std::move(event_sequence)); |
517 } | 528 } |
518 | 529 |
519 void PaymentRequestBrowserTestBase::WaitForObservedEvent() { | 530 void PaymentRequestBrowserTestBase::WaitForObservedEvent() { |
520 event_observer_->Wait(); | 531 event_observer_->Wait(); |
521 } | 532 } |
522 | 533 |
523 } // namespace payments | 534 } // namespace payments |
OLD | NEW |