| 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. |
| 30 id<GREYMatcher> webViewContainingBlockedImage(std::string image_id, |
| 31 WebState* web_state); |
| 32 |
| 33 // Matcher for WKWebView containing a blocked |image_id|. When blocked, the |
| 29 // image will be smaller than |expected_size|. | 34 // image will be smaller than |expected_size|. |
| 35 // Note: deprecated. Use webViewContainingBlockedImage(std::string, WebState*) |
| 36 // instead. TODO(crbug.com/673520): Remove this method. |
| 30 id<GREYMatcher> webViewContainingBlockedImage(std::string image_id, | 37 id<GREYMatcher> webViewContainingBlockedImage(std::string image_id, |
| 31 CGSize expected_size, | 38 CGSize expected_size, |
| 32 WebState* web_state); | 39 WebState* web_state); |
| 33 | 40 |
| 34 // Matcher for WKWebView containing an html element which matches |selector|. | 41 // Matcher for WKWebView containing an html element which matches |selector|. |
| 35 id<GREYMatcher> webViewCssSelector(std::string selector, WebState* web_state); | 42 id<GREYMatcher> webViewCssSelector(std::string selector, WebState* web_state); |
| 36 | 43 |
| 37 // Matcher for WKWebView's scroll view. | 44 // Matcher for WKWebView's scroll view. |
| 38 id<GREYMatcher> webViewScrollView(WebState* web_state); | 45 id<GREYMatcher> webViewScrollView(WebState* web_state); |
| 39 | 46 |
| 40 // Matcher for an interstitial page. Does not wait if the page is not displayed. | 47 // Matcher for an interstitial page. Does not wait if the page is not displayed. |
| 41 id<GREYMatcher> interstitial(WebState* web_state); | 48 id<GREYMatcher> interstitial(WebState* web_state); |
| 42 | 49 |
| 43 // Matcher for interstitial page containing |text|. Waits until the text is | 50 // Matcher for interstitial page containing |text|. Waits until the text is |
| 44 // displayed or timed out. | 51 // displayed or timed out. |
| 45 id<GREYMatcher> interstitialContainingText(NSString* text, WebState* web_state); | 52 id<GREYMatcher> interstitialContainingText(NSString* text, WebState* web_state); |
| 46 | 53 |
| 47 } // namespace web | 54 } // namespace web |
| 48 | 55 |
| 49 #endif // IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_MATCHERS_H_ | 56 #endif // IOS_WEB_PUBLIC_TEST_EARL_GREY_WEB_VIEW_MATCHERS_H_ |
| OLD | NEW |