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

Side by Side Diff: ios/chrome/browser/ui/settings/accounts_collection_egtest.mm

Issue 2642193012: Make EarlGrey matchers compliant with Chromium style. (Closed)
Patch Set: build.gn and rebase 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 unified diff | Download patch
OLDNEW
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 #include "components/signin/core/browser/signin_manager.h" 9 #include "components/signin/core/browser/signin_manager.h"
10 #include "components/strings/grit/components_strings.h" 10 #include "components/strings/grit/components_strings.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // collection view might duplicate it (with the old one being hidden but 44 // collection view might duplicate it (with the old one being hidden but
45 // EarlGrey can find it). 45 // EarlGrey can find it).
46 id<GREYMatcher> matcher = grey_allOf(grey_accessibilityID(accessiblity_id), 46 id<GREYMatcher> matcher = grey_allOf(grey_accessibilityID(accessiblity_id),
47 grey_sufficientlyVisible(), nil); 47 grey_sufficientlyVisible(), nil);
48 [[EarlGrey selectElementWithMatcher:matcher] performAction:grey_tap()]; 48 [[EarlGrey selectElementWithMatcher:matcher] performAction:grey_tap()];
49 } 49 }
50 50
51 // Taps the button with accessibility label |label|. 51 // Taps the button with accessibility label |label|.
52 void TapButtonWithAccessibilityLabel(NSString* label) { 52 void TapButtonWithAccessibilityLabel(NSString* label) {
53 id<GREYMatcher> matcher = 53 id<GREYMatcher> matcher =
54 chrome_test_util::buttonWithAccessibilityLabel(label); 54 chrome_test_util::ButtonWithAccessibilityLabel(label);
55 [[EarlGrey selectElementWithMatcher:matcher] performAction:grey_tap()]; 55 [[EarlGrey selectElementWithMatcher:matcher] performAction:grey_tap()];
56 } 56 }
57 57
58 // Taps the button with accessibility labelId |message_id|. 58 // Taps the button with accessibility labelId |message_id|.
59 void TapButtonWithLabelId(int message_id) { 59 void TapButtonWithLabelId(int message_id) {
60 id<GREYMatcher> matcher = 60 id<GREYMatcher> matcher =
61 chrome_test_util::buttonWithAccessibilityLabelId(message_id); 61 chrome_test_util::ButtonWithAccessibilityLabelId(message_id);
62 [[EarlGrey selectElementWithMatcher:matcher] performAction:grey_tap()]; 62 [[EarlGrey selectElementWithMatcher:matcher] performAction:grey_tap()];
63 } 63 }
64 64
65 // Opens the signin screen from the settings page. Assumes the tools menu is 65 // Opens the signin screen from the settings page. Assumes the tools menu is
66 // accessible. User must not be signed in. 66 // accessible. User must not be signed in.
67 void OpenSignInFromSettings() { 67 void OpenSignInFromSettings() {
68 const CGFloat scroll_displacement = 50.0; 68 const CGFloat scroll_displacement = 50.0;
69 69
70 [ChromeEarlGreyUI openToolsMenu]; 70 [ChromeEarlGreyUI openToolsMenu];
71 [[[EarlGrey 71 [[[EarlGrey
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 // Check that Account Settings screen is open and |identity| is signed in. 305 // Check that Account Settings screen is open and |identity| is signed in.
306 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(kSettingsAccountsId)] 306 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(kSettingsAccountsId)]
307 assertWithMatcher:grey_sufficientlyVisible()]; 307 assertWithMatcher:grey_sufficientlyVisible()];
308 AssertAuthenticatedIdentityInActiveProfile(identity); 308 AssertAuthenticatedIdentityInActiveProfile(identity);
309 309
310 // Close Settings. 310 // Close Settings.
311 TapButtonWithLabelId(IDS_IOS_NAVIGATION_BAR_DONE_BUTTON); 311 TapButtonWithLabelId(IDS_IOS_NAVIGATION_BAR_DONE_BUTTON);
312 } 312 }
313 313
314 @end 314 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/reading_list/reading_list_egtest.mm ('k') | ios/chrome/browser/ui/settings/autofill_settings_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698