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 IOS_WEB_VIEW_TEST_WEB_VIEW_INTERACTION_TEST_UTIL_H_ | 5 #ifndef IOS_WEB_VIEW_TEST_WEB_VIEW_TEST_UTIL_H_ |
6 #define IOS_WEB_VIEW_TEST_WEB_VIEW_INTERACTION_TEST_UTIL_H_ | 6 #define IOS_WEB_VIEW_TEST_WEB_VIEW_TEST_UTIL_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 @class CWVWebView; | 10 @class CWVWebView; |
11 | 11 |
12 namespace ios_web_view { | 12 namespace ios_web_view { |
13 namespace test { | 13 namespace test { |
14 | 14 |
| 15 // Creates web view with default configuration and frame equal to screen bounds. |
| 16 CWVWebView* CreateWebView(); |
| 17 |
15 // Returns whether the element with |element_id| in the passed |web_view| has | 18 // Returns whether the element with |element_id| in the passed |web_view| has |
16 // been tapped using a JavaScript click() event. | 19 // been tapped using a JavaScript click() event. |
17 bool TapChromeWebViewElementWithId(CWVWebView* web_view, NSString* element_id); | 20 bool TapChromeWebViewElementWithId(CWVWebView* web_view, NSString* element_id); |
18 | 21 |
19 // Waits until |script| is executed and synchronously returns the evaluation | 22 // Waits until |script| is executed and synchronously returns the evaluation |
20 // result. | 23 // result. |
21 id EvaluateJavaScript(CWVWebView* web_view, NSString* script, NSError** error); | 24 id EvaluateJavaScript(CWVWebView* web_view, NSString* script, NSError** error); |
22 | 25 |
23 // Waits for |web_view| to contain |text|. Returns false if the condition is not | 26 // Waits for |web_view| to contain |text|. Returns false if the condition is not |
24 // met within a timeout. | 27 // met within a timeout. |
25 bool WaitForWebViewContainingTextOrTimeout(CWVWebView* web_view, | 28 bool WaitForWebViewContainingTextOrTimeout(CWVWebView* web_view, |
26 NSString* text); | 29 NSString* text); |
27 | 30 |
28 } // namespace test | 31 } // namespace test |
29 } // namespace ios_web_view | 32 } // namespace ios_web_view |
30 | 33 |
31 #endif // IOS_WEB_VIEW_TEST_WEB_VIEW_INTERACTION_TEST_UTIL_H_ | 34 #endif // IOS_WEB_VIEW_TEST_WEB_VIEW_TEST_UTIL_H_ |
OLD | NEW |