Commit 622a23bf authored by Matt Mueller's avatar Matt Mueller Committed by Commit Bot

Fix flake in TrialComparisonCertVerifierFeatureEnabledTest.

The test was checking the CertVerifier_Job_Latency_TrialSecondary and
CertVerifier_TrialComparisonResult histogram values, but those histograms are
recorded by a background task that is independent of page loading, so they
may not be finished by the time the ui_test_utils::NavigateToURL call
completes.

Checking the CertVerifier_Job_Latency_TrialPrimary histogram is sufficient to
tell whether the trial was enabled or not, and that histogram is recorded
synchronously when the main verification completes, so should always be present
when NavigateToURL returns.

Bug: 981325
Change-Id: I1c7ab99d79e5ba58d4bc561d88b00024e22f3cd8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1689399Reviewed-by: default avatarEric Roman <eroman@chromium.org>
Commit-Queue: Matt Mueller <mattm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#675820}
parent 4cfd15ba
......@@ -35,8 +35,6 @@ IN_PROC_BROWSER_TEST_F(TrialComparisonCertVerifierTest, TrialDisabled) {
SubprocessMetricsProvider::MergeHistogramDeltasForTesting();
histograms.ExpectTotalCount("Net.CertVerifier_Job_Latency", 1);
histograms.ExpectTotalCount("Net.CertVerifier_Job_Latency_TrialPrimary", 0);
histograms.ExpectTotalCount("Net.CertVerifier_Job_Latency_TrialSecondary", 0);
histograms.ExpectTotalCount("Net.CertVerifier_TrialComparisonResult", 0);
}
class TrialComparisonCertVerifierFeatureEnabledTest
......@@ -69,18 +67,10 @@ IN_PROC_BROWSER_TEST_F(TrialComparisonCertVerifierFeatureEnabledTest,
SubprocessMetricsProvider::MergeHistogramDeltasForTesting();
histograms.ExpectTotalCount("Net.CertVerifier_Job_Latency", 1);
histograms.ExpectTotalCount("Net.CertVerifier_Job_Latency_TrialPrimary", 0);
histograms.ExpectTotalCount("Net.CertVerifier_Job_Latency_TrialSecondary", 0);
histograms.ExpectTotalCount("Net.CertVerifier_TrialComparisonResult", 0);
}
// Flaky on Mac. See https://crbug.com/981325.
#if defined(OS_MACOSX)
#define MAYBE_TrialEnabledPrefEnabled DISABLED_TrialEnabledPrefEnabled
#else
#define MAYBE_TrialEnabledPrefEnabled TrialEnabledPrefEnabled
#endif
IN_PROC_BROWSER_TEST_F(TrialComparisonCertVerifierFeatureEnabledTest,
MAYBE_TrialEnabledPrefEnabled) {
TrialEnabledPrefEnabled) {
safe_browsing::SetExtendedReportingPref(browser()->profile()->GetPrefs(),
true);
......@@ -96,16 +86,10 @@ IN_PROC_BROWSER_TEST_F(TrialComparisonCertVerifierFeatureEnabledTest,
// If both the dual cert verifier trial feature and the builtin verifier
// feature are enabled, the dual cert verifier trial should not be used.
histograms.ExpectTotalCount("Net.CertVerifier_Job_Latency_TrialPrimary", 0);
histograms.ExpectTotalCount("Net.CertVerifier_Job_Latency_TrialSecondary",
0);
histograms.ExpectTotalCount("Net.CertVerifier_TrialComparisonResult", 0);
return;
}
#endif
histograms.ExpectTotalCount("Net.CertVerifier_Job_Latency_TrialPrimary", 1);
histograms.ExpectTotalCount("Net.CertVerifier_Job_Latency_TrialSecondary", 1);
histograms.ExpectUniqueSample("Net.CertVerifier_TrialComparisonResult",
net::TrialComparisonCertVerifier::kEqual, 1);
}
#if BUILDFLAG(BUILTIN_CERT_VERIFIER_FEATURE_SUPPORTED)
......@@ -148,7 +132,5 @@ IN_PROC_BROWSER_TEST_F(
// If both the dual cert verifier trial feature and the builtin verifier
// feature are enabled, the dual cert verifier trial should not be used.
histograms.ExpectTotalCount("Net.CertVerifier_Job_Latency_TrialPrimary", 0);
histograms.ExpectTotalCount("Net.CertVerifier_Job_Latency_TrialSecondary", 0);
histograms.ExpectTotalCount("Net.CertVerifier_TrialComparisonResult", 0);
}
#endif
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