Commit 0b848fbe authored by Mike Baxley's avatar Mike Baxley Committed by Commit Bot

Remove ContentOffset helper from fullscreen tests.

There is an EarlGrey method that does the same thing.

Bug: 638674
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ic4c0d8af6397477a1653367aeddf8b8ff060f70f
Reviewed-on: https://chromium-review.googlesource.com/777385
Commit-Queue: Mike Baxley <baxley@chromium.org>
Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517518}
parent 40f38e83
...@@ -36,24 +36,6 @@ namespace { ...@@ -36,24 +36,6 @@ namespace {
// The page height of test pages. This must be big enough to triger fullscreen. // The page height of test pages. This must be big enough to triger fullscreen.
const int kPageHeightEM = 200; const int kPageHeightEM = 200;
// TODO(crbug.com/638674): Move this to a shared location as it is a duplicate
// of ios/web/shell/test/page_state_egtest.mm.
// Returns a matcher for asserting that element's content offset matches the
// given |offset|.
id<GREYMatcher> ContentOffset(CGPoint offset) {
MatchesBlock matches = ^BOOL(UIScrollView* element) {
return CGPointEqualToPoint([element contentOffset], offset);
};
DescribeToBlock describe = ^(id<GREYDescription> description) {
[description appendText:@"contentOffset"];
};
return grey_allOf(
grey_kindOfClass([UIScrollView class]),
[[GREYElementMatcherBlock alloc] initWithMatchesBlock:matches
descriptionBlock:describe],
nil);
}
// Hides the toolbar by scrolling down. // Hides the toolbar by scrolling down.
void HideToolbarUsingUI() { void HideToolbarUsingUI() {
[[EarlGrey [[EarlGrey
...@@ -107,7 +89,7 @@ void AssertURLIs(const GURL& expectedURL) { ...@@ -107,7 +89,7 @@ void AssertURLIs(const GURL& expectedURL) {
[[EarlGrey [[EarlGrey
selectElementWithMatcher:web::WebViewScrollView( selectElementWithMatcher:web::WebViewScrollView(
chrome_test_util::GetCurrentWebState())] chrome_test_util::GetCurrentWebState())]
assertWithMatcher:ContentOffset(CGPointMake(0, yOffset))]; assertWithMatcher:grey_scrollViewContentOffset(CGPointMake(0, yOffset))];
} }
// Verifies that the toolbar properly appears/disappears when scrolling up/down // Verifies that the toolbar properly appears/disappears when scrolling up/down
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment