Commit f2bde585 authored by Tarun Bansal's avatar Tarun Bansal Committed by Commit Bot

Disable NoScript preview by default.

Change-Id: I3bd8fd7ecaf0393848ec91296dacc8996251a14d
Bug: 1090417
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2236679
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: default avatarMichael Crouse <mcrouse@chromium.org>
Reviewed-by: default avatarSophie Chang <sophiechang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776373}
parent e4ef59cc
...@@ -860,22 +860,11 @@ TEST_F(PreviewsDeciderImplTest, NoScriptFeatureDefaultBehavior) { ...@@ -860,22 +860,11 @@ TEST_F(PreviewsDeciderImplTest, NoScriptFeatureDefaultBehavior) {
PreviewsUserData user_data(kDefaultPageId); PreviewsUserData user_data(kDefaultPageId);
content::MockNavigationHandle navigation_handle; content::MockNavigationHandle navigation_handle;
navigation_handle.set_url(GURL("https://www.google.com")); navigation_handle.set_url(GURL("https://www.google.com"));
#if defined(OS_ANDROID)
// Enabled by default on Android. NOSCRIPT always allowed at navigation start
// to handle asynchronous loading of page hints; non-allowlisted ones are
// later blocked on commit.
EXPECT_TRUE(previews_decider_impl()->ShouldAllowPreviewAtNavigationStart(
&user_data, &navigation_handle, false, PreviewsType::NOSCRIPT));
histogram_tester.ExpectTotalCount("Previews.EligibilityReason.NoScript", 1);
histogram_tester.ExpectBucketCount(
"Previews.EligibilityReason.NoScript",
static_cast<int>(PreviewsEligibilityReason::ALLOWED), 1);
#else // !defined(OS_ANDROID)
// Disabled by default on non-Android. // Disabled by default on non-Android.
EXPECT_FALSE(previews_decider_impl()->ShouldAllowPreviewAtNavigationStart( EXPECT_FALSE(previews_decider_impl()->ShouldAllowPreviewAtNavigationStart(
&user_data, &navigation_handle, false, PreviewsType::NOSCRIPT)); &user_data, &navigation_handle, false, PreviewsType::NOSCRIPT));
histogram_tester.ExpectTotalCount("Previews.EligibilityReason.NoScript", 0); histogram_tester.ExpectTotalCount("Previews.EligibilityReason.NoScript", 0);
#endif // defined(OS_ANDROID)
} }
TEST_F(PreviewsDeciderImplTest, NoScriptNotAllowedWithoutOptimizationHints) { TEST_F(PreviewsDeciderImplTest, NoScriptNotAllowedWithoutOptimizationHints) {
......
...@@ -29,11 +29,7 @@ const base::Feature kOfflinePreviews{"OfflinePreviews", ...@@ -29,11 +29,7 @@ const base::Feature kOfflinePreviews{"OfflinePreviews",
// Support for enabling NoScript previews which includes a base feature // Support for enabling NoScript previews which includes a base feature
// and a UserConsistent-specific experiment feature. // and a UserConsistent-specific experiment feature.
const base::FeatureState kNoScriptDefaultFeatureState = const base::FeatureState kNoScriptDefaultFeatureState =
#if defined(OS_ANDROID)
base::FEATURE_ENABLED_BY_DEFAULT;
#else // !defined(OS_ANDROID)
base::FEATURE_DISABLED_BY_DEFAULT; base::FEATURE_DISABLED_BY_DEFAULT;
#endif // defined(OS_ANDROID)
const base::Feature kNoScriptPreviews{"NoScriptPreviews", const base::Feature kNoScriptPreviews{"NoScriptPreviews",
kNoScriptDefaultFeatureState}; kNoScriptDefaultFeatureState};
const base::Feature kNoScriptPreviewsUserConsistentStudy{ const base::Feature kNoScriptPreviewsUserConsistentStudy{
......
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