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

Unified Diff: ios/chrome/test/earl_grey/chrome_earl_grey.mm

Issue 2798773002: Create ChromeEarlGrey waitForWebViewContainingText. (Closed)
Patch Set: 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/chrome/test/earl_grey/chrome_earl_grey.h ('k') | ios/chrome/test/earl_grey/device_check_egtest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/test/earl_grey/chrome_earl_grey.mm
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.mm b/ios/chrome/test/earl_grey/chrome_earl_grey.mm
index 970abc0bfd4276df1e472516718046323abc77de..9c7fd8c81688ebc46303c19a20f374fbb6e4a665 100644
--- a/ios/chrome/test/earl_grey/chrome_earl_grey.mm
+++ b/ios/chrome/test/earl_grey/chrome_earl_grey.mm
@@ -21,6 +21,7 @@
#import "ios/chrome/test/app/static_html_view_test_util.h"
#import "ios/testing/wait_util.h"
#import "ios/web/public/test/earl_grey/js_test_util.h"
+#import "ios/web/public/test/web_view_content_test_util.h"
#import "ios/web/public/test/web_view_interaction_test_util.h"
#import "ios/web/public/web_state/js/crw_js_injection_receiver.h"
#import "ios/web/public/web_state/web_state.h"
@@ -184,4 +185,14 @@ id ExecuteJavaScript(NSString* javascript,
@"Failed, there was a static html view containing %@", text);
}
++ (void)waitForWebViewContainingText:(std::string)text {
+ GREYCondition* condition = [GREYCondition
+ conditionWithName:@"Wait for web view containing text"
+ block:^BOOL {
+ return web::test::IsWebViewContainingText(
+ chrome_test_util::GetCurrentWebState(), text);
+ }];
+ GREYAssert([condition waitWithTimeout:testing::kWaitForUIElementTimeout],
+ @"Failed waiting for web view containing %s", text.c_str());
+}
@end
« no previous file with comments | « ios/chrome/test/earl_grey/chrome_earl_grey.h ('k') | ios/chrome/test/earl_grey/device_check_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698