Commit cb060c31 authored by Steven Holte's avatar Steven Holte Committed by Commit Bot

Add UKM SecondaryPassphraseTest

Bug: 793082
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I2576f1ae6d40bb20fa641bfaf24089db4dd5e29e
Reviewed-on: https://chromium-review.googlesource.com/884941
Commit-Queue: Steven Holte <holte@chromium.org>
Reviewed-by: default avatarLouis Romero <lpromero@chromium.org>
Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533520}
parent f4a16fd9
...@@ -290,6 +290,7 @@ void SignOut() { ...@@ -290,6 +290,7 @@ void SignOut() {
// Disable sync. // Disable sync.
SignOut(); SignOut();
AssertSyncInitialized(false); AssertSyncInitialized(false);
chrome_test_util::ClearSyncServerData();
[super tearDown]; [super tearDown];
} }
...@@ -452,7 +453,51 @@ void SignOut() { ...@@ -452,7 +453,51 @@ void SignOut() {
// testMultiDisableSync not needed, since there can't be multiple profiles. // testMultiDisableSync not needed, since there can't be multiple profiles.
// TODO(crbug.com/793082): Implement testSecondaryPassphrase. // Make sure that UKM is disabled when a secondary passphrase is used.
- (void)testSecondaryPassphrase {
uint64_t original_client_id = metrics::UkmEGTestHelper::client_id();
[ChromeEarlGreyUI openSettingsMenu];
// Open accounts settings, then sync settings.
[[EarlGrey selectElementWithMatcher:SettingsAccountButton()]
performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:AccountsSyncButton()]
performAction:grey_tap()];
// Open sync encryption menu.
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"kSettingsSyncId")]
performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)];
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(
l10n_util::GetNSStringWithFixup(
IDS_IOS_SYNC_ENCRYPTION_TITLE))]
performAction:grey_tap()];
// Select passphrase encryption.
[[EarlGrey selectElementWithMatcher:ButtonWithAccessibilityLabelId(
IDS_SYNC_FULL_ENCRYPTION_DATA)]
performAction:grey_tap()];
// Type and confirm passphrase, then submit.
[[EarlGrey selectElementWithMatcher:grey_accessibilityValue(@"Passphrase")]
performAction:grey_typeText(@"mypassphrase")];
[[EarlGrey
selectElementWithMatcher:grey_accessibilityValue(@"Confirm passphrase")]
performAction:grey_typeText(@"mypassphrase")];
[[EarlGrey selectElementWithMatcher:ButtonWithAccessibilityLabelId(
IDS_IOS_SYNC_DECRYPT_BUTTON)]
performAction:grey_tap()];
AssertUKMEnabled(false);
// Client ID should have been reset.
GREYAssert(original_client_id != metrics::UkmEGTestHelper::client_id(),
@"Client ID was not reset.");
[[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
performAction:grey_tap()];
// Reset sync back to original state.
SignOut();
chrome_test_util::ClearSyncServerData();
SignInWithPromo();
AssertUKMEnabled(true);
}
// Make sure that UKM is disabled when sync is not enabled. // Make sure that UKM is disabled when sync is not enabled.
// TODO(crbug.com/806784): Re-enable this test on devices. // TODO(crbug.com/806784): Re-enable this test on devices.
......
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