Commit 6cdec207 authored by edchin's avatar edchin Committed by Commit Bot

[ios] Add bookmark context menu constant

This CL simply replaces about a dozen uses of @"bookmark_context_menu"
with a constant accessibility identifier in
bookmark_ui_constants.h.

Change-Id: Ibbfb86930cb09035ff271f83e5971dbc35f1c717
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2146288Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759279}
parent ae857b2f
......@@ -229,8 +229,8 @@ id<GREYMatcher> SearchIconButton() {
- (void)verifyContextMenuForSingleURL {
// Verify it shows the context menu.
[[EarlGrey
selectElementWithMatcher:grey_accessibilityID(@"bookmark_context_menu")]
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(
kBookmarkHomeContextMenuIdentifier)]
assertWithMatcher:grey_sufficientlyVisible()];
// Verify options on context menu.
......
......@@ -1595,7 +1595,7 @@ std::vector<GURL> GetUrlsToOpen(const std::vector<const BookmarkNode*>& nodes) {
forMultipleBookmarkURLs:(const std::set<const BookmarkNode*>)nodes {
__weak BookmarkHomeViewController* weakSelf = self;
coordinator.alertController.view.accessibilityIdentifier =
@"bookmark_context_menu";
kBookmarkHomeContextMenuIdentifier;
[coordinator
addItemWithTitle:l10n_util::GetNSString(
......@@ -1634,7 +1634,7 @@ std::vector<GURL> GetUrlsToOpen(const std::vector<const BookmarkNode*>& nodes) {
__weak BookmarkHomeViewController* weakSelf = self;
std::string urlString = node->url().possibly_invalid_spec();
coordinator.alertController.view.accessibilityIdentifier =
@"bookmark_context_menu";
kBookmarkHomeContextMenuIdentifier;
[coordinator addItemWithTitle:l10n_util::GetNSString(
IDS_IOS_BOOKMARK_CONTEXT_MENU_EDIT)
......@@ -1679,7 +1679,7 @@ std::vector<GURL> GetUrlsToOpen(const std::vector<const BookmarkNode*>& nodes) {
forSingleBookmarkFolder:(const BookmarkNode*)node {
__weak BookmarkHomeViewController* weakSelf = self;
coordinator.alertController.view.accessibilityIdentifier =
@"bookmark_context_menu";
kBookmarkHomeContextMenuIdentifier;
[coordinator addItemWithTitle:l10n_util::GetNSString(
IDS_IOS_BOOKMARK_CONTEXT_MENU_EDIT_FOLDER)
......@@ -1707,7 +1707,7 @@ std::vector<GURL> GetUrlsToOpen(const std::vector<const BookmarkNode*>& nodes) {
(const std::set<const bookmarks::BookmarkNode*>)nodes {
__weak BookmarkHomeViewController* weakSelf = self;
coordinator.alertController.view.accessibilityIdentifier =
@"bookmark_context_menu";
kBookmarkHomeContextMenuIdentifier;
[coordinator addItemWithTitle:l10n_util::GetNSString(
IDS_IOS_BOOKMARK_CONTEXT_MENU_MOVE)
......
......@@ -21,6 +21,8 @@ extern NSString* const kBookmarkFolderCreateViewContainerIdentifier;
extern NSString* const kBookmarkFolderPickerViewContainerIdentifier;
// Accessibility identifier of the Bookmark Home TableView.
extern NSString* const kBookmarkHomeTableViewIdentifier;
// Accessibility identifier of the Bookmark Home context menu.
extern NSString* const kBookmarkHomeContextMenuIdentifier;
// UINavigationBar accessibility constants:
// Accessibility identifier of the Bookmark navigation bar.
......
......@@ -21,6 +21,8 @@ NSString* const kBookmarkFolderPickerViewContainerIdentifier =
NSString* const kBookmarkHomeTableViewIdentifier =
@"kBookmarkHomeTableViewIdentifier";
NSString* const kBookmarkHomeContextMenuIdentifier =
@"kBookmarkHomeContextMenuIdentifier";
NSString* const kBookmarkNavigationBarIdentifier =
@"kBookmarkNavigationBarIdentifier";
......
......@@ -434,8 +434,8 @@ using chrome_test_util::TappableBookmarkNodeWithLabel;
performAction:grey_tap()];
// Verify it shows the context menu.
[[EarlGrey
selectElementWithMatcher:grey_accessibilityID(@"bookmark_context_menu")]
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(
kBookmarkHomeContextMenuIdentifier)]
assertWithMatcher:grey_sufficientlyVisible()];
// Verify options on context menu.
......@@ -695,8 +695,8 @@ using chrome_test_util::TappableBookmarkNodeWithLabel;
performAction:grey_tap()];
// Verify it shows the context menu.
[[EarlGrey
selectElementWithMatcher:grey_accessibilityID(@"bookmark_context_menu")]
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(
kBookmarkHomeContextMenuIdentifier)]
assertWithMatcher:grey_sufficientlyVisible()];
// Verify options on context menu.
......
......@@ -371,8 +371,8 @@ using chrome_test_util::TappableBookmarkNodeWithLabel;
performAction:grey_longPress()];
// Verify it shows the context menu.
[[EarlGrey
selectElementWithMatcher:grey_accessibilityID(@"bookmark_context_menu")]
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(
kBookmarkHomeContextMenuIdentifier)]
assertWithMatcher:grey_sufficientlyVisible()];
// Verify options on context menu.
......@@ -408,8 +408,8 @@ using chrome_test_util::TappableBookmarkNodeWithLabel;
// Verify it doesn't show the context menu. (long press is disabled on
// permanent node.)
[[EarlGrey
selectElementWithMatcher:grey_accessibilityID(@"bookmark_context_menu")]
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(
kBookmarkHomeContextMenuIdentifier)]
assertWithMatcher:grey_nil()];
}
......@@ -803,8 +803,8 @@ using chrome_test_util::TappableBookmarkNodeWithLabel;
performAction:grey_tap()];
// Verify it shows the context menu.
[[EarlGrey
selectElementWithMatcher:grey_accessibilityID(@"bookmark_context_menu")]
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(
kBookmarkHomeContextMenuIdentifier)]
assertWithMatcher:grey_sufficientlyVisible()];
// Verify options on context menu.
......
......@@ -78,8 +78,8 @@ void LongPressBookmarkNodeWithLabel(NSString* bookmark_node_label) {
}
void VerifyBookmarkContextMenuNil() {
[[EarlGrey
selectElementWithMatcher:grey_accessibilityID(@"bookmark_context_menu")]
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(
kBookmarkHomeContextMenuIdentifier)]
assertWithMatcher:grey_nil()];
}
......
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