Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Side by Side Diff: chrome/browser/ui/views/payments/payment_request_interactive_uitest_base.h

Issue 2631133003: [Payments] Introduce basic interactive browsertests for Payment Request (Closed)
Patch Set: Initial Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
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_
7
8 #include <vector>
9
10 #include "base/command_line.h"
11 #include "chrome/test/base/in_process_browser_test.h"
12 #include "net/test/embedded_test_server/embedded_test_server.h"
13
14 namespace content {
15 class WebContents;
16 } // namespace content
17
18 namespace payments {
19
20 class PaymentRequest;
21
22 // Base class for any interactive PaymentRequest test that will need to open
23 // the UI and interact with it.
24 class PaymentRequestInteractiveTestBase : public InProcessBrowserTest {
25 protected:
26 // Test will open a browser window to |test_file_path| (relative to
27 // chrome/test/data/payments).
28 explicit PaymentRequestInteractiveTestBase(const std::string& test_file_path);
29 ~PaymentRequestInteractiveTestBase() override;
30
31 void SetUpCommandLine(base::CommandLine* command_line) override;
32 void SetUpOnMainThread() override;
33
34 // Will call JavaScript to invoke the PaymentRequest dialog and verify that
35 // it's open.
36 void InvokePaymentRequestUI();
37
38 // Convenience method to get a list of PaymentRequest associated with
39 // |web_contents|.
40 const std::vector<PaymentRequest*> GetPaymentRequests(
41 content::WebContents* web_contents);
42
43 content::WebContents* GetActiveWebContents();
44
45 net::EmbeddedTestServer* https_server() { return https_server_.get(); }
46
47 private:
48 const std::string test_file_path_;
49 std::unique_ptr<net::EmbeddedTestServer> https_server_;
50
51 DISALLOW_COPY_AND_ASSIGN(PaymentRequestInteractiveTestBase);
52 };
53
54 } // namespace payments
55
56 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_INTERACTIVE_UITEST_B ASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698