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

Unified Diff: ios/chrome/browser/context_menu/context_menu_egtest.mm

Issue 2642193012: Make EarlGrey matchers compliant with Chromium style. (Closed)
Patch Set: mistake 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
Index: ios/chrome/browser/context_menu/context_menu_egtest.mm
diff --git a/ios/chrome/browser/context_menu/context_menu_egtest.mm b/ios/chrome/browser/context_menu/context_menu_egtest.mm
index df742c5c38b962e4405dc829f73d6b1b48d3a8cb..c0e78cb289424c89443dc89b8a62f03231d8516e 100644
--- a/ios/chrome/browser/context_menu/context_menu_egtest.mm
+++ b/ios/chrome/browser/context_menu/context_menu_egtest.mm
@@ -25,7 +25,7 @@
#import "ios/web/public/test/http_server_util.h"
#include "url/gurl.h"
-using chrome_test_util::buttonWithAccessibilityLabelId;
+using chrome_test_util::ButtonWithAccessibilityLabelId;
namespace {
const char kUrlChromiumLogoPage[] =
@@ -42,19 +42,19 @@ const char kDestinationHtml[] =
"<script>document.title='new doc'</script>You made it!";
// Matcher for the open image button in the context menu.
-id<GREYMatcher> openImageButton() {
- return buttonWithAccessibilityLabelId(IDS_IOS_CONTENT_CONTEXT_OPENIMAGE);
+id<GREYMatcher> OpenImageButton() {
+ return ButtonWithAccessibilityLabelId(IDS_IOS_CONTENT_CONTEXT_OPENIMAGE);
}
// Matcher for the open image in new tab button in the context menu.
-id<GREYMatcher> openImageInNewTabButton() {
- return buttonWithAccessibilityLabelId(
+id<GREYMatcher> OpenImageInNewTabButton() {
+ return ButtonWithAccessibilityLabelId(
IDS_IOS_CONTENT_CONTEXT_OPENIMAGENEWTAB);
}
// Matcher for the open link in new tab button in the context menu.
-id<GREYMatcher> openLinkInNewTabButton() {
- return buttonWithAccessibilityLabelId(IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWTAB);
+id<GREYMatcher> OpenLinkInNewTabButton() {
Eugene But (OOO till 7-30) 2017/01/23 19:39:03 Could you please add TODO(crbug.com/638674) to cle
baxley 2017/01/24 22:18:48 Done.
+ return ButtonWithAccessibilityLabelId(IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWTAB);
}
// Waits for the context menu item to disappear. TODO(crbug.com/682871): Remove
@@ -78,7 +78,7 @@ void WaitForContextMenuItemDisappeared(id<GREYMatcher> contextMenuItemButton) {
void LongPressElementAndTapOnButton(const char* elementId,
id<GREYMatcher> contextMenuItemButton) {
[[EarlGrey selectElementWithMatcher:chrome_test_util::
- webViewBelongingToWebController()]
+ WebViewBelongingToWebController()]
performAction:chrome_test_util::longPressElementForContextMenu(elementId,
true)];
@@ -130,10 +130,10 @@ void SelectTabAtIndexInCurrentMode(NSUInteger index) {
[ChromeEarlGrey loadURL:pageURL];
chrome_test_util::AssertMainTabCount(1U);
- LongPressElementAndTapOnButton(kChromiumImageID, openImageButton());
+ LongPressElementAndTapOnButton(kChromiumImageID, OpenImageButton());
// Verify url and tab count.
- [[EarlGrey selectElementWithMatcher:chrome_test_util::omniboxText(
+ [[EarlGrey selectElementWithMatcher:chrome_test_util::OmniboxText(
imageURL.GetContent())]
assertWithMatcher:grey_notNil()];
chrome_test_util::AssertMainTabCount(1U);
@@ -148,12 +148,12 @@ void SelectTabAtIndexInCurrentMode(NSUInteger index) {
[ChromeEarlGrey loadURL:pageURL];
chrome_test_util::AssertMainTabCount(1U);
- LongPressElementAndTapOnButton(kChromiumImageID, openImageInNewTabButton());
+ LongPressElementAndTapOnButton(kChromiumImageID, OpenImageInNewTabButton());
SelectTabAtIndexInCurrentMode(1U);
// Verify url and tab count.
- [[EarlGrey selectElementWithMatcher:chrome_test_util::omniboxText(
+ [[EarlGrey selectElementWithMatcher:chrome_test_util::OmniboxText(
imageURL.GetContent())]
assertWithMatcher:grey_notNil()];
chrome_test_util::AssertMainTabCount(2U);
@@ -175,12 +175,12 @@ void SelectTabAtIndexInCurrentMode(NSUInteger index) {
[ChromeEarlGrey loadURL:initialURL];
chrome_test_util::AssertMainTabCount(1U);
- LongPressElementAndTapOnButton(kDestinationLinkID, openLinkInNewTabButton());
+ LongPressElementAndTapOnButton(kDestinationLinkID, OpenLinkInNewTabButton());
SelectTabAtIndexInCurrentMode(1U);
// Verify url and tab count.
- [[EarlGrey selectElementWithMatcher:chrome_test_util::omniboxText(
+ [[EarlGrey selectElementWithMatcher:chrome_test_util::OmniboxText(
destinationURL.GetContent())]
assertWithMatcher:grey_notNil()];
chrome_test_util::AssertMainTabCount(2U);
@@ -210,14 +210,14 @@ void SelectTabAtIndexInCurrentMode(NSUInteger index) {
// Scroll down on the web view to make the link visible.
[[EarlGrey
- selectElementWithMatcher:webViewScrollView(
+ selectElementWithMatcher:WebViewScrollView(
chrome_test_util::GetCurrentWebState())]
performAction:grey_swipeFastInDirection(kGREYDirectionUp)];
- [[EarlGrey selectElementWithMatcher:chrome_test_util::webViewContainingText(
+ [[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewContainingText(
kDestinationLinkID)]
assertWithMatcher:grey_notNil()];
- LongPressElementAndTapOnButton(kDestinationLinkID, openLinkInNewTabButton());
+ LongPressElementAndTapOnButton(kDestinationLinkID, OpenLinkInNewTabButton());
// Earl Grey cannot preperly synchronize some animations, so adding a
// WaitUntilCondition to wait for the new tab opening animation to finish
@@ -225,7 +225,7 @@ void SelectTabAtIndexInCurrentMode(NSUInteger index) {
ConditionBlock condition = ^{
NSError* error = nil;
[[EarlGrey
- selectElementWithMatcher:webViewScrollView(
+ selectElementWithMatcher:WebViewScrollView(
chrome_test_util::GetCurrentWebState())]
assertWithMatcher:grey_interactable()
error:&error];
@@ -238,7 +238,7 @@ void SelectTabAtIndexInCurrentMode(NSUInteger index) {
// Make the toolbar visible by scrolling up on the web view to select the
// newly opened tab.
[[EarlGrey
- selectElementWithMatcher:webViewScrollView(
+ selectElementWithMatcher:WebViewScrollView(
chrome_test_util::GetCurrentWebState())]
performAction:grey_swipeFastInDirection(kGREYDirectionDown)];
chrome_test_util::AssertToolbarVisible();
@@ -246,7 +246,7 @@ void SelectTabAtIndexInCurrentMode(NSUInteger index) {
SelectTabAtIndexInCurrentMode(1U);
// Verify url and tab count.
- [[EarlGrey selectElementWithMatcher:chrome_test_util::omniboxText(
+ [[EarlGrey selectElementWithMatcher:chrome_test_util::OmniboxText(
destinationURL.GetContent())]
assertWithMatcher:grey_notNil()];
chrome_test_util::AssertMainTabCount(2U);

Powered by Google App Engine
This is Rietveld 408576698