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_TEST_UTIL_H_ | 5 #ifndef IOS_WEB_VIEW_TEST_WEB_VIEW_TEST_UTIL_H_ |
6 #define IOS_WEB_VIEW_TEST_WEB_VIEW_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 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 | 11 |
12 @class CWVWebView; | 12 @class CWVWebView; |
13 @class CWVWebViewConfiguration; | |
14 | 13 |
15 namespace ios_web_view { | 14 namespace ios_web_view { |
16 namespace test { | 15 namespace test { |
17 | 16 |
18 // Creates web view with given |configuration| and frame equal to screen bounds. | |
19 CWVWebView* CreateWebView(CWVWebViewConfiguration* configuration) | |
20 WARN_UNUSED_RESULT; | |
21 | |
22 // Creates web view with default configuration and frame equal to screen bounds. | 17 // Creates web view with default configuration and frame equal to screen bounds. |
23 CWVWebView* CreateWebView() WARN_UNUSED_RESULT; | 18 CWVWebView* CreateWebView() WARN_UNUSED_RESULT; |
24 | 19 |
25 // Loads |URL| in |web_view| and waits until the load completes. Asserts if | 20 // Loads |URL| in |web_view| and waits until the load completes. Asserts if |
26 // loading does not complete. | 21 // loading does not complete. |
27 bool LoadUrl(CWVWebView* web_view, NSURL* url) WARN_UNUSED_RESULT; | 22 bool LoadUrl(CWVWebView* web_view, NSURL* url) WARN_UNUSED_RESULT; |
28 | 23 |
29 // Returns whether the element with |element_id| in the passed |web_view| has | 24 // Returns whether the element with |element_id| in the passed |web_view| has |
30 // been tapped using a JavaScript click() event. | 25 // been tapped using a JavaScript click() event. |
31 bool TapWebViewElementWithId(CWVWebView* web_view, | 26 bool TapWebViewElementWithId(CWVWebView* web_view, |
(...skipping 10 matching lines...) Expand all Loading... |
42 | 37 |
43 // Waits until |web_view| stops loading. Returns false if the condition is not | 38 // Waits until |web_view| stops loading. Returns false if the condition is not |
44 // met within a timeout. | 39 // met within a timeout. |
45 bool WaitForWebViewLoadCompletionOrTimeout(CWVWebView* web_view) | 40 bool WaitForWebViewLoadCompletionOrTimeout(CWVWebView* web_view) |
46 WARN_UNUSED_RESULT; | 41 WARN_UNUSED_RESULT; |
47 | 42 |
48 } // namespace test | 43 } // namespace test |
49 } // namespace ios_web_view | 44 } // namespace ios_web_view |
50 | 45 |
51 #endif // IOS_WEB_VIEW_TEST_WEB_VIEW_TEST_UTIL_H_ | 46 #endif // IOS_WEB_VIEW_TEST_WEB_VIEW_TEST_UTIL_H_ |
OLD | NEW |