Skip to content

Commit

Permalink
Uplift of #2375 (squashed) to release
Browse files Browse the repository at this point in the history
  • Loading branch information
brave-browser-releases authored and jumde committed May 10, 2019
1 parent bd4a6fa commit 5977ee0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
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();
}

0 comments on commit 5977ee0

Please sign in to comment.