| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import <EarlGrey/EarlGrey.h> | 5 #import <EarlGrey/EarlGrey.h> |
| 6 #import <XCTest/XCTest.h> | 6 #import <XCTest/XCTest.h> |
| 7 | 7 |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #import "base/test/ios/wait_util.h" | 9 #import "base/test/ios/wait_util.h" |
| 10 #include "components/signin/core/browser/signin_manager.h" | 10 #include "components/signin/core/browser/signin_manager.h" |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 onElementWithMatcher:grey_accessibilityID(kToolsMenuTableViewId)] | 540 onElementWithMatcher:grey_accessibilityID(kToolsMenuTableViewId)] |
| 541 performAction:grey_tap()]; | 541 performAction:grey_tap()]; |
| 542 | 542 |
| 543 if (!IsIPadIdiom()) { | 543 if (!IsIPadIdiom()) { |
| 544 // Opens the bookmark manager sidebar on handsets. | 544 // Opens the bookmark manager sidebar on handsets. |
| 545 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"Menu")] | 545 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"Menu")] |
| 546 performAction:grey_tap()]; | 546 performAction:grey_tap()]; |
| 547 } | 547 } |
| 548 | 548 |
| 549 // Selects the top level folder (Sign In promo is only shown there). | 549 // Selects the top level folder (Sign In promo is only shown there). |
| 550 NSString* topLevelFolderTitle = experimental_flags::IsAllBookmarksEnabled() | 550 NSString* topLevelFolderTitle = @"Mobile Bookmarks"; |
| 551 ? @"All Bookmarks" | |
| 552 : @"Mobile Bookmarks"; | |
| 553 id<GREYMatcher> all_bookmarks_matcher = | 551 id<GREYMatcher> all_bookmarks_matcher = |
| 554 grey_allOf(grey_kindOfClass(NSClassFromString(@"BookmarkMenuCell")), | 552 grey_allOf(grey_kindOfClass(NSClassFromString(@"BookmarkMenuCell")), |
| 555 grey_descendant(grey_text(topLevelFolderTitle)), nil); | 553 grey_descendant(grey_text(topLevelFolderTitle)), nil); |
| 556 [[EarlGrey selectElementWithMatcher:all_bookmarks_matcher] | 554 [[EarlGrey selectElementWithMatcher:all_bookmarks_matcher] |
| 557 performAction:grey_tap()]; | 555 performAction:grey_tap()]; |
| 558 | 556 |
| 559 TapButtonWithLabelId(IDS_IOS_BOOKMARK_PROMO_SIGN_IN_BUTTON); | 557 TapButtonWithLabelId(IDS_IOS_BOOKMARK_PROMO_SIGN_IN_BUTTON); |
| 560 | 558 |
| 561 // Assert sign-in screen was shown. | 559 // Assert sign-in screen was shown. |
| 562 id<GREYMatcher> signin_matcher = | 560 id<GREYMatcher> signin_matcher = |
| (...skipping 27 matching lines...) Expand all Loading... |
| 590 assertWithMatcher:grey_sufficientlyVisible()]; | 588 assertWithMatcher:grey_sufficientlyVisible()]; |
| 591 | 589 |
| 592 // Close sign-in screen and Bookmarks. | 590 // Close sign-in screen and Bookmarks. |
| 593 TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SKIP_BUTTON); | 591 TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SKIP_BUTTON); |
| 594 if (!IsIPadIdiom()) { | 592 if (!IsIPadIdiom()) { |
| 595 TapButtonWithLabelId(IDS_IOS_NAVIGATION_BAR_DONE_BUTTON); | 593 TapButtonWithLabelId(IDS_IOS_NAVIGATION_BAR_DONE_BUTTON); |
| 596 } | 594 } |
| 597 } | 595 } |
| 598 | 596 |
| 599 @end | 597 @end |
| OLD | NEW |