Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2133)

Unified Diff: chrome/browser/autocomplete/history_quick_provider_unittest.cc

Issue 7314018: Don't autocomplete searches of >1 word if they've only been visited once and the user has not yet... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autocomplete/history_quick_provider_unittest.cc
===================================================================
--- chrome/browser/autocomplete/history_quick_provider_unittest.cc (revision 92729)
+++ chrome/browser/autocomplete/history_quick_provider_unittest.cc (working copy)
@@ -364,43 +364,49 @@
next_score = 1500;
match.raw_score = 1425;
match.can_inline = false;
- EXPECT_EQ(HistoryQuickProvider::CalculateRelevance(match, &next_score), 1199);
- EXPECT_EQ(next_score, 1198);
+ EXPECT_EQ(HistoryQuickProvider::CalculateRelevance(match, &next_score),
+ HistoryQuickProvider::kMaxNonInliningScore);
+ EXPECT_EQ(next_score, HistoryQuickProvider::kMaxNonInliningScore - 1);
// Can inline, clamped.
- next_score = 1199;
+ next_score = HistoryQuickProvider::kMaxNonInliningScore;
match.raw_score = 1425;
match.can_inline = true;
- EXPECT_EQ(HistoryQuickProvider::CalculateRelevance(match, &next_score), 1199);
- EXPECT_EQ(next_score, 1198);
+ EXPECT_EQ(HistoryQuickProvider::CalculateRelevance(match, &next_score),
+ HistoryQuickProvider::kMaxNonInliningScore);
+ EXPECT_EQ(next_score, HistoryQuickProvider::kMaxNonInliningScore - 1);
// Can't inline, clamped.
- next_score = 1199;
+ next_score = HistoryQuickProvider::kMaxNonInliningScore;
match.raw_score = 1425;
match.can_inline = false;
- EXPECT_EQ(HistoryQuickProvider::CalculateRelevance(match, &next_score), 1199);
- EXPECT_EQ(next_score, 1198);
+ EXPECT_EQ(HistoryQuickProvider::CalculateRelevance(match, &next_score),
+ HistoryQuickProvider::kMaxNonInliningScore);
+ EXPECT_EQ(next_score, HistoryQuickProvider::kMaxNonInliningScore - 1);
// Score just above the clamped limit.
- next_score = 1199;
- match.raw_score = 1200;
+ next_score = HistoryQuickProvider::kMaxNonInliningScore;
+ match.raw_score = AutocompleteResult::kLowestDefaultScore;
match.can_inline = false;
- EXPECT_EQ(HistoryQuickProvider::CalculateRelevance(match, &next_score), 1199);
- EXPECT_EQ(next_score, 1198);
+ EXPECT_EQ(HistoryQuickProvider::CalculateRelevance(match, &next_score),
+ HistoryQuickProvider::kMaxNonInliningScore);
+ EXPECT_EQ(next_score, HistoryQuickProvider::kMaxNonInliningScore - 1);
// Score right at the clamped limit.
- next_score = 1199;
- match.raw_score = 1199;
+ next_score = HistoryQuickProvider::kMaxNonInliningScore;
+ match.raw_score = HistoryQuickProvider::kMaxNonInliningScore;
match.can_inline = true;
- EXPECT_EQ(HistoryQuickProvider::CalculateRelevance(match, &next_score), 1199);
- EXPECT_EQ(next_score, 1198);
+ EXPECT_EQ(HistoryQuickProvider::CalculateRelevance(match, &next_score),
+ HistoryQuickProvider::kMaxNonInliningScore);
+ EXPECT_EQ(next_score, HistoryQuickProvider::kMaxNonInliningScore - 1);
// Score just below the clamped limit.
- next_score = 1199;
- match.raw_score = 1198;
+ next_score = HistoryQuickProvider::kMaxNonInliningScore;
+ match.raw_score = HistoryQuickProvider::kMaxNonInliningScore - 1;
match.can_inline = true;
- EXPECT_EQ(HistoryQuickProvider::CalculateRelevance(match, &next_score), 1198);
- EXPECT_EQ(next_score, 1197);
+ EXPECT_EQ(HistoryQuickProvider::CalculateRelevance(match, &next_score),
+ HistoryQuickProvider::kMaxNonInliningScore - 1);
+ EXPECT_EQ(next_score, HistoryQuickProvider::kMaxNonInliningScore - 2);
// Low score, can inline, not clamped.
next_score = 1500;

Powered by Google App Engine
This is Rietveld 408576698