Skip to content

Commit

Permalink
Adding a new tab for the newly created browser.
Browse files Browse the repository at this point in the history
  • Loading branch information
boocmp committed Sep 13, 2023
1 parent b4324c1 commit 9ca8efa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ IN_PROC_BROWSER_TEST_F(SearchEngineProviderServiceTest,
Profile* tor_profile = tor_browser->profile();
EXPECT_TRUE(tor_profile->IsTor());

// Wait for the search provider to initialize.
base::RunLoop().RunUntilIdle();

const int default_provider_id =
TemplateURLPrepopulateData::PREPOPULATED_ENGINE_ID_BRAVE_TOR;
auto* tor_service = TemplateURLServiceFactory::GetForProfile(tor_profile);
Expand Down
3 changes: 3 additions & 0 deletions browser/tor/tor_profile_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "brave/components/tor/tor_profile_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
Expand Down Expand Up @@ -55,6 +56,8 @@ Browser* TorProfileManager::SwitchToTorProfile(Profile* original_profile) {
if (!browser && Browser::GetCreationStatusForProfile(tor_profile) ==
Browser::CreationStatus::kOk) {
browser = Browser::Create(Browser::CreateParams(tor_profile, true));
chrome::NewTab(browser);
browser->window()->Show();
}
if (browser) {
browser->window()->Activate();
Expand Down

0 comments on commit 9ca8efa

Please sign in to comment.