| 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..2db43509709827bedc4bc17dd22c3c287d38eea8 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,15 @@ id ExecuteJavaScript(NSString* javascript,
|
| @"Failed, there was a static html view containing %@", text);
|
| }
|
|
|
| ++ (void)waitForWebViewContainingText:(NSString*)text {
|
| + GREYCondition* condition =
|
| + [GREYCondition conditionWithName:@"Wait for web view containing text"
|
| + block:^BOOL {
|
| + return web::test::WebViewContainingText(
|
| + chrome_test_util::GetCurrentWebState(),
|
| + base::SysNSStringToUTF8(text));
|
| + }];
|
| + GREYAssert([condition waitWithTimeout:testing::kWaitForUIElementTimeout],
|
| + @"Failed waiting for web view containing %@", text);
|
| +}
|
| @end
|
|
|