Commit 91aae573 authored by Xinghui Lu's avatar Xinghui Lu Committed by Commit Bot

Support SafeBrowsingProtectionLevel policy on Android

The SafeBrowsingProtectionLevel policy is supported on desktop platforms
since M83. We should support this policy on Android as well.

Bug: 1111457
Change-Id: I822dc410a7951fb11f9e17df718f2f1246bba3ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2380739
Commit-Queue: Xinghui Lu <xinghuilu@chromium.org>
Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#802488}
parent 77353e9c
......@@ -303,6 +303,55 @@ public class SecuritySettingsFragmentTest {
});
}
@Test
@SmallTest
@Feature({"SafeBrowsing"})
@Features.EnableFeatures(ChromeFeatureList.SAFE_BROWSING_ENHANCED_PROTECTION_ENABLED)
@Policies.Add({ @Policies.Item(key = "SafeBrowsingProtectionLevel", string = "2") })
public void testSafeBrowsingProtectionLevelManagedEnhanced() {
TestThreadUtils.runOnUiThreadBlocking(
() -> { ChromeBrowserInitializer.getInstance().handleSynchronousStartup(); });
launchSettingsActivity();
TestThreadUtils.runOnUiThreadBlocking(() -> {
Assert.assertTrue(SafeBrowsingBridge.isSafeBrowsingManaged());
Assert.assertTrue(mManagedTextPreference.isVisible());
Assert.assertFalse(getEnhancedProtectionButton().isEnabled());
Assert.assertFalse(getStandardProtectionButton().isEnabled());
Assert.assertFalse(getNoProtectionButton().isEnabled());
Assert.assertEquals(SafeBrowsingState.ENHANCED_PROTECTION, getSafeBrowsingState());
});
}
@Test
@SmallTest
@Feature({"SafeBrowsing"})
@Features.EnableFeatures(ChromeFeatureList.SAFE_BROWSING_ENHANCED_PROTECTION_ENABLED)
@Policies.Add({ @Policies.Item(key = "SafeBrowsingProtectionLevel", string = "1") })
public void testSafeBrowsingProtectionLevelManagedStandard() {
TestThreadUtils.runOnUiThreadBlocking(
() -> { ChromeBrowserInitializer.getInstance().handleSynchronousStartup(); });
launchSettingsActivity();
TestThreadUtils.runOnUiThreadBlocking(() -> {
Assert.assertTrue(SafeBrowsingBridge.isSafeBrowsingManaged());
Assert.assertEquals(SafeBrowsingState.STANDARD_PROTECTION, getSafeBrowsingState());
});
}
@Test
@SmallTest
@Feature({"SafeBrowsing"})
@Features.EnableFeatures(ChromeFeatureList.SAFE_BROWSING_ENHANCED_PROTECTION_ENABLED)
@Policies.Add({ @Policies.Item(key = "SafeBrowsingProtectionLevel", string = "0") })
public void testSafeBrowsingProtectionLevelManagedDisabled() {
TestThreadUtils.runOnUiThreadBlocking(
() -> { ChromeBrowserInitializer.getInstance().handleSynchronousStartup(); });
launchSettingsActivity();
TestThreadUtils.runOnUiThreadBlocking(() -> {
Assert.assertTrue(SafeBrowsingBridge.isSafeBrowsingManaged());
Assert.assertEquals(SafeBrowsingState.NO_SAFE_BROWSING, getSafeBrowsingState());
});
}
@Test
@SmallTest
@Feature({"SafeBrowsing"})
......
......@@ -766,7 +766,7 @@
},
"SafeBrowsingEnabled": {
"os": ["win", "linux", "mac", "chromeos"],
"os": ["win", "linux", "mac", "chromeos", "android"],
"can_be_recommended": true,
"policy_pref_mapping_test": [
{
......@@ -777,7 +777,7 @@
},
"SafeBrowsingProtectionLevel": {
"os": ["win", "linux", "mac", "chromeos"],
"os": ["win", "linux", "mac", "chromeos", "android"],
"can_be_recommended": true,
"policy_pref_mapping_test": [
{
......@@ -6167,7 +6167,7 @@
},
"SafeBrowsingExtendedReportingEnabled": {
"os": ["win", "linux", "mac", "chromeos"],
"os": ["win", "linux", "mac", "chromeos", "android"],
"policy_pref_mapping_test": [
{
"policies": {
......
......@@ -3007,6 +3007,7 @@
'supported_on': [
'chrome.*:83-',
'chrome_os:83-',
'android:87-',
],
'future_on': [ 'ios' ],
'features': {
......@@ -3031,6 +3032,7 @@
If this policy is left not set, Safe Browsing will operate in Standard Protection mode but users can change this setting.
See https://developers.google.com/safe-browsing for more info on Safe Browsing.''',
'arc_support': 'This policy is not supported within Arc.',
},
{
'name': 'MetricsReportingEnabled',
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