Commit 55b0f57c authored by Moe Ahmadi's avatar Moe Ahmadi Committed by Commit Bot

Enables Desktop NTP realbox by default

Feature being launched in cr/326256148

- Enables ntp_features::kRealbox and
  omnibox::kZeroSuggestionsOnNTPRealbox which control the realbox and
  zero-suggest in realbox respectively.
- Enables omnibox::kZeroSuggestionsOnNTP which should've been enabled
  in crrev.com/c/2175138.
- Removes applicable fieldtrial_testing_config.json entries and adjusts
  test expectations.

Change-Id: I1889e65c23e02624b85f0291600b26382e75f828
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2354993Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798392}
parent 0158f88d
......@@ -49,7 +49,7 @@ const base::Feature kRealboxUseGoogleGIcon{"NtpRealboxUseGoogleGIcon",
// If enabled, the search box in the middle of the NTP will accept input
// directly (i.e. not be a "fake" box) and search results will show directly
// below the non-fake input ("realbox").
const base::Feature kRealbox{"NtpRealbox", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kRealbox{"NtpRealbox", base::FEATURE_ENABLED_BY_DEFAULT};
// If enabled, shows Vasco suggestion chips in the NTP below fakebox/realbox
// despite other config except DisableSearchSuggestChips below.
......
......@@ -15,74 +15,11 @@ namespace ntp_features {
TEST(NTPFeaturesTest, IsRealboxEnabled) {
{
base::test::ScopedFeatureList feature_list;
EXPECT_FALSE(IsRealboxEnabled());
}
{
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(kRealbox);
EXPECT_TRUE(IsRealboxEnabled());
// Realbox is disabled when new search features are disabled.
feature_list.Reset();
feature_list.InitWithFeatures({kRealbox}, {omnibox::kNewSearchFeatures});
EXPECT_FALSE(IsRealboxEnabled());
}
{
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(omnibox::kZeroSuggestionsOnNTPRealbox);
EXPECT_TRUE(IsRealboxEnabled());
// Realbox is disabled when new search features are disabled.
feature_list.Reset();
feature_list.InitWithFeatures({omnibox::kZeroSuggestionsOnNTPRealbox},
{omnibox::kNewSearchFeatures});
EXPECT_FALSE(IsRealboxEnabled());
}
{
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(
omnibox::kReactiveZeroSuggestionsOnNTPRealbox);
EXPECT_TRUE(IsRealboxEnabled());
// Realbox is disabled when new search features are disabled.
feature_list.Reset();
feature_list.InitWithFeatures(
{omnibox::kReactiveZeroSuggestionsOnNTPRealbox},
{omnibox::kNewSearchFeatures});
EXPECT_FALSE(IsRealboxEnabled());
}
{
base::test::ScopedFeatureList feature_list;
// Reactive zero-prefix suggestions in the NTP Omnibox.
feature_list.InitAndEnableFeature(
omnibox::kReactiveZeroSuggestionsOnNTPOmnibox);
EXPECT_FALSE(IsRealboxEnabled());
}
{
base::test::ScopedFeatureList feature_list;
// zero-prefix suggestions are configured for the NTP Omnibox.
feature_list.InitWithFeaturesAndParameters(
{{omnibox::kOnFocusSuggestions,
{{"ZeroSuggestVariant:7:*", "Does not matter"}}}},
{});
EXPECT_FALSE(IsRealboxEnabled());
}
{
base::test::ScopedFeatureList feature_list;
// zero-prefix suggestions are configured for the NTP Realbox.
feature_list.InitWithFeaturesAndParameters(
{{omnibox::kOnFocusSuggestions,
{{"ZeroSuggestVariant:15:*", "Does not matter"}}}},
{});
EXPECT_TRUE(IsRealboxEnabled());
// Realbox is disabled when new search features are disabled.
feature_list.Reset();
feature_list.InitWithFeaturesAndParameters(
{{omnibox::kOnFocusSuggestions,
{{"ZeroSuggestVariant:15:*", "Does not matter"}}}},
{omnibox::kNewSearchFeatures});
feature_list.InitAndDisableFeature(omnibox::kNewSearchFeatures);
EXPECT_FALSE(IsRealboxEnabled());
}
}
......
......@@ -207,9 +207,7 @@ TEST_F(SearchSuggestServiceTest, IsEnabled) {
// Note: ZPS variant 15 is NTP Realbox as starting focus.
feature_params["ZeroSuggestVariant:15:*"] = kRemoteNoUrlLocal;
feature_list.InitWithFeaturesAndParameters(
{{omnibox::kZeroSuggestionsOnNTP, {}},
{omnibox::kZeroSuggestionsOnNTPRealbox, {}},
{omnibox::kOnFocusSuggestions, feature_params},
{{omnibox::kOnFocusSuggestions, feature_params},
{ntp_features::kSearchSuggestChips, {}}},
{});
EXPECT_TRUE(SearchSuggestService::IsEnabled());
......@@ -236,9 +234,7 @@ TEST_F(SearchSuggestServiceTest, IsEnabled) {
// Note: ZPS variant 15 is NTP Realbox as starting focus.
feature_params["ZeroSuggestVariant:15:*"] = kRemoteNoUrlLocal;
feature_list.InitWithFeaturesAndParameters(
{{omnibox::kZeroSuggestionsOnNTP, {}},
{omnibox::kZeroSuggestionsOnNTPRealbox, {}},
{omnibox::kOnFocusSuggestions, feature_params},
{{omnibox::kOnFocusSuggestions, feature_params},
{ntp_features::kSearchSuggestChips, {}},
{ntp_features::kDisableSearchSuggestChips, {}}},
{});
......
......@@ -283,12 +283,12 @@ const base::Feature kReactiveZeroSuggestionsOnNTPRealbox{
// Allow suggestions to be shown to the user on the New Tab Page upon focusing
// URL bar (the omnibox).
const base::Feature kZeroSuggestionsOnNTP{"OmniboxZeroSuggestionsOnNTP",
base::FEATURE_DISABLED_BY_DEFAULT};
base::FEATURE_ENABLED_BY_DEFAULT};
// Allow suggestions to be shown to the user on the New Tab Page upon focusing
// the real search box.
const base::Feature kZeroSuggestionsOnNTPRealbox{
"OmniboxZeroSuggestionsOnNTPRealbox", base::FEATURE_DISABLED_BY_DEFAULT};
"OmniboxZeroSuggestionsOnNTPRealbox", base::FEATURE_ENABLED_BY_DEFAULT};
// Allow on-focus query refinements to be shown on the default SERP.
const base::Feature kZeroSuggestionsOnSERP{"OmniboxZeroSuggestionsOnSERP",
......
......@@ -4893,7 +4893,6 @@
"UIMaxAutocompleteMatches": "8"
},
"enable_features": [
"NtpRealbox",
"OmniboxDisplayTitleForCurrentUrl",
"OmniboxDocumentProvider",
"OmniboxMaxURLMatches",
......
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