Index: chrome/browser/history/in_memory_url_index_unittest.cc |
=================================================================== |
--- chrome/browser/history/in_memory_url_index_unittest.cc (revision 119252) |
+++ chrome/browser/history/in_memory_url_index_unittest.cc (working copy) |
@@ -232,7 +232,17 @@ |
EXPECT_EQ(5, matches[0].url_info.id()); |
EXPECT_EQ("http://drudgereport.com/", matches[0].url_info.url().spec()); |
EXPECT_EQ(ASCIIToUTF16("DRUDGE REPORT 2010"), matches[0].url_info.title()); |
+ EXPECT_TRUE(matches[0].can_inline); |
+ // Make sure a trailing space prevents inline-ability but still results |
+ // in the expected result. |
+ matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("DrudgeReport ")); |
+ ASSERT_EQ(1U, matches.size()); |
+ EXPECT_EQ(5, matches[0].url_info.id()); |
+ EXPECT_EQ("http://drudgereport.com/", matches[0].url_info.url().spec()); |
+ EXPECT_EQ(ASCIIToUTF16("DRUDGE REPORT 2010"), matches[0].url_info.title()); |
+ EXPECT_FALSE(matches[0].can_inline); |
+ |
// Search which should result in multiple results. |
matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("drudge")); |
ASSERT_EQ(2U, matches.size()); |
@@ -250,6 +260,7 @@ |
matches[0].url_info.url().spec()); // Note: URL gets lowercased. |
EXPECT_EQ(ASCIIToUTF16("Practically Perfect Search Result"), |
matches[0].url_info.title()); |
+ EXPECT_FALSE(matches[0].can_inline); |
// Search which should result in very poor result. |
matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("z y x")); |
@@ -261,10 +272,12 @@ |
matches[0].url_info.url().spec()); // Note: URL gets lowercased. |
EXPECT_EQ(ASCIIToUTF16("Practically Useless Search Result"), |
matches[0].url_info.title()); |
+ EXPECT_FALSE(matches[0].can_inline); |
// Search which will match at the end of an URL with encoded characters. |
matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("ice")); |
ASSERT_EQ(1U, matches.size()); |
+ EXPECT_FALSE(matches[0].can_inline); |
} |
TEST_F(InMemoryURLIndexTest, URLPrefixMatching) { |