| 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 namespace web { | 9 namespace web { |
| 10 | 10 |
| 11 // Shorthand for GREYMatchers::matcherForWebViewContainingText. | 11 // Shorthand for GREYMatchers::matcherForWebViewContainingText. |
| 12 id<GREYMatcher> webViewContainingText(const std::string& text); | 12 id<GREYMatcher> webViewContainingText(const std::string& text); |
| 13 | 13 |
| 14 // Shorthand for GREYMatchers::matcherForWebWithCSSSelector. | 14 // Shorthand for GREYMatchers::matcherForWebWithCSSSelector. |
| 15 id<GREYMatcher> webViewCssSelector(const std::string& selector); | 15 id<GREYMatcher> webViewCssSelector(const std::string& selector); |
| 16 | 16 |
| 17 // Shorthand for GREYMatchers::matcherForWebViewScrollView. | 17 // Shorthand for GREYMatchers::matcherForWebViewScrollView. |
| 18 id<GREYMatcher> webViewScrollView(); | 18 id<GREYMatcher> webViewScrollView(); |
| 19 | 19 |
| 20 // Shorthand for GREYMatchers::matcherForWebViewMIMETYPE. |
| 21 id<GREYMatcher> webViewMimeType(const std::string& mime_type); |
| 22 |
| 20 // Shorthand for GREYMatchers::matcherForAddressFieldEqualToText. | 23 // Shorthand for GREYMatchers::matcherForAddressFieldEqualToText. |
| 21 id<GREYMatcher> addressFieldText(const std::string& text); | 24 id<GREYMatcher> addressFieldText(const std::string& text); |
| 22 | 25 |
| 23 // Shorthand for GREYMatchers::matcherForBackButton. | 26 // Shorthand for GREYMatchers::matcherForBackButton. |
| 24 id<GREYMatcher> backButton(); | 27 id<GREYMatcher> backButton(); |
| 25 | 28 |
| 26 // Shorthand for GREYMatchers::matcherForForwardButton. | 29 // Shorthand for GREYMatchers::matcherForForwardButton. |
| 27 id<GREYMatcher> forwardButton(); | 30 id<GREYMatcher> forwardButton(); |
| 28 | 31 |
| 29 // Shorthand for GREYMatchers::matcherForAddressField. | 32 // Shorthand for GREYMatchers::matcherForAddressField. |
| 30 id<GREYMatcher> addressField(); | 33 id<GREYMatcher> addressField(); |
| 31 | 34 |
| 32 } // namespace web | 35 } // namespace web |
| 33 | 36 |
| 34 @interface GREYMatchers (WebShellAdditions) | 37 @interface GREYMatchers (WebShellAdditions) |
| 35 | 38 |
| 36 // Matcher for WKWebView containing |text|. | 39 // Matcher for WKWebView containing |text|. |
| 37 + (id<GREYMatcher>)matcherForWebViewContainingText:(const std::string&)text; | 40 + (id<GREYMatcher>)matcherForWebViewContainingText:(const std::string&)text; |
| 38 | 41 |
| 39 // Matcher for WKWebView containing an html element which matches |selector|. | 42 // Matcher for WKWebView containing an html element which matches |selector|. |
| 40 + (id<GREYMatcher>)matcherForWebWithCSSSelector:(const std::string&)selector; | 43 + (id<GREYMatcher>)matcherForWebWithCSSSelector:(const std::string&)selector; |
| 41 | 44 |
| 42 // Matcher for WKWebView's scroll view. | 45 // Matcher for WKWebView's scroll view. |
| 43 + (id<GREYMatcher>)matcherForWebViewScrollView; | 46 + (id<GREYMatcher>)matcherForWebViewScrollView; |
| 44 | 47 |
| 48 // Matcher for WKWebView with given MIME type. |
| 49 + (id<GREYMatcher>)matcherForWebViewMIMEType:(const std::string&)MIMEType; |
| 50 |
| 45 // Matcher for web shell address field text property equal to |text|. | 51 // Matcher for web shell address field text property equal to |text|. |
| 46 + (id<GREYMatcher>)matcherForAddressFieldEqualToText:(const std::string&)text; | 52 + (id<GREYMatcher>)matcherForAddressFieldEqualToText:(const std::string&)text; |
| 47 | 53 |
| 48 // Matcher for back button in web shell. | 54 // Matcher for back button in web shell. |
| 49 + (id<GREYMatcher>)matcherForWebShellBackButton; | 55 + (id<GREYMatcher>)matcherForWebShellBackButton; |
| 50 | 56 |
| 51 // Matcher for forward button in web shell. | 57 // Matcher for forward button in web shell. |
| 52 + (id<GREYMatcher>)matcherForWebShellForwardButton; | 58 + (id<GREYMatcher>)matcherForWebShellForwardButton; |
| 53 | 59 |
| 54 // Matcher for address field in web shell. | 60 // Matcher for address field in web shell. |
| 55 + (id<GREYMatcher>)matcherForWebShellAddressField; | 61 + (id<GREYMatcher>)matcherForWebShellAddressField; |
| 56 | 62 |
| 57 @end | 63 @end |
| OLD | NEW |