| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import <string> | 5 #import <string> |
| 6 | 6 |
| 7 #import <EarlGrey/EarlGrey.h> | 7 #import <EarlGrey/EarlGrey.h> |
| 8 | 8 |
| 9 #import "ios/web/public/web_state/web_state.h" | 9 #import "ios/web/public/web_state/web_state.h" |
| 10 | 10 |
| 11 namespace web { | 11 namespace web { |
| 12 | 12 |
| 13 // Shorthand for GREYMatchers::matcherForWebViewInWebState. | 13 // Matcher for WKWebView which belogs to the given |webState|. |
| 14 id<GREYMatcher> webViewInWebState(web::WebState* webState); | 14 id<GREYMatcher> webViewInWebState(WebState* web_state); |
| 15 | 15 |
| 16 // Shorthand for GREYMatchers::matcherForWebViewContainingText:inWebState. | 16 // Matcher for WKWebView containing |text|. |
| 17 id<GREYMatcher> webViewContainingText(const std::string& text, | 17 id<GREYMatcher> webViewContainingText(std::string text, WebState* web_state); |
| 18 web::WebState* webState); | |
| 19 | 18 |
| 20 // Shorthand for GREYMatchers::matcherForWebWithCSSSelector:inWebState. | 19 // Matcher for WKWebView containing an html element which matches |selector|. |
| 21 id<GREYMatcher> webViewCssSelector(const std::string& selector, | 20 id<GREYMatcher> webViewCssSelector(std::string selector, WebState* web_state); |
| 22 web::WebState* webState); | |
| 23 | 21 |
| 24 // Shorthand for GREYMatchers::matcherForWebViewScrollViewInWebState. | 22 // Matcher for WKWebView's scroll view. |
| 25 id<GREYMatcher> webViewScrollView(web::WebState* webState); | 23 id<GREYMatcher> webViewScrollView(WebState* web_state); |
| 26 | 24 |
| 27 } // namespace web | 25 } // namespace web |
| 28 | |
| 29 @interface GREYMatchers (WebViewAdditions) | |
| 30 | |
| 31 // Matcher for WKWebView which belogs to the given |webState|. | |
| 32 + (id<GREYMatcher>)matcherForWebViewInWebState:(web::WebState*)webState; | |
| 33 | |
| 34 // Matcher for WKWebView containing |text|. | |
| 35 + (id<GREYMatcher>)matcherForWebViewContainingText:(const std::string&)text | |
| 36 inWebState:(web::WebState*)webState; | |
| 37 | |
| 38 // Matcher for WKWebView containing an html element which matches |selector|. | |
| 39 + (id<GREYMatcher>)matcherForWebWithCSSSelector:(const std::string&)selector | |
| 40 inWebState:(web::WebState*)webState; | |
| 41 | |
| 42 // Matcher for WKWebView's scroll view. | |
| 43 + (id<GREYMatcher>)matcherForWebViewScrollViewInWebState: | |
| 44 (web::WebState*)webState; | |
| 45 | |
| 46 @end | |
| OLD | NEW |