Chromium Code Reviews| Index: chrome/browser/history/in_memory_url_index_unittest.cc |
| diff --git a/chrome/browser/history/in_memory_url_index_unittest.cc b/chrome/browser/history/in_memory_url_index_unittest.cc |
| index 5268e2d059c206c9f0a397f2a167d53cf2498e08..a18e7d57433e43ae35bb5ead5e8e3811028c2d9a 100644 |
| --- a/chrome/browser/history/in_memory_url_index_unittest.cc |
| +++ b/chrome/browser/history/in_memory_url_index_unittest.cc |
| @@ -447,7 +447,9 @@ TEST_F(LimitedInMemoryURLIndexTest, Initialization) { |
| TEST_F(InMemoryURLIndexTest, Retrieval) { |
| // See if a very specific term gives a single result. |
| ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("DrudgeReport"), base::string16::npos); |
| + ASCIIToUTF16("DrudgeReport"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
|
sdefresne
2014/05/22 15:41:13
Most of the tests don't depends on the value of Au
Jiang Jiang
2014/05/23 16:12:52
Done.
|
| ASSERT_EQ(1U, matches.size()); |
| // Verify that we got back the result we expected. |
| @@ -459,7 +461,8 @@ TEST_F(InMemoryURLIndexTest, Retrieval) { |
| // Make sure a trailing space prevents inline-ability but still results |
| // in the expected result. |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("DrudgeReport "), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_EQ(5, matches[0].url_info.id()); |
| EXPECT_EQ("http://drudgereport.com/", matches[0].url_info.url().spec()); |
| @@ -468,14 +471,17 @@ TEST_F(InMemoryURLIndexTest, Retrieval) { |
| // Search which should result in multiple results. |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("drudge"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(2U, matches.size()); |
| // The results should be in descending score order. |
| EXPECT_GE(matches[0].raw_score(), matches[1].raw_score()); |
| // Search which should result in nearly perfect result. |
| matches = url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("Nearly Perfect Result"), base::string16::npos); |
| + ASCIIToUTF16("Nearly Perfect Result"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| // The results should have a very high score. |
| EXPECT_GT(matches[0].raw_score(), 900); |
| @@ -488,7 +494,8 @@ TEST_F(InMemoryURLIndexTest, Retrieval) { |
| // Search which should result in very poor result. |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("qui c"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| // The results should have a poor score. |
| EXPECT_LT(matches[0].raw_score(), 500); |
| @@ -501,14 +508,16 @@ TEST_F(InMemoryURLIndexTest, Retrieval) { |
| // Search which will match at the end of an URL with encoded characters. |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("Mice"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_EQ(30, matches[0].url_info.id()); |
| EXPECT_FALSE(matches[0].can_inline()); |
| // Check that URLs are not escaped an escape time. |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("1% wikipedia"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_EQ(35, matches[0].url_info.id()); |
| EXPECT_EQ("http://en.wikipedia.org/wiki/1%25_rule_(Internet_culture)", |
| @@ -517,7 +526,8 @@ TEST_F(InMemoryURLIndexTest, Retrieval) { |
| // Verify that a single term can appear multiple times in the URL and as long |
| // as one starts the URL it is still inlined. |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("fubar"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_EQ(34, matches[0].url_info.id()); |
| EXPECT_EQ("http://fubarfubarandfubar.com/", matches[0].url_info.url().spec()); |
| @@ -529,16 +539,20 @@ TEST_F(InMemoryURLIndexTest, Retrieval) { |
| TEST_F(InMemoryURLIndexTest, CursorPositionRetrieval) { |
| // See if a very specific term with no cursor gives an empty result. |
| ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("DrudReport"), base::string16::npos); |
| + ASCIIToUTF16("DrudReport"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(0U, matches.size()); |
| // The same test with the cursor at the end should give an empty result. |
| - matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("DrudReport"), 10u); |
| + matches = url_index_->HistoryItemsForTerms( |
| + ASCIIToUTF16("DrudReport"), 10u, AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(0U, matches.size()); |
| // If the cursor is between Drud and Report, we should find the desired |
| // result. |
| - matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("DrudReport"), 4u); |
| + matches = url_index_->HistoryItemsForTerms( |
| + ASCIIToUTF16("DrudReport"), 4u, AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_EQ("http://drudgereport.com/", matches[0].url_info.url().spec()); |
| EXPECT_EQ(ASCIIToUTF16("DRUDGE REPORT 2010"), matches[0].url_info.title()); |
| @@ -546,18 +560,24 @@ TEST_F(InMemoryURLIndexTest, CursorPositionRetrieval) { |
| // Now check multi-word inputs. No cursor should fail to find a |
| // result on this input. |
| matches = url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("MORTGAGERATE DROPS"), base::string16::npos); |
| + ASCIIToUTF16("MORTGAGERATE DROPS"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(0U, matches.size()); |
| // Ditto with cursor at end. |
| matches = url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("MORTGAGERATE DROPS"), 18u); |
| + ASCIIToUTF16("MORTGAGERATE DROPS"), |
| + 18u, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(0U, matches.size()); |
| // If the cursor is between MORTAGE And RATE, we should find the |
| // desired result. |
| matches = url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("MORTGAGERATE DROPS"), 8u); |
| + ASCIIToUTF16("MORTGAGERATE DROPS"), |
| + 8u, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_EQ("http://www.reuters.com/article/idUSN0839880620100708", |
| matches[0].url_info.url().spec()); |
| @@ -569,61 +589,72 @@ TEST_F(InMemoryURLIndexTest, CursorPositionRetrieval) { |
| TEST_F(InMemoryURLIndexTest, URLPrefixMatching) { |
| // "drudgere" - found, can inline |
| ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("drudgere"), base::string16::npos); |
| + ASCIIToUTF16("drudgere"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_TRUE(matches[0].can_inline()); |
| // "drudgere" - found, can inline |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("drudgere"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_TRUE(matches[0].can_inline()); |
| // "www.atdmt" - not found |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("www.atdmt"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| EXPECT_EQ(0U, matches.size()); |
| // "atdmt" - found, cannot inline |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("atdmt"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_FALSE(matches[0].can_inline()); |
| // "view.atdmt" - found, can inline |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("view.atdmt"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_TRUE(matches[0].can_inline()); |
| // "view.atdmt" - found, can inline |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("view.atdmt"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_TRUE(matches[0].can_inline()); |
| // "cnn.com" - found, can inline |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("cnn.com"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(2U, matches.size()); |
| // One match should be inline-able, the other not. |
| EXPECT_TRUE(matches[0].can_inline() != matches[1].can_inline()); |
| // "www.cnn.com" - found, can inline |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("www.cnn.com"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_TRUE(matches[0].can_inline()); |
| // "ww.cnn.com" - found because we allow mid-term matches in hostnames |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("ww.cnn.com"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| // "www.cnn.com" - found, can inline |
| matches = |
| url_index_->HistoryItemsForTerms(ASCIIToUTF16("www.cnn.com"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_TRUE(matches[0].can_inline()); |
| @@ -631,7 +662,8 @@ TEST_F(InMemoryURLIndexTest, URLPrefixMatching) { |
| // match |
| matches = |
| url_index_->HistoryItemsForTerms(ASCIIToUTF16("tp://www.cnn.com"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(0U, matches.size()); |
| } |
| @@ -641,13 +673,17 @@ TEST_F(InMemoryURLIndexTest, ProperStringMatching) { |
| // "atdmt.view" - not found |
| // "view.atdmt" - found |
| ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("atdmt view"), base::string16::npos); |
| + ASCIIToUTF16("atdmt view"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("atdmt.view"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(0U, matches.size()); |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("view.atdmt"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| } |
| @@ -659,8 +695,10 @@ TEST_F(InMemoryURLIndexTest, HugeResultSet) { |
| EXPECT_TRUE(UpdateURL(new_row)); |
| } |
| - ScoredHistoryMatches matches = |
| - url_index_->HistoryItemsForTerms(ASCIIToUTF16("b"), base::string16::npos); |
| + ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( |
| + ASCIIToUTF16("b"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| URLIndexPrivateData& private_data(*GetPrivateData()); |
| ASSERT_EQ(AutocompleteProvider::kMaxMatches, matches.size()); |
| // There are 7 matches already in the database. |
| @@ -676,7 +714,9 @@ TEST_F(InMemoryURLIndexTest, TitleSearch) { |
| // Ensure title is being searched. |
| ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("MORTGAGE RATE DROPS"), base::string16::npos); |
| + ASCIIToUTF16("MORTGAGE RATE DROPS"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| // Verify that we got back the result we expected. |
| @@ -693,7 +733,9 @@ TEST_F(InMemoryURLIndexTest, TitleChange) { |
| base::string16 original_terms = |
| ASCIIToUTF16("lebronomics could high taxes influence"); |
| ScoredHistoryMatches matches = |
| - url_index_->HistoryItemsForTerms(original_terms, base::string16::npos); |
| + url_index_->HistoryItemsForTerms(original_terms, |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| // Verify that we got back the result we expected. |
| @@ -708,7 +750,8 @@ TEST_F(InMemoryURLIndexTest, TitleChange) { |
| // Verify new title terms retrieves nothing. |
| base::string16 new_terms = ASCIIToUTF16("does eat oats little lambs ivy"); |
| - matches = url_index_->HistoryItemsForTerms(new_terms, base::string16::npos); |
| + matches = url_index_->HistoryItemsForTerms( |
| + new_terms, base::string16::npos, AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(0U, matches.size()); |
| // Update the row. |
| @@ -716,11 +759,12 @@ TEST_F(InMemoryURLIndexTest, TitleChange) { |
| EXPECT_TRUE(UpdateURL(old_row)); |
| // Verify we get the row using the new terms but not the original terms. |
| - matches = url_index_->HistoryItemsForTerms(new_terms, base::string16::npos); |
| + matches = url_index_->HistoryItemsForTerms( |
| + new_terms, base::string16::npos, AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_EQ(expected_id, matches[0].url_info.id()); |
| - matches = |
| - url_index_->HistoryItemsForTerms(original_terms, base::string16::npos); |
| + matches = url_index_->HistoryItemsForTerms( |
| + original_terms, base::string16::npos, AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(0U, matches.size()); |
| } |
| @@ -729,29 +773,34 @@ TEST_F(InMemoryURLIndexTest, NonUniqueTermCharacterSets) { |
| // through a string with several duplicate characters. |
| ScoredHistoryMatches matches = |
| url_index_->HistoryItemsForTerms(ASCIIToUTF16("ABRA"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_EQ(28, matches[0].url_info.id()); |
| EXPECT_EQ("http://www.ddj.com/windows/184416623", |
| matches[0].url_info.url().spec()); |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("ABRACAD"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_EQ(28, matches[0].url_info.id()); |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("ABRACADABRA"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_EQ(28, matches[0].url_info.id()); |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("ABRACADABR"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_EQ(28, matches[0].url_info.id()); |
| matches = url_index_->HistoryItemsForTerms(ASCIIToUTF16("ABRACA"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| EXPECT_EQ(28, matches[0].url_info.id()); |
| } |
| @@ -772,13 +821,17 @@ TEST_F(InMemoryURLIndexTest, TypedCharacterCaching) { |
| // Simulate typing "r" giving "r" in the simulated omnibox. The results for |
| // 'r' will be not cached because it is only 1 character long. |
| - url_index_->HistoryItemsForTerms(ASCIIToUTF16("r"), base::string16::npos); |
| + url_index_->HistoryItemsForTerms(ASCIIToUTF16("r"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| EXPECT_EQ(0U, cache.size()); |
| // Simulate typing "re" giving "r re" in the simulated omnibox. |
| // 're' should be cached at this point but not 'r' as it is a single |
| // character. |
| - url_index_->HistoryItemsForTerms(ASCIIToUTF16("r re"), base::string16::npos); |
| + url_index_->HistoryItemsForTerms(ASCIIToUTF16("r re"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, cache.size()); |
| CheckTerm(cache, ASCIIToUTF16("re")); |
| @@ -786,7 +839,8 @@ TEST_F(InMemoryURLIndexTest, TypedCharacterCaching) { |
| // 're' and 'reco' should be cached at this point but not 'r' as it is a |
| // single character. |
| url_index_->HistoryItemsForTerms(ASCIIToUTF16("r re reco"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(2U, cache.size()); |
| CheckTerm(cache, ASCIIToUTF16("re")); |
| CheckTerm(cache, ASCIIToUTF16("reco")); |
| @@ -794,20 +848,24 @@ TEST_F(InMemoryURLIndexTest, TypedCharacterCaching) { |
| // Simulate typing "mort". |
| // Since we now have only one search term, the cached results for 're' and |
| // 'reco' should be purged, giving us only 1 item in the cache (for 'mort'). |
| - url_index_->HistoryItemsForTerms(ASCIIToUTF16("mort"), base::string16::npos); |
| + url_index_->HistoryItemsForTerms(ASCIIToUTF16("mort"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, cache.size()); |
| CheckTerm(cache, ASCIIToUTF16("mort")); |
| // Simulate typing "reco" giving "mort reco" in the simulated omnibox. |
| url_index_->HistoryItemsForTerms(ASCIIToUTF16("mort reco"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(2U, cache.size()); |
| CheckTerm(cache, ASCIIToUTF16("mort")); |
| CheckTerm(cache, ASCIIToUTF16("reco")); |
| // Simulate a <DELETE> by removing the 'reco' and adding back the 'rec'. |
| url_index_->HistoryItemsForTerms(ASCIIToUTF16("mort rec"), |
| - base::string16::npos); |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(2U, cache.size()); |
| CheckTerm(cache, ASCIIToUTF16("mort")); |
| CheckTerm(cache, ASCIIToUTF16("rec")); |
| @@ -819,7 +877,9 @@ TEST_F(InMemoryURLIndexTest, AddNewRows) { |
| // Newly created URLRows get a last_visit time of 'right now' so it should |
| // qualify as a quick result candidate. |
| EXPECT_TRUE(url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("brokeandalone"), base::string16::npos).empty()); |
| + ASCIIToUTF16("brokeandalone"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches).empty()); |
| // Add a new row. |
| URLRow new_row(GURL("http://www.brokeandaloneinmanitoba.com/"), new_row_id++); |
| @@ -828,13 +888,17 @@ TEST_F(InMemoryURLIndexTest, AddNewRows) { |
| // Verify that we can retrieve it. |
| EXPECT_EQ(1U, url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("brokeandalone"), base::string16::npos).size()); |
| + ASCIIToUTF16("brokeandalone"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches).size()); |
| // Add it again just to be sure that is harmless and that it does not update |
| // the index. |
| EXPECT_FALSE(UpdateURL(new_row)); |
| EXPECT_EQ(1U, url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("brokeandalone"), base::string16::npos).size()); |
| + ASCIIToUTF16("brokeandalone"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches).size()); |
| // Make up an URL that does not qualify and try to add it. |
| URLRow unqualified_row(GURL("http://www.brokeandaloneinmanitoba.com/"), |
| @@ -844,13 +908,17 @@ TEST_F(InMemoryURLIndexTest, AddNewRows) { |
| TEST_F(InMemoryURLIndexTest, DeleteRows) { |
| ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("DrudgeReport"), base::string16::npos); |
| + ASCIIToUTF16("DrudgeReport"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| // Delete the URL then search again. |
| EXPECT_TRUE(DeleteURL(matches[0].url_info.url())); |
| EXPECT_TRUE(url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("DrudgeReport"), base::string16::npos).empty()); |
| + ASCIIToUTF16("DrudgeReport"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches).empty()); |
| // Make up an URL that does not exist in the database and delete it. |
| GURL url("http://www.hokeypokey.com/putyourrightfootin.html"); |
| @@ -859,7 +927,9 @@ TEST_F(InMemoryURLIndexTest, DeleteRows) { |
| TEST_F(InMemoryURLIndexTest, ExpireRow) { |
| ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("DrudgeReport"), base::string16::npos); |
| + ASCIIToUTF16("DrudgeReport"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches); |
| ASSERT_EQ(1U, matches.size()); |
| // Determine the row id for the result, remember that id, broadcast a |
| @@ -871,7 +941,9 @@ TEST_F(InMemoryURLIndexTest, ExpireRow) { |
| content::Source<InMemoryURLIndexTest>(this), |
| content::Details<history::HistoryDetails>(&deleted_details)); |
| EXPECT_TRUE(url_index_->HistoryItemsForTerms( |
| - ASCIIToUTF16("DrudgeReport"), base::string16::npos).empty()); |
| + ASCIIToUTF16("DrudgeReport"), |
| + base::string16::npos, |
| + AutocompleteProvider::kMaxMatches).empty()); |
| } |
| TEST_F(InMemoryURLIndexTest, WhitelistedURLs) { |