| 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 #ifndef IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_MATCHERS_H_ | 5 #ifndef IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_MATCHERS_H_ |
| 6 #define IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_MATCHERS_H_ | 6 #define IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_MATCHERS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #import <EarlGrey/EarlGrey.h> | 10 #import <EarlGrey/EarlGrey.h> |
| 11 | 11 |
| 12 #import "ios/web/public/web_state/web_state.h" | 12 #import "ios/web/public/web_state/web_state.h" |
| 13 | 13 |
| 14 namespace web { | 14 namespace web { |
| 15 | 15 |
| 16 // Matcher for WKWebView which belogs to the given |webState|. | 16 // Matcher for WKWebView which belogs to the given |webState|. |
| 17 id<GREYMatcher> webViewInWebState(WebState* web_state); | 17 id<GREYMatcher> WebViewInWebState(WebState* web_state); |
| 18 | 18 |
| 19 // Matcher for WKWebView containing |text|. | 19 // Matcher for WKWebView containing |text|. |
| 20 id<GREYMatcher> webViewContainingText(std::string text, WebState* web_state); | 20 id<GREYMatcher> WebViewContainingText(std::string text, WebState* web_state); |
| 21 | 21 |
| 22 // Matcher for WKWebView not containing |text|. This should be used to verify | 22 // Matcher for WKWebView not containing |text|. This should be used to verify |
| 23 // that a visible WKWebView does not contain |text|, rather than verifying that | 23 // that a visible WKWebView does not contain |text|, rather than verifying that |
| 24 // a WKWebView containing |text| is not visible, as would be the case if | 24 // a WKWebView containing |text| is not visible, as would be the case if |
| 25 // webViewContainingText() were asserted with grey_nil(). | 25 // WebViewContainingText() were asserted with grey_nil(). |
| 26 id<GREYMatcher> webViewNotContainingText(std::string text, WebState* web_state); | 26 id<GREYMatcher> WebViewNotContainingText(std::string text, WebState* web_state); |
| 27 | 27 |
| 28 // Matcher for WKWebView containing a blocked |image_id|. When blocked, the | 28 // Matcher for WKWebView containing a blocked |image_id|. When blocked, the |
| 29 // image element will be smaller actual image size. | 29 // image element will be smaller actual image size. |
| 30 id<GREYMatcher> webViewContainingBlockedImage(std::string image_id, | 30 id<GREYMatcher> WebViewContainingBlockedImage(std::string image_id, |
| 31 WebState* web_state); | 31 WebState* web_state); |
| 32 | 32 |
| 33 // Matcher for WKWebView containing loaded image with |image_id|. When loaded, | 33 // Matcher for WKWebView containing loaded image with |image_id|. When loaded, |
| 34 // the image element will have the same size as actual image. | 34 // the image element will have the same size as actual image. |
| 35 id<GREYMatcher> webViewContainingLoadedImage(std::string image_id, | 35 id<GREYMatcher> WebViewContainingLoadedImage(std::string image_id, |
| 36 WebState* web_state); | 36 WebState* web_state); |
| 37 | 37 |
| 38 // Matcher for WKWebView containing an html element which matches |selector|. | 38 // Matcher for WKWebView containing an html element which matches |selector|. |
| 39 id<GREYMatcher> webViewCssSelector(std::string selector, WebState* web_state); | 39 id<GREYMatcher> WebViewCssSelector(std::string selector, WebState* web_state); |
| 40 | 40 |
| 41 // Matcher for WKWebView's scroll view. | 41 // Matcher for WKWebView's scroll view. |
| 42 id<GREYMatcher> webViewScrollView(WebState* web_state); | 42 id<GREYMatcher> WebViewScrollView(WebState* web_state); |
| 43 | 43 |
| 44 // Matcher for an interstitial page. Does not wait if the page is not displayed. | 44 // Matcher for an interstitial page. Does not wait if the page is not displayed. |
| 45 id<GREYMatcher> interstitial(WebState* web_state); | 45 id<GREYMatcher> Interstitial(WebState* web_state); |
| 46 | 46 |
| 47 // Matcher for interstitial page containing |text|. Waits until the text is | 47 // Matcher for interstitial page containing |text|. Waits until the text is |
| 48 // displayed or timed out. | 48 // displayed or timed out. |
| 49 id<GREYMatcher> interstitialContainingText(NSString* text, WebState* web_state); | 49 id<GREYMatcher> InterstitialContainingText(NSString* text, WebState* web_state); |
| 50 | 50 |
| 51 } // namespace web | 51 } // namespace web |
| 52 | 52 |
| 53 #endif // IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_MATCHERS_H_ | 53 #endif // IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_MATCHERS_H_ |
| OLD | NEW |