| Index: components/omnibox/browser/autocomplete_match_unittest.cc
|
| diff --git a/components/omnibox/browser/autocomplete_match_unittest.cc b/components/omnibox/browser/autocomplete_match_unittest.cc
|
| index e6627425c16662723f27faad514eab087dfd1f2a..51cb3daf8a84118f18196758b025123af8bf60c5 100644
|
| --- a/components/omnibox/browser/autocomplete_match_unittest.cc
|
| +++ b/components/omnibox/browser/autocomplete_match_unittest.cc
|
| @@ -129,17 +129,19 @@ TEST(AutocompleteMatchTest, FormatUrlForSuggestionDisplay) {
|
| };
|
| };
|
|
|
| - // Sanity check that the trim_strings parameter works.
|
| FormatUrlTestData normal_cases[] = {
|
| + // Test trim_scheme parameter without any feature flags.
|
| {"http://google.com", true, "google.com"},
|
| {"https://google.com", true, "https://google.com"},
|
| {"http://google.com", false, "http://google.com"},
|
| {"https://google.com", false, "https://google.com"},
|
| - };
|
| +
|
| + // Verify that trivial subdomains are preserved in the normal case.
|
| + {"http://www.google.com", false, "http://www.google.com"}};
|
| for (FormatUrlTestData& test_case : normal_cases)
|
| test_case.Validate();
|
|
|
| - // Test the hide-scheme feature flag.
|
| + // Test the hide-scheme feature flag with the trim_scheme paramater.
|
| std::unique_ptr<base::test::ScopedFeatureList> feature_list(
|
| new base::test::ScopedFeatureList);
|
| feature_list->InitAndEnableFeature(
|
| @@ -153,6 +155,15 @@ TEST(AutocompleteMatchTest, FormatUrlForSuggestionDisplay) {
|
| };
|
| for (FormatUrlTestData& test_case : omit_scheme_cases)
|
| test_case.Validate();
|
| +
|
| + // Test the trim trivial subdomains feature flag.
|
| + feature_list.reset(new base::test::ScopedFeatureList);
|
| + feature_list->InitAndEnableFeature(
|
| + omnibox::kUIExperimentHideSuggestionUrlTrivialSubdomains);
|
| +
|
| + FormatUrlTestData trim_trivial_subdomains_case = {"http://www.m.google.com",
|
| + false, "http://google.com"};
|
| + trim_trivial_subdomains_case.Validate();
|
| }
|
|
|
| TEST(AutocompleteMatchTest, SupportsDeletion) {
|
|
|