Commit 9896b224 authored by Xinghui Lu's avatar Xinghui Lu Committed by Commit Bot

Remove fetch allowlist check on Android.

Protego's allowlist on Android is hardcoded in internal repository. It
doesn't need to be controlled by kRealTimeUrlLookupFetchAllowlist.

Bug: 1014202
Change-Id: I12875ce7e3426eb8a772be7393aa2a63e21fbe43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1888128
Commit-Queue: Xinghui Lu <xinghuilu@chromium.org>
Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711081}
parent c9cb24ff
......@@ -392,7 +392,6 @@ test("components_unittests") {
deps += [
"//components/safe_browsing:verdict_cache_manager_unittest",
"//components/safe_browsing/db:unit_tests_desktop",
"//components/safe_browsing/realtime:unit_tests",
]
} else if (safe_browsing_mode == 2) {
deps += [ "//components/safe_browsing/android:unit_tests_mobile" ]
......@@ -400,6 +399,7 @@ test("components_unittests") {
if (!is_ios) {
deps += [
"//components/safe_browsing/realtime:unit_tests",
"//components/webrtc_logging/browser:unit_tests",
"//components/webrtc_logging/common:unit_tests",
]
......
......@@ -6,6 +6,7 @@
#include "base/feature_list.h"
#include "base/metrics/histogram_macros.h"
#include "build/build_config.h"
#include "components/prefs/pref_service.h"
#include "components/safe_browsing/common/safe_browsing_prefs.h"
#include "components/safe_browsing/features.h"
......@@ -44,8 +45,11 @@ bool RealTimePolicyEngine::IsEnabledByPolicy(
// static
bool RealTimePolicyEngine::CanPerformFullURLLookup(
content::BrowserContext* browser_context) {
#if !defined(OS_ANDROID)
// TODO(crbug.com/963165): Remove this flag in M80.
if (!IsFetchAllowlistEnabled())
return false;
#endif
if (IsEnabledByPolicy(browser_context))
return true;
......
......@@ -5,6 +5,7 @@
#include "components/safe_browsing/realtime/policy_engine.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "components/safe_browsing/common/safe_browsing_prefs.h"
#include "components/safe_browsing/features.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
......@@ -42,8 +43,19 @@ class RealTimePolicyEngineTest : public PlatformTest {
TEST_F(RealTimePolicyEngineTest,
TestCanPerformFullURLLookup_DisabledFetchAllowlist) {
base::test::ScopedFeatureList feature_list;
#if !defined(OS_ANDROID)
feature_list.InitAndDisableFeature(kRealTimeUrlLookupFetchAllowlist);
EXPECT_FALSE(CanPerformFullURLLookup());
#else
// Should not be controlled by allowlist flag on Android.
feature_list.InitWithFeatures(
/* enabled_features */ {kRealTimeUrlLookupEnabled},
/* disabled_features */ {kRealTimeUrlLookupFetchAllowlist});
pref_service_.SetUserPref(
unified_consent::prefs::kUrlKeyedAnonymizedDataCollectionEnabled,
std::make_unique<base::Value>(true));
EXPECT_TRUE(CanPerformFullURLLookup());
#endif
}
TEST_F(RealTimePolicyEngineTest, TestCanPerformFullURLLookup_EnabledByPolicy) {
......
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