Skip to content

Commit

Permalink
Merge pull request #10609 from brave/wdp-disabled-on-tor
Browse files Browse the repository at this point in the history
Disable Web Discovery Project in Tor windows
  • Loading branch information
remusao authored Oct 20, 2021
2 parents 47b0654 + 15a6cda commit 4c653ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions browser/tor/tor_profile_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,9 @@ void TorProfileManager::InitTorProfileUserPrefs(Profile* profile) {
BUILDFLAG(ENABLE_BRAVE_TRANSLATE_GO)
pref_service->SetBoolean(translate::prefs::kOfferTranslateEnabled, false);
#endif

// Disable Web Discovery Project in Tor
#if BUILDFLAG(ENABLE_EXTENSIONS)
pref_service->SetBoolean(kWebDiscoveryEnabled, false);
#endif
}
6 changes: 6 additions & 0 deletions browser/tor/tor_profile_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class TorProfileManagerUnitTest : public testing::Test {
};

TEST_F(TorProfileManagerUnitTest, InitTorProfileUserPrefs) {
profile()->GetPrefs()->SetBoolean(kWebDiscoveryEnabled, true);
Profile* tor_profile =
TorProfileManager::GetInstance().GetTorProfile(profile());
ASSERT_EQ(tor_profile->GetOriginalProfile(), profile());
Expand All @@ -82,4 +83,9 @@ TEST_F(TorProfileManagerUnitTest, InitTorProfileUserPrefs) {
EXPECT_FALSE(tor_profile->GetPrefs()->GetBoolean(
translate::prefs::kOfferTranslateEnabled));
#endif

#if BUILDFLAG(ENABLE_EXTENSIONS)
// Check WDP status.
EXPECT_FALSE(tor_profile->GetPrefs()->GetBoolean(kWebDiscoveryEnabled));
#endif
}

0 comments on commit 4c653ec

Please sign in to comment.