From 843dff29a6db50cf83d1f009e2dab431f1d49b4f Mon Sep 17 00:00:00 2001 From: brave-builds <45370463+brave-builds@users.noreply.github.com> Date: Wed, 20 Sep 2023 12:22:46 +0900 Subject: [PATCH] Fix search switch p3a test (uplift to 1.58.x) (#20225) Uplift of #19683 (squashed) to release --- .../search_engines/search_engine_tracker_browsertest.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/browser/search_engines/search_engine_tracker_browsertest.cc b/browser/search_engines/search_engine_tracker_browsertest.cc index 1153ca78ae2d..d7cf69835846 100644 --- a/browser/search_engines/search_engine_tracker_browsertest.cc +++ b/browser/search_engines/search_engine_tracker_browsertest.cc @@ -91,10 +91,11 @@ IN_PROC_BROWSER_TEST_F(SearchEngineProviderP3ATest, DefaultSearchEngineP3A) { IN_PROC_BROWSER_TEST_F(SearchEngineProviderP3ATest, SwitchSearchEngineP3A) { // Check that the metric is reported on startup. - // For some reason we record kNoSwitch twice, even though + // For some reason we can record kNoSwitch twice, even though // kDefaultSearchEngineMetric is only updated once at this point. - histogram_tester_->ExpectUniqueSample(kSwitchSearchEngineMetric, - SearchEngineSwitchP3A::kNoSwitch, 2); + auto start_count = histogram_tester_->GetBucketCount( + kSwitchSearchEngineMetric, SearchEngineSwitchP3A::kNoSwitch); + EXPECT_GT(start_count, 0); // Load service for switching the default search engine. auto* service =