summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_result_unittest.cc
diff options
context:
space:
mode:
authorhfung@chromium.org <hfung@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-17 03:37:43 +0000
committerhfung@chromium.org <hfung@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-17 03:37:43 +0000
commitb99ba414a16590b4dc5f8cbb53fd43f388f0fc2f (patch)
tree0c3b5cd3e550fbb3a5c94921bf858d1925de43a2 /chrome/browser/autocomplete/autocomplete_result_unittest.cc
parentab862a1d04c8dcb223b110c21facc9f15528116f (diff)
downloadchromium_src-b99ba414a16590b4dc5f8cbb53fd43f388f0fc2f.zip
chromium_src-b99ba414a16590b4dc5f8cbb53fd43f388f0fc2f.tar.gz
chromium_src-b99ba414a16590b4dc5f8cbb53fd43f388f0fc2f.tar.bz2
Remove UndemotableTopMatchTypes since we don't plan on using it further. This is mostly undoing https://codereview.chromium.org/55413002/.
BUG=278442 Review URL: https://codereview.chromium.org/239973003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264386 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_result_unittest.cc')
-rw-r--r--chrome/browser/autocomplete/autocomplete_result_unittest.cc51
1 files changed, 0 insertions, 51 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_result_unittest.cc b/chrome/browser/autocomplete/autocomplete_result_unittest.cc
index 24dd96e..e98653e 100644
--- a/chrome/browser/autocomplete/autocomplete_result_unittest.cc
+++ b/chrome/browser/autocomplete/autocomplete_result_unittest.cc
@@ -463,57 +463,6 @@ TEST_F(AutocompleteResultTest, SortAndCullWithDemotionsByType) {
result.match_at(2)->destination_url.spec());
}
-TEST_F(AutocompleteResultTest, SortAndCullWithUndemotableTypes) {
- // Add some matches.
- ACMatches matches(3);
- matches[0].destination_url = GURL("http://top-history-url/");
- matches[0].relevance = 1400;
- matches[0].allowed_to_be_default_match = true;
- matches[0].type = AutocompleteMatchType::HISTORY_URL;
- matches[1].destination_url = GURL("http://history-url2/");
- matches[1].relevance = 1300;
- matches[1].allowed_to_be_default_match = true;
- matches[1].type = AutocompleteMatchType::HISTORY_URL;
- matches[2].destination_url = GURL("http://search-what-you-typed/");
- matches[2].relevance = 1200;
- matches[2].allowed_to_be_default_match = true;
- matches[2].type = AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED;
-
- // Add a rule demoting history-url, but don't demote the top match.
- {
- std::map<std::string, std::string> params;
- // 3 == HOME_PAGE
- params[std::string(OmniboxFieldTrial::kDemoteByTypeRule) + ":3:*"] =
- "1:50";
- params[std::string(OmniboxFieldTrial::kUndemotableTopTypeRule) + ":3:*"] =
- "1,5";
- ASSERT_TRUE(chrome_variations::AssociateVariationParams(
- OmniboxFieldTrial::kBundledExperimentFieldTrialName, "B", params));
- }
- base::FieldTrialList::CreateFieldTrial(
- OmniboxFieldTrial::kBundledExperimentFieldTrialName, "B");
-
- AutocompleteResult result;
- result.AppendMatches(matches);
- AutocompleteInput input(base::string16(), base::string16::npos,
- base::string16(), GURL(),
- AutocompleteInput::HOME_PAGE, false, false, false,
- AutocompleteInput::ALL_MATCHES);
- result.SortAndCull(input, test_util_.profile());
-
- // Check the new ordering. The first history-url result should not be
- // demoted, but the second result should be.
- // We cannot check relevance scores because the matches are sorted by
- // demoted relevance but the actual relevance scores are not modified.
- ASSERT_EQ(3u, result.size());
- EXPECT_EQ("http://top-history-url/",
- result.match_at(0)->destination_url.spec());
- EXPECT_EQ("http://search-what-you-typed/",
- result.match_at(1)->destination_url.spec());
- EXPECT_EQ("http://history-url2/",
- result.match_at(2)->destination_url.spec());
-}
-
TEST_F(AutocompleteResultTest, SortAndCullWithMatchDupsAndDemotionsByType) {
// Add some matches.
ACMatches matches;