| 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 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_INTERACTIVE_UITEST_BASE
_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_INTERACTIVE_UITEST_BASE
_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_INTERACTIVE_UITEST_BASE
_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_INTERACTIVE_UITEST_BASE
_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 void SetUpCommandLine(base::CommandLine* command_line) override; | 66 void SetUpCommandLine(base::CommandLine* command_line) override; |
| 67 void SetUpOnMainThread() override; | 67 void SetUpOnMainThread() override; |
| 68 | 68 |
| 69 // PaymentRequestDialogView::ObserverForTest | 69 // PaymentRequestDialogView::ObserverForTest |
| 70 void OnDialogOpened() override; | 70 void OnDialogOpened() override; |
| 71 void OnOrderSummaryOpened() override; | 71 void OnOrderSummaryOpened() override; |
| 72 void OnPaymentMethodOpened() override; | 72 void OnPaymentMethodOpened() override; |
| 73 void OnCreditCardEditorOpened() override; | 73 void OnCreditCardEditorOpened() override; |
| 74 void OnBackNavigation() override; | 74 void OnBackNavigation() override; |
| 75 void OnContactInfoOpened() override; |
| 75 | 76 |
| 76 // views::WidgetObserver | 77 // views::WidgetObserver |
| 77 // Effective way to be warned of all dialog closures. | 78 // Effective way to be warned of all dialog closures. |
| 78 void OnWidgetDestroyed(views::Widget* widget) override; | 79 void OnWidgetDestroyed(views::Widget* widget) override; |
| 79 | 80 |
| 80 // Will call JavaScript to invoke the PaymentRequest dialog and verify that | 81 // Will call JavaScript to invoke the PaymentRequest dialog and verify that |
| 81 // it's open. | 82 // it's open. |
| 82 void InvokePaymentRequestUI(); | 83 void InvokePaymentRequestUI(); |
| 83 | 84 |
| 84 // Utility functions that will click on Dialog views and wait for the | 85 // Utility functions that will click on Dialog views and wait for the |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 PaymentRequestDialogView* dialog_view() { return delegate_->dialog_view(); } | 132 PaymentRequestDialogView* dialog_view() { return delegate_->dialog_view(); } |
| 132 | 133 |
| 133 // Various events that can be waited on by the DialogEventObserver. | 134 // Various events that can be waited on by the DialogEventObserver. |
| 134 enum DialogEvent : int { | 135 enum DialogEvent : int { |
| 135 DIALOG_OPENED, | 136 DIALOG_OPENED, |
| 136 DIALOG_CLOSED, | 137 DIALOG_CLOSED, |
| 137 ORDER_SUMMARY_OPENED, | 138 ORDER_SUMMARY_OPENED, |
| 138 PAYMENT_METHOD_OPENED, | 139 PAYMENT_METHOD_OPENED, |
| 139 CREDIT_CARD_EDITOR_OPENED, | 140 CREDIT_CARD_EDITOR_OPENED, |
| 140 BACK_NAVIGATION, | 141 BACK_NAVIGATION, |
| 142 CONTACT_INFO_OPENED, |
| 141 }; | 143 }; |
| 142 | 144 |
| 143 // DialogEventObserver is used to wait on specific events that may have | 145 // DialogEventObserver is used to wait on specific events that may have |
| 144 // occured before the call to Wait(), or after, in which case a RunLoop is | 146 // occured before the call to Wait(), or after, in which case a RunLoop is |
| 145 // used. | 147 // used. |
| 146 // | 148 // |
| 147 // Usage: | 149 // Usage: |
| 148 // observer_.reset(new DialogEventObserver([DialogEvent])); | 150 // observer_.reset(new DialogEventObserver([DialogEvent])); |
| 149 // | 151 // |
| 150 // Do stuff, which (a)synchronously calls observer_->Observe([DialogEvent]). | 152 // Do stuff, which (a)synchronously calls observer_->Observe([DialogEvent]). |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 std::unique_ptr<net::EmbeddedTestServer> https_server_; | 184 std::unique_ptr<net::EmbeddedTestServer> https_server_; |
| 183 // Weak, owned by the PaymentRequest object. | 185 // Weak, owned by the PaymentRequest object. |
| 184 TestChromePaymentRequestDelegate* delegate_; | 186 TestChromePaymentRequestDelegate* delegate_; |
| 185 | 187 |
| 186 DISALLOW_COPY_AND_ASSIGN(PaymentRequestInteractiveTestBase); | 188 DISALLOW_COPY_AND_ASSIGN(PaymentRequestInteractiveTestBase); |
| 187 }; | 189 }; |
| 188 | 190 |
| 189 } // namespace payments | 191 } // namespace payments |
| 190 | 192 |
| 191 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_INTERACTIVE_UITEST_B
ASE_H_ | 193 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_INTERACTIVE_UITEST_B
ASE_H_ |
| OLD | NEW |