| 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
|
|
|