| Index: ios/web/shell/test/earl_grey/shell_earl_grey.mm
|
| diff --git a/ios/web/shell/test/earl_grey/shell_earl_grey.mm b/ios/web/shell/test/earl_grey/shell_earl_grey.mm
|
| index bdf8f1b47face21f3577251265b48677eb79864c..7c25ee2b8fc094cbfccfc09658037b568618c169 100644
|
| --- a/ios/web/shell/test/earl_grey/shell_earl_grey.mm
|
| +++ b/ios/web/shell/test/earl_grey/shell_earl_grey.mm
|
| @@ -6,8 +6,10 @@
|
|
|
| #import <EarlGrey/EarlGrey.h>
|
|
|
| +#include "base/strings/sys_string_conversions.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"
|
| #include "ios/web/shell/test/app/navigation_test_util.h"
|
| #import "ios/web/shell/test/app/web_shell_test_util.h"
|
|
|
| @@ -40,4 +42,16 @@
|
| [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
|
| }
|
|
|
| ++ (void)waitForWebViewContainingText:(NSString*)text {
|
| + GREYCondition* condition = [GREYCondition
|
| + conditionWithName:@"Wait for web view containing text"
|
| + block:^BOOL {
|
| + return web::test::WebViewContainingText(
|
| + web::shell_test_util::GetCurrentWebState(),
|
| + base::SysNSStringToUTF8(text));
|
| + }];
|
| + GREYAssert([condition waitWithTimeout:testing::kWaitForUIElementTimeout],
|
| + @"Failed waiting for web view containing %@", text);
|
| +}
|
| +
|
| @end
|
|
|