Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 4335: Disable SafeBrowsing in Tor (uplift to 0.64.x) #2404

Merged
merged 1 commit into from
May 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions browser/profiles/brave_profile_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "chrome/grit/generated_resources.h"
#include "components/bookmarks/common/bookmark_pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/safe_browsing/common/safe_browsing_prefs.h"
#include "components/signin/core/browser/signin_pref_names.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/url_data_source.h"
Expand Down Expand Up @@ -59,6 +60,7 @@ void BraveProfileManager::InitTorProfileUserPrefs(Profile* profile) {
pref_service->SetBoolean(tor::prefs::kProfileUsingTor, true);
pref_service->SetString(prefs::kWebRTCIPHandlingPolicy,
content::kWebRTCIPHandlingDisableNonProxiedUdp);
pref_service->SetBoolean(prefs::kSafeBrowsingEnabled, false);
}

void BraveProfileManager::InitProfileUserPrefs(Profile* profile) {
Expand Down
10 changes: 8 additions & 2 deletions browser/profiles/brave_profile_manager_unittest.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
/* Copyright (c) 2019 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "brave/browser/profiles/brave_profile_manager.h"

#include <string>
#include <memory>

#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
Expand All @@ -23,6 +25,7 @@
#include "chrome/test/base/test_browser_window.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "components/safe_browsing/common/safe_browsing_prefs.h"
#include "content/public/common/webrtc_ip_handling_policy.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_utils.h"
Expand Down Expand Up @@ -57,7 +60,6 @@ class BraveProfileManagerTest : public testing::Test {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
TestingBrowserProcess::GetGlobal()->SetProfileManager(
new TorUnittestProfileManager(temp_dir_.GetPath()));

}

void TearDown() override {
Expand Down Expand Up @@ -140,6 +142,9 @@ TEST_F(BraveProfileManagerTest, InitProfileUserPrefs) {
EXPECT_EQ(
profile->GetPrefs()->GetString(prefs::kWebRTCIPHandlingPolicy),
content::kWebRTCIPHandlingDisableNonProxiedUdp);

// Check SafeBrowsing status
EXPECT_FALSE(profile->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled));
}

// This is for tor guest window, remove it when we have persistent tor profiles
Expand Down Expand Up @@ -187,3 +192,4 @@ TEST_F(BraveProfileManagerTest, CreateProfilesAsync) {

content::RunAllTasksUntilIdle();
}