| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] | 355 [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] |
| 356 performAction:grey_tap()]; | 356 performAction:grey_tap()]; |
| 357 | 357 |
| 358 // Check that there is no signed in user. | 358 // Check that there is no signed in user. |
| 359 AssertAuthenticatedIdentityInActiveProfile(nil); | 359 AssertAuthenticatedIdentityInActiveProfile(nil); |
| 360 } | 360 } |
| 361 | 361 |
| 362 // Tests that signing in, tapping the Settings link on the confirmation screen | 362 // Tests that signing in, tapping the Settings link on the confirmation screen |
| 363 // and closing the Settings correctly leaves the user signed in without any | 363 // and closing the Settings correctly leaves the user signed in without any |
| 364 // Settings shown. | 364 // Settings shown. |
| 365 // TODO(crbug.com/718023): Re-enable test. | 365 - (void)testSignInOpenSettings { |
| 366 - (void)DISABLED_testSignInOpenSettings { | |
| 367 ChromeIdentity* identity = GetFakeIdentity1(); | 366 ChromeIdentity* identity = GetFakeIdentity1(); |
| 368 ios::FakeChromeIdentityService::GetInstanceFromChromeProvider()->AddIdentity( | 367 ios::FakeChromeIdentityService::GetInstanceFromChromeProvider()->AddIdentity( |
| 369 identity); | 368 identity); |
| 370 | 369 |
| 371 // Sign in to |identity|. | 370 // Sign in to |identity|. |
| 372 OpenSignInFromSettings(); | 371 OpenSignInFromSettings(); |
| 373 TapButtonWithAccessibilityLabel(identity.userEmail); | 372 TapButtonWithAccessibilityLabel(identity.userEmail); |
| 374 TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SIGNIN_BUTTON); | 373 TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SIGNIN_BUTTON); |
| 375 | 374 |
| 376 // Tap Settings link. | 375 // Tap Settings link. |
| 377 id<GREYMatcher> settings_link_matcher = grey_allOf( | 376 id<GREYMatcher> settings_link_matcher = grey_allOf( |
| 378 grey_accessibilityLabel(@"Settings"), grey_sufficientlyVisible(), nil); | 377 grey_accessibilityLabel(@"Settings"), grey_sufficientlyVisible(), nil); |
| 378 WaitForMatcher(settings_link_matcher); |
| 379 [[EarlGrey selectElementWithMatcher:settings_link_matcher] | 379 [[EarlGrey selectElementWithMatcher:settings_link_matcher] |
| 380 performAction:grey_tap()]; | 380 performAction:grey_tap()]; |
| 381 | 381 |
| 382 [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] | 382 id<GREYMatcher> done_button_matcher = NavigationBarDoneButton(); |
| 383 WaitForMatcher(done_button_matcher); |
| 384 [[EarlGrey selectElementWithMatcher:done_button_matcher] |
| 383 performAction:grey_tap()]; | 385 performAction:grey_tap()]; |
| 384 | 386 |
| 385 // All Settings should be gone and user signed in. | 387 // All Settings should be gone and user signed in. |
| 386 id<GREYMatcher> settings_matcher = | 388 id<GREYMatcher> settings_matcher = |
| 387 chrome_test_util::StaticTextWithAccessibilityLabelId( | 389 chrome_test_util::StaticTextWithAccessibilityLabelId( |
| 388 IDS_IOS_SETTINGS_TITLE); | 390 IDS_IOS_SETTINGS_TITLE); |
| 389 [[EarlGrey selectElementWithMatcher:settings_matcher] | 391 [[EarlGrey selectElementWithMatcher:settings_matcher] |
| 390 assertWithMatcher:grey_notVisible()]; | 392 assertWithMatcher:grey_notVisible()]; |
| 391 AssertAuthenticatedIdentityInActiveProfile(identity); | 393 AssertAuthenticatedIdentityInActiveProfile(identity); |
| 392 } | 394 } |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 | 591 |
| 590 // Close sign-in screen and Bookmarks. | 592 // Close sign-in screen and Bookmarks. |
| 591 TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SKIP_BUTTON); | 593 TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SKIP_BUTTON); |
| 592 if (!IsIPadIdiom()) { | 594 if (!IsIPadIdiom()) { |
| 593 [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] | 595 [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] |
| 594 performAction:grey_tap()]; | 596 performAction:grey_tap()]; |
| 595 } | 597 } |
| 596 } | 598 } |
| 597 | 599 |
| 598 @end | 600 @end |
| OLD | NEW |