Skip to content

Commit

Permalink
Merge pull request #10401 from brave/bsc-fix-browser-test
Browse files Browse the repository at this point in the history
Fix failing browser test `BraveSearchTestEnabled.DefaultAPIVisibleKnownHost`
  • Loading branch information
bsclifton authored Oct 7, 2021
2 parents f4144ba + 79fdaac commit 6d4b15d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions browser/brave_search/brave_search_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ class BraveSearchTest : public InProcessBrowserTest {
ASSERT_TRUE(https_server_->Start());
GURL url = https_server()->GetURL("a.com", "/search");
brave_search::BraveSearchFallbackHost::SetBackupProviderForTest(url);

// Force default search engine to Google
// Some tests will fail if Brave is default
auto* template_url_service =
TemplateURLServiceFactory::GetForProfile(browser()->profile());
TemplateURL* google = template_url_service->GetTemplateURLForKeyword(u":g");
template_url_service->SetUserSelectedDefaultSearchProvider(google);
}

void SetUpCommandLine(base::CommandLine* command_line) override {
Expand Down

0 comments on commit 6d4b15d

Please sign in to comment.