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

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

Issue 2732973003: Use shared matchers for common elements. (Closed)
Patch Set: clean up format with using Created 3 years, 9 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 | « no previous file | ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 738ceb3e147cd22933664ec705cc2773a2fa2dd0..f3182369de66dedd3f75104e5fa019c1e9cd7be0 100644
--- a/ios/chrome/browser/context_menu/context_menu_egtest.mm
+++ b/ios/chrome/browser/context_menu/context_menu_egtest.mm
@@ -56,12 +56,6 @@ id<GREYMatcher> OpenImageInNewTabButton() {
IDS_IOS_CONTENT_CONTEXT_OPENIMAGENEWTAB);
}
-// Matcher for the open link in new tab button in the context menu.
-// TODO(crbug.com/638674): Clean up code duplication.
-id<GREYMatcher> OpenLinkInNewTabButton() {
- return ButtonWithAccessibilityLabelId(IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWTAB);
-}
-
// Waits for the context menu item to disappear. TODO(crbug.com/682871): Remove
// this once EarlGrey is synchronized with context menu.
void WaitForContextMenuItemDisappeared(id<GREYMatcher> contextMenuItemButton) {
@@ -180,7 +174,8 @@ void SelectTabAtIndexInCurrentMode(NSUInteger index) {
[ChromeEarlGrey loadURL:initialURL];
chrome_test_util::AssertMainTabCount(1U);
- LongPressElementAndTapOnButton(kDestinationLinkID, OpenLinkInNewTabButton());
+ LongPressElementAndTapOnButton(kDestinationLinkID,
+ chrome_test_util::OpenLinkInNewTabMenuItem());
SelectTabAtIndexInCurrentMode(1U);
@@ -222,7 +217,8 @@ void SelectTabAtIndexInCurrentMode(NSUInteger index) {
kDestinationLinkID)]
assertWithMatcher:grey_notNil()];
- LongPressElementAndTapOnButton(kDestinationLinkID, OpenLinkInNewTabButton());
+ LongPressElementAndTapOnButton(kDestinationLinkID,
+ chrome_test_util::OpenLinkInNewTabMenuItem());
// Earl Grey cannot preperly synchronize some animations, so adding a
// WaitUntilCondition to wait for the new tab opening animation to finish
« no previous file with comments | « no previous file | ios/chrome/browser/metrics/tab_usage_recorder_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698