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

Unified Diff: ios/web/public/test/earl_grey/web_view_matchers.mm

Issue 2167533002: [ios] EarlGrey test for scroll position restoration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comment Created 4 years, 5 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/public/test/earl_grey/web_view_matchers.mm
diff --git a/ios/web/public/test/earl_grey/web_view_matchers.mm b/ios/web/public/test/earl_grey/web_view_matchers.mm
index 5e83240867312e98ddd9d1b67ad56759d5aebba3..4fd7d231145c1e203efbef3db359b67b9aa4885c 100644
--- a/ios/web/public/test/earl_grey/web_view_matchers.mm
+++ b/ios/web/public/test/earl_grey/web_view_matchers.mm
@@ -28,6 +28,10 @@ id<GREYMatcher> webViewContainingText(const std::string& text,
[GREYMatchers matcherForWebViewContainingText:text inWebState:webState];
}
+id<GREYMatcher> webViewScrollView(web::WebState* webState) {
+ return [GREYMatchers matcherForWebViewScrollViewInWebState:webState];
+}
+
} // namespace web
@implementation GREYMatchers (WebViewAdditions)
@@ -72,4 +76,21 @@ id<GREYMatcher> webViewContainingText(const std::string& text,
autorelease];
}
++ (id<GREYMatcher>)matcherForWebViewScrollViewInWebState:
+ (web::WebState*)webState {
+ MatchesBlock matches = ^BOOL(UIView* view) {
+ return [view isKindOfClass:[UIScrollView class]] &&
+ [view.superview isKindOfClass:[WKWebView class]] &&
+ [view isDescendantOfView:webState->GetView()];
+ };
+
+ DescribeToBlock describe = ^(id<GREYDescription> description) {
+ [description appendText:@"web view scroll view"];
+ };
+
+ return [[[GREYElementMatcherBlock alloc] initWithMatchesBlock:matches
+ descriptionBlock:describe]
+ autorelease];
+}
+
@end
« no previous file with comments | « ios/web/public/test/earl_grey/web_view_matchers.h ('k') | ios/web/shell/test/app/web_view_interaction_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698