| 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_BROWSERTEST_BASE_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_INTERACTIVE_UITEST_BASE
_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_BROWSERTEST_BASE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" | 14 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" |
| 15 #include "chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.
h" | 15 #include "chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.
h" |
| 16 #include "chrome/test/base/in_process_browser_test.h" | 16 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 : public autofill::PersonalDataManagerObserver { | 51 : public autofill::PersonalDataManagerObserver { |
| 52 public: | 52 public: |
| 53 PersonalDataLoadedObserverMock(); | 53 PersonalDataLoadedObserverMock(); |
| 54 ~PersonalDataLoadedObserverMock() override; | 54 ~PersonalDataLoadedObserverMock() override; |
| 55 | 55 |
| 56 MOCK_METHOD0(OnPersonalDataChanged, void()); | 56 MOCK_METHOD0(OnPersonalDataChanged, void()); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 // Base class for any interactive PaymentRequest test that will need to open | 59 // Base class for any interactive PaymentRequest test that will need to open |
| 60 // the UI and interact with it. | 60 // the UI and interact with it. |
| 61 class PaymentRequestInteractiveTestBase | 61 class PaymentRequestBrowserTestBase |
| 62 : public InProcessBrowserTest, | 62 : public InProcessBrowserTest, |
| 63 public PaymentRequestDialogView::ObserverForTest, | 63 public PaymentRequestDialogView::ObserverForTest, |
| 64 public views::WidgetObserver { | 64 public views::WidgetObserver { |
| 65 protected: | 65 protected: |
| 66 // Test will open a browser window to |test_file_path| (relative to | 66 // Test will open a browser window to |test_file_path| (relative to |
| 67 // chrome/test/data/payments). | 67 // chrome/test/data/payments). |
| 68 explicit PaymentRequestInteractiveTestBase(const std::string& test_file_path); | 68 explicit PaymentRequestBrowserTestBase(const std::string& test_file_path); |
| 69 ~PaymentRequestInteractiveTestBase() override; | 69 ~PaymentRequestBrowserTestBase() override; |
| 70 | 70 |
| 71 void SetUpCommandLine(base::CommandLine* command_line) override; | 71 void SetUpCommandLine(base::CommandLine* command_line) override; |
| 72 void SetUpOnMainThread() override; | 72 void SetUpOnMainThread() override; |
| 73 | 73 |
| 74 // PaymentRequestDialogView::ObserverForTest | 74 // PaymentRequestDialogView::ObserverForTest |
| 75 void OnDialogOpened() override; | 75 void OnDialogOpened() override; |
| 76 void OnOrderSummaryOpened() override; | 76 void OnOrderSummaryOpened() override; |
| 77 void OnPaymentMethodOpened() override; | 77 void OnPaymentMethodOpened() override; |
| 78 void OnCreditCardEditorOpened() override; | 78 void OnCreditCardEditorOpened() override; |
| 79 void OnBackNavigation() override; | 79 void OnBackNavigation() override; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // Wait for the event passed to ResetEventObserver() to occur. | 192 // Wait for the event passed to ResetEventObserver() to occur. |
| 193 void WaitForObservedEvent(); | 193 void WaitForObservedEvent(); |
| 194 | 194 |
| 195 private: | 195 private: |
| 196 std::unique_ptr<DialogEventObserver> event_observer_; | 196 std::unique_ptr<DialogEventObserver> event_observer_; |
| 197 const std::string test_file_path_; | 197 const std::string test_file_path_; |
| 198 std::unique_ptr<net::EmbeddedTestServer> https_server_; | 198 std::unique_ptr<net::EmbeddedTestServer> https_server_; |
| 199 // Weak, owned by the PaymentRequest object. | 199 // Weak, owned by the PaymentRequest object. |
| 200 TestChromePaymentRequestDelegate* delegate_; | 200 TestChromePaymentRequestDelegate* delegate_; |
| 201 | 201 |
| 202 DISALLOW_COPY_AND_ASSIGN(PaymentRequestInteractiveTestBase); | 202 DISALLOW_COPY_AND_ASSIGN(PaymentRequestBrowserTestBase); |
| 203 }; | 203 }; |
| 204 | 204 |
| 205 } // namespace payments | 205 } // namespace payments |
| 206 | 206 |
| 207 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_INTERACTIVE_UITEST_B
ASE_H_ | 207 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_BROWSERTEST_BASE_H_ |
| OLD | NEW |