Commit adf39075 authored by Caitlin Fischer's avatar Caitlin Fischer Committed by Commit Bot

Fix a flaky UkmBrowserTestWithDemographics test and re-enable it.

The test case is AddSyncedUserBirthYearAndGenderToProtoData, and it's
being re-enabled on Android.

Bug: 1102746
Change-Id: Ie02597dc1704ba0d5efb13eb297f7e87ef0865d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2329920
Commit-Queue: Caitlin Fischer <caitlinfischer@google.com>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797707}
parent 01efb7a7
...@@ -616,20 +616,12 @@ IN_PROC_BROWSER_TEST_F(UkmBrowserTest, LogProtoData) { ...@@ -616,20 +616,12 @@ IN_PROC_BROWSER_TEST_F(UkmBrowserTest, LogProtoData) {
} }
#endif // !defined(OS_ANDROID) #endif // !defined(OS_ANDROID)
// https://crbug.com/1102747
#if defined(OS_ANDROID)
#define MAYBE_AddSyncedUserBirthYearAndGenderToProtoData \
DISABLED_AddSyncedUserBirthYearAndGenderToProtoData
#else
#define MAYBE_AddSyncedUserBirthYearAndGenderToProtoData \
AddSyncedUserBirthYearAndGenderToProtoData
#endif
// TODO(crbug/1016118): Add the remaining test cases. // TODO(crbug/1016118): Add the remaining test cases.
// Keep this test in sync with testUKMDemographicsReportingWithFeatureEnabled // Keep this test in sync with testUKMDemographicsReportingWithFeatureEnabled
// and testUKMDemographicsReportingWithFeatureDisabled in // and testUKMDemographicsReportingWithFeatureDisabled in
// ios/chrome/browser/metrics/demographics_egtest.mm. // ios/chrome/browser/metrics/demographics_egtest.mm.
IN_PROC_BROWSER_TEST_P(UkmBrowserTestWithDemographics, IN_PROC_BROWSER_TEST_P(UkmBrowserTestWithDemographics,
MAYBE_AddSyncedUserBirthYearAndGenderToProtoData) { AddSyncedUserBirthYearAndGenderToProtoData) {
ukm::UkmTestHelper ukm_test_helper(GetUkmService()); ukm::UkmTestHelper ukm_test_helper(GetUkmService());
test::DemographicsTestParams param = GetParam(); test::DemographicsTestParams param = GetParam();
MetricsConsentOverride metrics_consent(true); MetricsConsentOverride metrics_consent(true);
...@@ -679,7 +671,12 @@ IN_PROC_BROWSER_TEST_P(UkmBrowserTestWithDemographics, ...@@ -679,7 +671,12 @@ IN_PROC_BROWSER_TEST_P(UkmBrowserTestWithDemographics,
histogram.ExpectTotalCount("UKM.UserDemographics.Status", /*count=*/0); histogram.ExpectTotalCount("UKM.UserDemographics.Status", /*count=*/0);
} }
harness->service()->GetUserSettings()->SetSyncRequested(false); #if !defined(OS_CHROMEOS)
// Sign out the user to revoke all refresh tokens. This prevents any posted
// tasks from successfully fetching an access token during the tear-down
// phase and crashing on a DCHECK. See crbug/1102746 for more details.
harness->SignOutPrimaryAccount();
#endif // !defined(OS_CHROMEOS)
ClosePlatformBrowser(browser); ClosePlatformBrowser(browser);
} }
......
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