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

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

Issue 2806743004: Fixing testBrowsingPostEntryWithButton flakiness. (Closed)
Patch Set: Created 3 years, 8 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
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
« ios/chrome/browser/web/forms_egtest.mm ('K') | « ios/chrome/test/earl_grey/chrome_earl_grey.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698