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