Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Unified Diff: ios/web/shell/test/page_state_egtest.mm

Issue 2642193012: Make EarlGrey matchers compliant with Chromium style. (Closed)
Patch Set: build.gn and rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/shell/test/navigation_egtest.mm ('k') | ios/web/shell/test/pdf_egtest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/shell/test/page_state_egtest.mm
diff --git a/ios/web/shell/test/page_state_egtest.mm b/ios/web/shell/test/page_state_egtest.mm
index 3aa24848fa5c10a723f6d49a6699b66e2150591c..a0d11aaead0a638aa75b5a7d6edc7a5021e3e99f 100644
--- a/ios/web/shell/test/page_state_egtest.mm
+++ b/ios/web/shell/test/page_state_egtest.mm
@@ -33,7 +33,7 @@ const CGFloat kScrollOffset2 = 40.0f;
// Returns a matcher for asserting that element's content offset matches the
// given |offset|.
-id<GREYMatcher> contentOffset(CGPoint offset) {
+id<GREYMatcher> ContentOffset(CGPoint offset) {
MatchesBlock matches = ^BOOL(UIScrollView* element) {
return CGPointEqualToPoint([element contentOffset], offset);
};
@@ -59,8 +59,8 @@ void WaitForOffset(CGFloat y_offset) {
block:^BOOL {
NSError* error = nil;
[[EarlGrey
- selectElementWithMatcher:web::webViewScrollView()]
- assertWithMatcher:contentOffset(content_offset)
+ selectElementWithMatcher:web::WebViewScrollView()]
+ assertWithMatcher:ContentOffset(content_offset)
error:&error];
return (error == nil);
}];
@@ -89,27 +89,27 @@ using web::test::HttpServer;
[ShellEarlGrey loadURL:HttpServer::MakeUrl(kLongPage1)];
// Scroll the first page and verify the offset.
- [[EarlGrey selectElementWithMatcher:web::webViewScrollView()]
+ [[EarlGrey selectElementWithMatcher:web::WebViewScrollView()]
performAction:grey_scrollInDirection(kGREYDirectionDown, kScrollOffset1)];
- [[EarlGrey selectElementWithMatcher:web::webViewScrollView()]
- assertWithMatcher:contentOffset(CGPointMake(0, kScrollOffset1))];
+ [[EarlGrey selectElementWithMatcher:web::WebViewScrollView()]
+ assertWithMatcher:ContentOffset(CGPointMake(0, kScrollOffset1))];
// Load second URL, which is also a long page.
[ShellEarlGrey loadURL:HttpServer::MakeUrl(kLongPage2)];
// Scroll the second page and verify the offset.
- [[EarlGrey selectElementWithMatcher:web::webViewScrollView()]
+ [[EarlGrey selectElementWithMatcher:web::WebViewScrollView()]
performAction:grey_scrollInDirection(kGREYDirectionDown, kScrollOffset2)];
- [[EarlGrey selectElementWithMatcher:web::webViewScrollView()]
- assertWithMatcher:contentOffset(CGPointMake(0, kScrollOffset2))];
+ [[EarlGrey selectElementWithMatcher:web::WebViewScrollView()]
+ assertWithMatcher:ContentOffset(CGPointMake(0, kScrollOffset2))];
// Go back and verify that the first page offset has been restored.
- [[EarlGrey selectElementWithMatcher:web::backButton()]
+ [[EarlGrey selectElementWithMatcher:web::BackButton()]
performAction:grey_tap()];
WaitForOffset(kScrollOffset1);
// Go forward and verify that the second page offset has been restored.
- [[EarlGrey selectElementWithMatcher:web::forwardButton()]
+ [[EarlGrey selectElementWithMatcher:web::ForwardButton()]
performAction:grey_tap()];
WaitForOffset(kScrollOffset2);
}
« no previous file with comments | « ios/web/shell/test/navigation_egtest.mm ('k') | ios/web/shell/test/pdf_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698