Commit 15f37519 authored by Mihai Sardarescu's avatar Mihai Sardarescu Committed by Chromium LUCI CQ

Remove enableUKM from setUpAccountAndSignInForTesting.

UrlKeyedAnonymizedDataCollectionEnabled is enabled by the sync consent
UI when the user opts in to sync. The tests rules should mirror this
behavior and only enable sync when the sync is enabled (and not when
sign-in is enabled). This CL removes enabling URL-keyed anonymized data
collection on sign-in.

Bug: None.

Change-Id: I7cf437874d97359d033e71d17122daf8d927c59b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2598903
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarAlice Wang <aliceywang@chromium.org>
Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840136}
parent 1b8b67fe
......@@ -205,6 +205,7 @@ public class SyncTestRule extends ChromeTabbedActivityTestRule {
public CoreAccountInfo setUpAccountAndEnableSyncForTesting() {
CoreAccountInfo accountInfo =
mAccountManagerTestRule.addTestAccountThenSigninAndEnableSync(mProfileSyncService);
// Enable UKM when enabling sync as it is done by the sync confirmation UI.
enableUKM();
SyncTestUtil.waitForSyncActive();
SyncTestUtil.triggerSyncAndWaitForCompletion();
......@@ -216,9 +217,7 @@ public class SyncTestRule extends ChromeTabbedActivityTestRule {
* @return the test accountInfo that is signed in.
*/
public CoreAccountInfo setUpAccountAndSignInForTesting() {
CoreAccountInfo accountInfo = mAccountManagerTestRule.addTestAccountThenSignin();
enableUKM();
return accountInfo;
return mAccountManagerTestRule.addTestAccountThenSignin();
}
/**
......@@ -228,6 +227,7 @@ public class SyncTestRule extends ChromeTabbedActivityTestRule {
public CoreAccountInfo setUpTestAccountAndSignInWithSyncSetupAsIncomplete() {
CoreAccountInfo accountInfo = mAccountManagerTestRule.addTestAccountThenSigninAndEnableSync(
/* profileSyncService= */ null);
// Enable UKM when enabling sync as it is done by the sync confirmation UI.
enableUKM();
SyncTestUtil.waitForSyncTransportActive();
return accountInfo;
......@@ -251,6 +251,7 @@ public class SyncTestRule extends ChromeTabbedActivityTestRule {
public void signinAndEnableSync(final CoreAccountInfo accountInfo) {
SigninTestUtil.signinAndEnableSync(accountInfo, mProfileSyncService);
// Enable UKM when enabling sync as it is done by the sync confirmation UI.
enableUKM();
SyncTestUtil.waitForSyncActive();
SyncTestUtil.triggerSyncAndWaitForCompletion();
......
......@@ -86,8 +86,8 @@ public class UkmTest {
() -> UmaSessionStats.updateMetricsAndCrashReportingForTesting(true));
Assert.assertFalse("UKM Enabled:", isUkmEnabled(normalTab));
// Finally, sign in and UKM is enabled.
CoreAccountInfo account = mSyncTestRule.setUpAccountAndSignInForTesting();
// Finally, sync and UKM is enabled.
CoreAccountInfo account = mSyncTestRule.setUpAccountAndEnableSyncForTesting();
Assert.assertTrue("UKM Enabled:", isUkmEnabled(normalTab));
}
......
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