Chromium Code Reviews| 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 8506bb71116a7130ff0b63318d6cb319233e3a7b..76020336692c3b1542159ff7dca47d51adbf8438 100644 |
| --- a/ios/chrome/test/earl_grey/chrome_earl_grey.mm |
| +++ b/ios/chrome/test/earl_grey/chrome_earl_grey.mm |
| @@ -16,6 +16,7 @@ |
| #import "ios/chrome/test/app/history_test_util.h" |
| #include "ios/chrome/test/app/navigation_test_util.h" |
| #import "ios/chrome/test/app/static_html_view_test_util.h" |
| +#import "ios/chrome/test/earl_grey/chrome_matchers.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_interaction_test_util.h" |
| @@ -160,4 +161,21 @@ + (void)waitForStaticHTMLViewNotContainingText:(NSString*)text { |
| @"Failed, there was a static html view containing %@", text); |
| } |
| ++ (void)waitForOmniboxText:(NSString*)text { |
| + GREYCondition* condition = [GREYCondition |
| + conditionWithName:@"Wait for omnibox text." |
| + block:^BOOL { |
| + NSError* error = nil; |
| + [[EarlGrey |
| + selectElementWithMatcher:chrome_test_util::OmniboxText( |
| + base::SysNSStringToUTF8( |
| + text))] |
|
gchatz
2017/04/08 00:17:05
Could the matcher be made a local variable to have
Eugene But (OOO till 7-30)
2017/04/08 00:20:36
Using functions for matchers instead of local vari
liaoyuke
2017/04/08 00:43:07
replied in another comment, will make the change i
|
| + assertWithMatcher:grey_notNil() |
| + error:&error]; |
| + return error == nil; |
| + }]; |
| + GREYAssert([condition waitWithTimeout:testing::kWaitForUIElementTimeout], |
| + @"Failed, omnibox was not %@", text); |
| +} |
| + |
| @end |