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

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

Issue 2673753005: [Payments] Basic validation in the credit card editor. (Closed)
Patch Set: more tests Created 3 years, 10 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
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"
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 "chrome/browser/ui/views/payments/payment_request_dialog_view.h" 14 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h"
14 #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"
15 #include "chrome/test/base/in_process_browser_test.h" 16 #include "chrome/test/base/in_process_browser_test.h"
17 #include "components/autofill/core/browser/field_types.h"
16 #include "components/payments/payment_request.mojom.h" 18 #include "components/payments/payment_request.mojom.h"
17 #include "net/test/embedded_test_server/embedded_test_server.h" 19 #include "net/test/embedded_test_server/embedded_test_server.h"
18 #include "ui/views/widget/widget_observer.h" 20 #include "ui/views/widget/widget_observer.h"
19 21
20 namespace content { 22 namespace content {
21 class WebContents; 23 class WebContents;
22 } // namespace content 24 } // namespace content
23 25
24 namespace views { 26 namespace views {
25 class Widget; 27 class Widget;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 content::WebContents* GetActiveWebContents(); 76 content::WebContents* GetActiveWebContents();
75 77
76 void CreatePaymentRequestForTest( 78 void CreatePaymentRequestForTest(
77 content::WebContents* web_contents, 79 content::WebContents* web_contents,
78 mojo::InterfaceRequest<payments::mojom::PaymentRequest> request); 80 mojo::InterfaceRequest<payments::mojom::PaymentRequest> request);
79 81
80 // Click on a view from within the dialog and waits for an observed event 82 // Click on a view from within the dialog and waits for an observed event
81 // to be observed. 83 // to be observed.
82 void ClickOnDialogViewAndWait(DialogViewID view_id); 84 void ClickOnDialogViewAndWait(DialogViewID view_id);
83 85
86 // Setting the |value| in the textfield of a given |type|.
87 void SetEditorTextfieldValue(const base::string16& value,
88 autofill::ServerFieldType type);
89
90 // Whether the editor textfield for the given |type| is currently in an
91 // invalid state.
92 bool IsEditorTextfieldInvalid(autofill::ServerFieldType type);
93
84 // Sets proper animation delegates and waits for animation to finish. 94 // Sets proper animation delegates and waits for animation to finish.
85 void WaitForAnimation(); 95 void WaitForAnimation();
86 96
87 // Returns the text of the StyledLabel with the specific |view_id| that is a 97 // Returns the text of the StyledLabel with the specific |view_id| that is a
88 // child of the Payment Request dialog view. 98 // child of the Payment Request dialog view.
89 const base::string16& GetStyledLabelText(DialogViewID view_id); 99 const base::string16& GetStyledLabelText(DialogViewID view_id);
90 100
91 net::EmbeddedTestServer* https_server() { return https_server_.get(); } 101 net::EmbeddedTestServer* https_server() { return https_server_.get(); }
92 102
93 PaymentRequestDialogView* dialog_view() { return delegate_->dialog_view(); } 103 PaymentRequestDialogView* dialog_view() { return delegate_->dialog_view(); }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 std::unique_ptr<net::EmbeddedTestServer> https_server_; 154 std::unique_ptr<net::EmbeddedTestServer> https_server_;
145 // Weak, owned by the PaymentRequest object. 155 // Weak, owned by the PaymentRequest object.
146 TestChromePaymentRequestDelegate* delegate_; 156 TestChromePaymentRequestDelegate* delegate_;
147 157
148 DISALLOW_COPY_AND_ASSIGN(PaymentRequestInteractiveTestBase); 158 DISALLOW_COPY_AND_ASSIGN(PaymentRequestInteractiveTestBase);
149 }; 159 };
150 160
151 } // namespace payments 161 } // namespace payments
152 162
153 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_INTERACTIVE_UITEST_B ASE_H_ 163 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_INTERACTIVE_UITEST_B ASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698