| Index: chrome/browser/omnibox/omnibox_field_trial_unittest.cc
|
| diff --git a/chrome/browser/omnibox/omnibox_field_trial_unittest.cc b/chrome/browser/omnibox/omnibox_field_trial_unittest.cc
|
| index 82522b6dc6973d3761ab570cf83051e084e18a08..ef17cb5f1954c0b062e017321c69788d5676fca4 100644
|
| --- a/chrome/browser/omnibox/omnibox_field_trial_unittest.cc
|
| +++ b/chrome/browser/omnibox/omnibox_field_trial_unittest.cc
|
| @@ -188,6 +188,34 @@ TEST_F(OmniboxFieldTrialTest, GetDemotionsByTypeWithFallback) {
|
| VerifyDemotion(demotions_by_type, AutocompleteMatchType::HISTORY_URL, 0.25);
|
| }
|
|
|
| +TEST_F(OmniboxFieldTrialTest, GetUndemotableTopTypes) {
|
| + {
|
| + std::map<std::string, std::string> params;
|
| + const std::string rule(OmniboxFieldTrial::kUndemotableTopTypeRule);
|
| + params[rule + ":1:*"] = "1,3";
|
| + params[rule + ":3:*"] = "5";
|
| + params[rule + ":*:*"] = "2";
|
| + ASSERT_TRUE(chrome_variations::AssociateVariationParams(
|
| + OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A", params));
|
| + }
|
| + base::FieldTrialList::CreateFieldTrial(
|
| + OmniboxFieldTrial::kBundledExperimentFieldTrialName, "A");
|
| + OmniboxFieldTrial::UndemotableTopMatchTypes undemotable_types;
|
| + OmniboxFieldTrial::GetUndemotableTopTypes(
|
| + AutocompleteInput::NEW_TAB_PAGE, &undemotable_types);
|
| + ASSERT_EQ(2u, undemotable_types.size());
|
| + ASSERT_EQ(1u, undemotable_types.count(AutocompleteMatchType::HISTORY_URL));
|
| + ASSERT_EQ(1u, undemotable_types.count(AutocompleteMatchType::HISTORY_BODY));
|
| + OmniboxFieldTrial::GetUndemotableTopTypes(
|
| + AutocompleteInput::HOME_PAGE, &undemotable_types);
|
| + ASSERT_EQ(1u, undemotable_types.size());
|
| + ASSERT_EQ(1u, undemotable_types.count(AutocompleteMatchType::NAVSUGGEST));
|
| + OmniboxFieldTrial::GetUndemotableTopTypes(
|
| + AutocompleteInput::BLANK, &undemotable_types);
|
| + ASSERT_EQ(1u, undemotable_types.size());
|
| + ASSERT_EQ(1u, undemotable_types.count(AutocompleteMatchType::HISTORY_TITLE));
|
| +}
|
| +
|
| TEST_F(OmniboxFieldTrialTest, GetValueForRuleInContext) {
|
| // This test starts with Instant Extended off (the default state), then
|
| // enables Instant Extended and tests again on the same rules.
|
|
|