Skip to content

Commit

Permalink
Improve SearchEngineTracker browsertest documentation.
Browse files Browse the repository at this point in the history
- Document the motivation for setting the region.
- Fix a comment typo.
  • Loading branch information
rillian committed Oct 20, 2021
1 parent bd05904 commit 36ca7d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion browser/search_engines/search_engine_tracker_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class SearchEngineProviderP3ATest : public InProcessBrowserTest {
SearchEngineProviderP3ATest() {
histogram_tester_.reset(new base::HistogramTester);

// Override the default region. Defaults vary and this
// ties the expected test results to a specific region
// so everyone sees the same behaviour.
//
// May also help with unstable test results in ci.
create_services_subscription_ =
BrowserContextDependencyManager::GetInstance()
->RegisterCreateServicesCallbackForTesting(
Expand Down Expand Up @@ -74,7 +79,7 @@ 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 through
// For some reason we record kNoSwitch twice, even though
// kDefaultSearchEngineMetric is only updated once at this point.
histogram_tester_->ExpectUniqueSample(kSwitchSearchEngineMetric,
SearchEngineSwitchP3A::kNoSwitch, 2);
Expand Down

0 comments on commit 36ca7d6

Please sign in to comment.