| Index: ios/chrome/browser/ui/first_run/first_run_egtest.mm
|
| diff --git a/ios/chrome/browser/ui/first_run/first_run_egtest.mm b/ios/chrome/browser/ui/first_run/first_run_egtest.mm
|
| index 5476786fb4f243401e53bfd9bdc1040b95b4f84c..142b4239838f0f6a268b86befcf91b3ee930d7a9 100644
|
| --- a/ios/chrome/browser/ui/first_run/first_run_egtest.mm
|
| +++ b/ios/chrome/browser/ui/first_run/first_run_egtest.mm
|
| @@ -6,6 +6,7 @@
|
| #import <XCTest/XCTest.h>
|
|
|
| #include "base/strings/sys_string_conversions.h"
|
| +#import "base/test/ios/wait_util.h"
|
| #include "components/metrics/metrics_pref_names.h"
|
| #include "components/metrics/metrics_reporting_default_state.h"
|
| #include "components/prefs/pref_member.h"
|
| @@ -28,6 +29,7 @@
|
| #import "ios/chrome/test/earl_grey/chrome_test_case.h"
|
| #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
|
| #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h"
|
| +#import "ios/testing/wait_util.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
|
|
| #if !defined(__has_feature) || !__has_feature(objc_arc)
|
| @@ -86,6 +88,19 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) {
|
| @"\"%@\", actual = \"%s\"]",
|
| identity.gaiaID, info.gaia.c_str());
|
| }
|
| +
|
| +// Wait until |matcher| is accessible (not nil)
|
| +void WaitForMatcher(id<GREYMatcher> matcher) {
|
| + ConditionBlock condition = ^{
|
| + NSError* error = nil;
|
| + [[EarlGrey selectElementWithMatcher:matcher] assertWithMatcher:grey_notNil()
|
| + error:&error];
|
| + return error == nil;
|
| + };
|
| + GREYAssert(testing::WaitUntilConditionOrTimeout(
|
| + testing::kWaitForUIElementTimeout, condition),
|
| + @"Waiting for matcher %@ failed.", matcher);
|
| +}
|
| }
|
|
|
| @interface MainController (ExposedForTesting)
|
| @@ -216,8 +231,7 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) {
|
| }
|
|
|
| // Signs in to an account and then taps the Advanced link to go to settings.
|
| -// TODO(crbug.com/718023): Re-enable test.
|
| -- (void)DISABLED_testSignInAndTapSettingsLink {
|
| +- (void)testSignInAndTapSettingsLink {
|
| ChromeIdentity* identity = GetFakeIdentity();
|
| ios::FakeChromeIdentityService::GetInstanceFromChromeProvider()->AddIdentity(
|
| identity);
|
| @@ -235,6 +249,7 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) {
|
| // Tap Settings link.
|
| id<GREYMatcher> settings_link_matcher = grey_allOf(
|
| grey_accessibilityLabel(@"Settings"), grey_sufficientlyVisible(), nil);
|
| + WaitForMatcher(settings_link_matcher);
|
| [[EarlGrey selectElementWithMatcher:settings_link_matcher]
|
| performAction:grey_tap()];
|
|
|
|
|