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

Unified Diff: components/bookmarks/browser/bookmark_index_unittest.cc

Issue 882823004: Omnibox: BookmarksProvider: Make Multiple Prefix Matches Work (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: restore android hack Created 5 years, 11 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
« no previous file with comments | « components/bookmarks/browser/bookmark_index.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/bookmarks/browser/bookmark_index_unittest.cc
diff --git a/components/bookmarks/browser/bookmark_index_unittest.cc b/components/bookmarks/browser/bookmark_index_unittest.cc
index 02241bac8cb4d72187c79e369021ae192ba266d3..22efeaaa754a5a4bc5b4d61333b23f02b6a63b87 100644
--- a/components/bookmarks/browser/bookmark_index_unittest.cc
+++ b/components/bookmarks/browser/bookmark_index_unittest.cc
@@ -153,6 +153,9 @@ TEST_F(BookmarkIndexTest, GetBookmarksMatching) {
// Trivial test case of only one term, exact match.
{ "a;b", "A", "a" },
+ // Two terms, exact matches.
+ { "a b;b", "a b", "a b" },
+
// Prefix match, one term.
{ "abcd;abc;b", "abc", "abcd;abc" },
@@ -176,13 +179,17 @@ TEST_F(BookmarkIndexTest, GetBookmarksMatching) {
// Prefix matches against multiple candidates.
{ "abc1 abc2 abc3 abc4", "abc", "abc1 abc2 abc3 abc4"},
+ // Multiple prefix matches (with a lot of redundancy) against multiple
+ // candidates.
+ { "abc1 abc2 abc3 abc4 def1 def2 def3 def4",
+ "abc def abc def abc def abc def abc def",
+ "abc1 abc2 abc3 abc4 def1 def2 def3 def4"},
+
// Prefix match on the first term.
{ "abc", "a", "" },
// Prefix match on subsequent terms.
{ "abc def", "abc d", "" },
-
-
};
for (size_t i = 0; i < arraysize(data); ++i) {
std::vector<std::string> titles;
« no previous file with comments | « components/bookmarks/browser/bookmark_index.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698