Index: chrome/browser/autocomplete/bookmark_provider_unittest.cc |
diff --git a/chrome/browser/autocomplete/bookmark_provider_unittest.cc b/chrome/browser/autocomplete/bookmark_provider_unittest.cc |
index 241eea3f4bb60702644b4e8208e9efe389d5d100..ed6a160c2b5b081a8ca411851ccc73cce87be9de 100644 |
--- a/chrome/browser/autocomplete/bookmark_provider_unittest.cc |
+++ b/chrome/browser/autocomplete/bookmark_provider_unittest.cc |
@@ -33,8 +33,8 @@ |
{ "abc def", "http://www.catsanddogs.com/a" }, |
{ "abcde", "http://www.catsanddogs.com/b" }, |
{ "abcdef", "http://www.catsanddogs.com/c" }, |
- { "carry carbon carefully", "http://www.catsanddogs.com/d" }, |
- { "a definition", "http://www.catsanddogs.com/e" }, |
+ { "a definition", "http://www.catsanddogs.com/d" }, |
+ { "carry carbon carefully", "http://www.catsanddogs.com/e" }, |
{ "ghi jkl", "http://www.catsanddogs.com/f" }, |
{ "jkl ghi", "http://www.catsanddogs.com/g" }, |
{ "frankly frankly frank", "http://www.catsanddogs.com/h" }, |
@@ -49,17 +49,19 @@ |
{ "chrome://omnibox", "chrome://omnibox" }, |
// For testing ranking with different URLs. |
{"achlorhydric featherheads resuscitates mockingbirds", |
- "http://www.manylongwords.com/1a" }, |
+ "http://www.featherheads.com/a" }, |
{"achlorhydric mockingbirds resuscitates featherhead", |
- "http://www.manylongwords.com/2b" }, |
+ "http://www.featherheads.com/b" }, |
{"featherhead resuscitates achlorhydric mockingbirds", |
- "http://www.manylongwords.com/3c" }, |
+ "http://www.featherheads.com/c" }, |
{"mockingbirds resuscitates featherheads achlorhydric", |
- "http://www.manylongwords.com/4d" }, |
- // For testing URL boosting. (URLs referenced multiple times are boosted.) |
- {"burning worms #1", "http://www.burns.com/" }, |
- {"burning worms #2", "http://www.worms.com/" }, |
- {"worming burns #10", "http://www.burns.com/" }, |
+ "http://www.featherheads.com/d" }, |
+ // For testing URL boosting. |
+ {"burning worms #1", "http://www.burned.com/" }, |
+ {"burning worms #2", "http://www.worms.com/" }, |
+ {"worming burns #10", "http://www.burned.com/" }, |
+ {"worming burns #20", "http://www.worms.com/" }, |
+ {"jive music", "http://www.worms.com/" }, |
}; |
class BookmarkProviderTest : public testing::Test { |
@@ -79,7 +81,7 @@ |
}; |
BookmarkProviderTest::BookmarkProviderTest() { |
- model_ = client_.CreateModel(); |
+ model_ = client_.CreateModel(false); |
} |
void BookmarkProviderTest::SetUp() { |
@@ -231,12 +233,11 @@ |
{{4, 7}, {0, 0}}}}, |
{"ghi jkl", 2, {{{0, 3}, {4, 7}, {0, 0}}, |
{{0, 3}, {4, 7}, {0, 0}}}}, |
- // NB: GetBookmarksMatching(...) uses exact match for "a" in title or URL. |
- {"a", 2, {{{0, 1}, {0, 0}}, |
- {{0, 0}}}}, |
+ // NB: GetBookmarksWithTitlesMatching(...) uses exact match for "a". |
+ {"a", 1, {{{0, 1}, {0, 0}}}}, |
{"a d", 0, {{{0, 0}}}}, |
{"carry carbon", 1, {{{0, 5}, {6, 12}, {0, 0}}}}, |
- // NB: GetBookmarksMatching(...) sorts the match positions. |
+ // NB: GetBookmarksWithTitlesMatching(...) sorts the match positions. |
{"carbon carry", 1, {{{0, 5}, {6, 12}, {0, 0}}}}, |
{"arbon", 0, {{{0, 0}}}}, |
{"ar", 0, {{{0, 0}}}}, |
@@ -321,18 +322,15 @@ |
3, {"mockingbirds resuscitates featherheads achlorhydric", |
"achlorhydric mockingbirds resuscitates featherhead", |
"featherhead resuscitates achlorhydric mockingbirds"}}, |
- // Ranking of exact-word matches with URL boosts. |
- {"worms", 2, {"burning worms #1", // boosted |
- "burning worms #2", // not boosted |
+ // Ranking of exact-word matches with URL boost. |
+ {"worms", 2, {"burning worms #2", // boosted |
+ "burning worms #1", // not boosted |
""}}, |
- // Ranking of prefix matches with URL boost. |
- {"burn worm", 3, {"burning worms #1", // boosted |
- "worming burns #10", // boosted but longer title |
- "burning worms #2"}}, // not boosted |
- // A query of "worm burn" will have the same results. |
- {"worm burn", 3, {"burning worms #1", // boosted |
- "worming burns #10", // boosted but longer title |
- "burning worms #2"}}, // not boosted |
+ // Ranking of prefix matches with URL boost. Note that a query of |
+ // "worm burn" will have the same results. |
+ {"burn worm", 3, {"burning worms #2", // boosted |
+ "worming burns #20", // boosted |
+ "burning worms #1"}}, // not boosted but shorter |
}; |
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(query_data); ++i) { |
@@ -433,6 +431,10 @@ |
{ "rep", "www.repeat.com/1/repeat/2/", "0:1,4:3,7:1,17:3,20:1" }, |
{ "versi", "chrome://version", "0:1,9:3,14:1" } |
}; |
+ |
+ // Reload the bookmarks index with |index_urls| == true. |
+ model_ = client_.CreateModel(true); |
+ SetUp(); |
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(query_data); ++i) { |
std::string description = "for query=" + query_data[i].query; |