Commit 0142b7fd authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Fixes testOpenAndCloseToolsMenu when the UIRefresh flag is enabled

BUG=825431
TEST=None

Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I044a4fd10f669facccb7bc571b0e39548ac81a0b
Reviewed-on: https://chromium-review.googlesource.com/1008666
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549999}
parent 5fb3a625
...@@ -37,11 +37,20 @@ id<GREYMatcher> FindInPageButton() { ...@@ -37,11 +37,20 @@ id<GREYMatcher> FindInPageButton() {
@implementation ToolsPopupMenuTestCase @implementation ToolsPopupMenuTestCase
// Tests that the menu is closed when tapping the close button. // Tests that the menu is closed when tapping the close button or the scrim.
- (void)testOpenAndCloseToolsMenu { - (void)testOpenAndCloseToolsMenu {
[ChromeEarlGreyUI openToolsMenu]; [ChromeEarlGreyUI openToolsMenu];
if (!IsCompactWidth()) { // When the UIRefresh flag is enabled, a scrim covers the whole window and
// tapping on this scrim dismisses the tools menu. The "Tools Menu" button
// happens to be outside of the bounds of the menu and is a convenient place
// to tap to activate the scrim.
//
// When the UIRefresh flag is disabled, a scrim is present on phone with the
// |IDS_IOS_TOOLBAR_CLOSE_MENU| accessibility label. On tablet, the tools
// menu button is an item in the tools menu and can be pressed again to close
// the menu.
if (!IsCompactWidth() && !IsUIRefreshPhase1Enabled()) {
[[EarlGrey [[EarlGrey
selectElementWithMatcher:grey_accessibilityLabel(l10n_util::GetNSString( selectElementWithMatcher:grey_accessibilityLabel(l10n_util::GetNSString(
IDS_IOS_TOOLBAR_CLOSE_MENU))] IDS_IOS_TOOLBAR_CLOSE_MENU))]
......
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