Commit b84766a5 authored by Daniel Rubery's avatar Daniel Rubery Committed by Commit Bot

Fix DownloadProtectionServiceTest when APP scanning is enabled

Enabling this feature flag would cause the DownloadProtectionServiceTest
to look for an AdvancedProtectionStatusManager, which did not exist.
This CL fixes that.

Patch set 3 demonstrates that all tests now pass with the feature flag
enabled.

Change-Id: I90d771b0ca7a297e7f81509019c6f6de09ded3a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2410847
Commit-Queue: Daniel Rubery <drubery@chromium.org>
Reviewed-by: default avatarBettina Dea <bdea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807132}
parent c711e89a
......@@ -330,9 +330,14 @@ bool CheckClientDownloadRequest::ShouldPromptForDeepScanning(
return false;
#else
Profile* profile = Profile::FromBrowserContext(GetBrowserContext());
if (!profile)
return false;
AdvancedProtectionStatusManager* advanced_protection_status_manager =
AdvancedProtectionStatusManagerFactory::GetForProfile(profile);
if (!advanced_protection_status_manager)
return false;
return base::FeatureList::IsEnabled(kPromptAppForDeepScanning) &&
AdvancedProtectionStatusManagerFactory::GetForProfile(profile)
->IsUnderAdvancedProtection();
advanced_protection_status_manager->IsUnderAdvancedProtection();
#endif
}
......
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