Commit 897fb666 authored by Moe Ahmadi's avatar Moe Ahmadi Committed by Commit Bot

[IOS][UKM] Fix and enable UKM EG tests on iOS

UKM EG tests were failing on iOS because the signed in account was staying
around after signing out causing EG selector to fail to tap on the
appropriate account in subsequent sign in attempts. This CL fixes that by
removing the signed in account when signing out.

Bug: 853992
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I77ec271bbb694766b6487be52ec4e3a18f7839d4
Reviewed-on: https://chromium-review.googlesource.com/1146986Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577511}
parent 66f9dbec
......@@ -38,6 +38,7 @@
#endif
using chrome_test_util::AccountsSyncButton;
using chrome_test_util::ButtonWithAccessibilityLabel;
using chrome_test_util::ButtonWithAccessibilityLabelId;
using chrome_test_util::ClearBrowsingDataCollectionView;
using chrome_test_util::GetIncognitoTabCount;
......@@ -194,13 +195,17 @@ void UpdateMetricsConsent(bool new_state) {
// Signs out of sync.
void SignOut() {
[ChromeEarlGreyUI openSettingsMenu];
[[EarlGrey selectElementWithMatcher:SettingsAccountButton()]
[ChromeEarlGreyUI tapSettingsMenuButton:SettingsAccountButton()];
// Remove |identity| from the device.
ChromeIdentity* identity = [SigninEarlGreyUtils fakeIdentity1];
[[EarlGrey
selectElementWithMatcher:ButtonWithAccessibilityLabel(identity.userEmail)]
performAction:grey_tap()];
[ChromeEarlGreyUI tapAccountsMenuButton:SignOutAccountsButton()];
[[EarlGrey selectElementWithMatcher:
ButtonWithAccessibilityLabelId(
IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE)]
[[EarlGrey
selectElementWithMatcher:ButtonWithAccessibilityLabel(@"Remove account")]
performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()];
......@@ -216,11 +221,6 @@ void SignOut() {
@implementation UKMTestCase
// Per crbug.com/853992, Entire test suite is failing regularly.
+ (NSArray*)testInvocations {
return @[];
}
+ (void)setUp {
[super setUp];
if (!base::FeatureList::IsEnabled(ukm::kUkmFeature)) {
......@@ -466,7 +466,8 @@ void SignOut() {
// testMetricsReporting not needed, since iOS doesn't use sampling.
- (void)testHistoryDelete {
// TODO(crbug.com/866598): Re-enable this test.
- (void)DISABLED_testHistoryDelete {
uint64_t original_client_id = metrics::UkmEGTestHelper::client_id();
const ukm::SourceId kDummySourceId = 0x54321;
......
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