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

Unified Diff: ios/web_view/test/web_view_test_util.h

Issue 2940953003: Consolidated all CWVWebView test helpers inside web_view_test_util file. (Closed)
Patch Set: Addressed review comments Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web_view/test/chrome_web_view_test.mm ('k') | ios/web_view/test/web_view_test_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web_view/test/web_view_test_util.h
diff --git a/ios/web_view/test/web_view_test_util.h b/ios/web_view/test/web_view_test_util.h
index 79a36708fac86accd582e64f9862766a09364242..fbf604bf12992e18faf09f83f37ecdba2d59d86b 100644
--- a/ios/web_view/test/web_view_test_util.h
+++ b/ios/web_view/test/web_view_test_util.h
@@ -7,17 +7,24 @@
#import <Foundation/Foundation.h>
+#include "base/compiler_specific.h"
+
@class CWVWebView;
namespace ios_web_view {
namespace test {
// Creates web view with default configuration and frame equal to screen bounds.
-CWVWebView* CreateWebView();
+CWVWebView* CreateWebView() WARN_UNUSED_RESULT;
+
+// Loads |URL| in |web_view| and waits until the load completes. Asserts if
+// loading does not complete.
+bool LoadUrl(CWVWebView* web_view, NSURL* url) WARN_UNUSED_RESULT;
// Returns whether the element with |element_id| in the passed |web_view| has
// been tapped using a JavaScript click() event.
-bool TapChromeWebViewElementWithId(CWVWebView* web_view, NSString* element_id);
+bool TapWebViewElementWithId(CWVWebView* web_view,
+ NSString* element_id) WARN_UNUSED_RESULT;
// Waits until |script| is executed and synchronously returns the evaluation
// result.
@@ -26,7 +33,12 @@ id EvaluateJavaScript(CWVWebView* web_view, NSString* script, NSError** error);
// Waits for |web_view| to contain |text|. Returns false if the condition is not
// met within a timeout.
bool WaitForWebViewContainingTextOrTimeout(CWVWebView* web_view,
- NSString* text);
+ NSString* text) WARN_UNUSED_RESULT;
+
+// Waits until |web_view| stops loading. Returns false if the condition is not
+// met within a timeout.
+bool WaitForWebViewLoadCompletionOrTimeout(CWVWebView* web_view)
+ WARN_UNUSED_RESULT;
} // namespace test
} // namespace ios_web_view
« no previous file with comments | « ios/web_view/test/chrome_web_view_test.mm ('k') | ios/web_view/test/web_view_test_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698