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

Unified Diff: ios/web/shell/test/earl_grey/shell_matchers.mm

Issue 2448753002: Refactor wait_util so it isn't coupled to EarlGrey. (Closed)
Patch Set: cleanup Created 4 years, 2 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/web/shell/test/earl_grey/shell_matchers.mm
diff --git a/ios/web/shell/test/earl_grey/shell_matchers.mm b/ios/web/shell/test/earl_grey/shell_matchers.mm
index 5e71d586fcaf04b655d23df432dffb640bcbae79..6b4e7875b810ae7f15c125fd1dfdf91d215f88e4 100644
--- a/ios/web/shell/test/earl_grey/shell_matchers.mm
+++ b/ios/web/shell/test/earl_grey/shell_matchers.mm
@@ -7,7 +7,7 @@
#import "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#import "ios/testing/earl_grey/matchers.h"
-#include "ios/testing/earl_grey/wait_util.h"
+#include "ios/testing/wait_util.h"
#import "ios/web/public/web_state/web_state.h"
#import "ios/web/public/test/earl_grey/web_view_matchers.h"
#import "ios/web/shell/test/app/web_shell_test_util.h"
@@ -43,9 +43,17 @@ id<GREYMatcher> addressFieldText(std::string text) {
return NO;
}
UITextField* text_field = base::mac::ObjCCastStrict<UITextField>(view);
- testing::WaitUntilCondition(testing::kWaitForUIElementTimeout, ^bool() {
- return [text_field.text isEqualToString:base::SysUTF8ToNSString(text)];
- });
+ NSString* errorMessage = [NSString
Eugene But (OOO till 7-30) 2016/10/25 14:43:39 s/errorMessage/error_message
baxley 2016/10/25 18:50:05 Done.
+ stringWithFormat:
+ @"Address field text did not match. expected: %@, actual: %@",
+ base::SysUTF8ToNSString(text), text_field.text];
+ GREYAssert(testing::WaitUntilConditionOrTimeout(
+ testing::kWaitForUIElementTimeout,
+ ^bool() {
Eugene But (OOO till 7-30) 2016/10/25 14:43:39 Optional nit (seems to be better formatting): ^{
baxley 2016/10/25 18:50:05 This is what git cl format did. Would you rather I
+ return [text_field.text
+ isEqualToString:base::SysUTF8ToNSString(text)];
+ }),
+ errorMessage);
return YES;
};

Powered by Google App Engine
This is Rietveld 408576698