Commit 7d5a4afe authored by Varun Khaneja's avatar Varun Khaneja Committed by Commit Bot

Disable full URL lookups in OffTheRecord mode.

Bug: 963165
Change-Id: I13046027db2f8f8a8d9a4d2aaa0677401f67caf2
Fixed: 1028567
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1939958
Commit-Queue: Varun Khaneja <vakh@chromium.org>
Commit-Queue: Bettina Dea <bdea@chromium.org>
Auto-Submit: Varun Khaneja <vakh@chromium.org>
Reviewed-by: default avatarBettina Dea <bdea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719683}
parent a5a878e4
......@@ -62,6 +62,9 @@ bool RealTimePolicyEngine::IsEnabledByPolicy(
// static
bool RealTimePolicyEngine::CanPerformFullURLLookup(
content::BrowserContext* browser_context) {
if (browser_context->IsOffTheRecord())
return false;
if (IsEnabledByPolicy(browser_context))
return true;
......
......@@ -104,6 +104,15 @@ TEST_F(RealTimePolicyEngineTest,
EXPECT_FALSE(CanPerformFullURLLookup());
}
TEST_F(RealTimePolicyEngineTest,
TestCanPerformFullURLLookup_DisabledOffTheRecord) {
base::test::ScopedFeatureList feature_list;
pref_service_.SetManagedPref(prefs::kSafeBrowsingRealTimeLookupEnabled,
std::make_unique<base::Value>(true));
test_context_.set_is_off_the_record(true);
EXPECT_FALSE(CanPerformFullURLLookup());
}
TEST_F(RealTimePolicyEngineTest,
TestCanPerformFullURLLookup_DisabledUserOptin) {
ASSERT_FALSE(IsUserOptedIn());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment