summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bookmarks/bookmark_utils_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/bookmarks/bookmark_utils_unittest.cc')
-rw-r--r--chrome/browser/bookmarks/bookmark_utils_unittest.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/chrome/browser/bookmarks/bookmark_utils_unittest.cc b/chrome/browser/bookmarks/bookmark_utils_unittest.cc
index 2192bc4..b60bd45 100644
--- a/chrome/browser/bookmarks/bookmark_utils_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_utils_unittest.cc
@@ -22,20 +22,35 @@ TEST_F(BookmarkUtilsTest, GetBookmarksContainingText) {
std::vector<BookmarkNode*> nodes;
bookmark_utils::GetBookmarksContainingText(&model, L"foo", 100, &nodes);
- ASSERT_EQ(static_cast<size_t>(1), nodes.size());
+ ASSERT_EQ(1U, nodes.size());
EXPECT_TRUE(nodes[0] == n1);
EXPECT_TRUE(bookmark_utils::DoesBookmarkContainText(n1, L"foo"));
nodes.clear();
bookmark_utils::GetBookmarksContainingText(&model, L"cnn", 100, &nodes);
- ASSERT_EQ(static_cast<size_t>(1), nodes.size());
+ ASSERT_EQ(1U, nodes.size());
EXPECT_TRUE(nodes[0] == n2);
EXPECT_TRUE(bookmark_utils::DoesBookmarkContainText(n2, L"cnn"));
nodes.clear();
bookmark_utils::GetBookmarksContainingText(&model, L"foo bar", 100, &nodes);
- ASSERT_EQ(static_cast<size_t>(1), nodes.size());
+ ASSERT_EQ(1U, nodes.size());
EXPECT_TRUE(nodes[0] == n1);
EXPECT_TRUE(bookmark_utils::DoesBookmarkContainText(n1, L"foo bar"));
nodes.clear();
}
+
+// Makes sure if the lower case string of a bookmark title is more characters
+// than the upper case string no match positions are returned.
+TEST_F(BookmarkUtilsTest, EmptyMatchOnMultiwideLowercaseString) {
+ BookmarkModel model(NULL);
+ BookmarkNode* n1 =
+ model.AddURL(model.other_node(), 0, L"\u0130 i",
+ GURL("http://www.google.com"));
+
+ std::vector<bookmark_utils::TitleMatch> matches;
+ bookmark_utils::GetBookmarksMatchingText(&model, L"i", 100, &matches);
+ ASSERT_EQ(1U, matches.size());
+ EXPECT_TRUE(matches[0].node == n1);
+ EXPECT_TRUE(matches[0].match_positions.empty());
+}