| Index: chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h
|
| diff --git a/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h b/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f68f50ec5677f2252c63bd9da095fa7a2bd2469c
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h
|
| @@ -0,0 +1,56 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_INTERACTIVE_UITEST_BASE_H_
|
| +#define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_INTERACTIVE_UITEST_BASE_H_
|
| +
|
| +#include <vector>
|
| +
|
| +#include "base/command_line.h"
|
| +#include "chrome/test/base/in_process_browser_test.h"
|
| +#include "net/test/embedded_test_server/embedded_test_server.h"
|
| +
|
| +namespace content {
|
| +class WebContents;
|
| +} // namespace content
|
| +
|
| +namespace payments {
|
| +
|
| +class PaymentRequest;
|
| +
|
| +// Base class for any interactive PaymentRequest test that will need to open
|
| +// the UI and interact with it.
|
| +class PaymentRequestInteractiveTestBase : public InProcessBrowserTest {
|
| + protected:
|
| + // Test will open a browser window to |test_file_path| (relative to
|
| + // chrome/test/data/payments).
|
| + explicit PaymentRequestInteractiveTestBase(const std::string& test_file_path);
|
| + ~PaymentRequestInteractiveTestBase() override;
|
| +
|
| + void SetUpCommandLine(base::CommandLine* command_line) override;
|
| + void SetUpOnMainThread() override;
|
| +
|
| + // Will call JavaScript to invoke the PaymentRequest dialog and verify that
|
| + // it's open.
|
| + void InvokePaymentRequestUI();
|
| +
|
| + // Convenience method to get a list of PaymentRequest associated with
|
| + // |web_contents|.
|
| + const std::vector<PaymentRequest*> GetPaymentRequests(
|
| + content::WebContents* web_contents);
|
| +
|
| + content::WebContents* GetActiveWebContents();
|
| +
|
| + net::EmbeddedTestServer* https_server() { return https_server_.get(); }
|
| +
|
| + private:
|
| + const std::string test_file_path_;
|
| + std::unique_ptr<net::EmbeddedTestServer> https_server_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(PaymentRequestInteractiveTestBase);
|
| +};
|
| +
|
| +} // namespace payments
|
| +
|
| +#endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_INTERACTIVE_UITEST_BASE_H_
|
|
|