Chromium Code Reviews| Index: components/omnibox/browser/in_memory_url_index_unittest.cc |
| diff --git a/components/omnibox/browser/in_memory_url_index_unittest.cc b/components/omnibox/browser/in_memory_url_index_unittest.cc |
| index 36320e9f4be919aad4127857153b9921ef33c7bf..25687e798683252c2a698c0eb786bb1ded633f37 100644 |
| --- a/components/omnibox/browser/in_memory_url_index_unittest.cc |
| +++ b/components/omnibox/browser/in_memory_url_index_unittest.cc |
| @@ -482,6 +482,20 @@ TEST_F(LimitedInMemoryURLIndexTest, Initialization) { |
| EXPECT_EQ(17U, private_data.word_map_.size()); |
| } |
| +TEST_F(InMemoryURLIndexTest, HiddenURLRowsAreIgnored) { |
| + history::URLID new_row_id = 87654321; // Arbitrarily chosen large new row id. |
| + history::URLRow new_row = |
| + history::URLRow(GURL("http://hidden.com/"), new_row_id++); |
| + new_row.set_last_visit(base::Time::Now()); |
| + new_row.set_hidden(true); |
| + |
| + EXPECT_FALSE(UpdateURL(new_row)); |
| + EXPECT_EQ(0U, url_index_ |
|
Peter Kasting
2017/05/04 19:17:36
Nit: EXPECT_TRUE(...empty())?
tommycli
2017/05/08 15:44:45
Well... I didn't do that because everywhere else i
|
| + ->HistoryItemsForTerms(ASCIIToUTF16("hidden"), |
| + base::string16::npos, kMaxMatches) |
| + .size()); |
| +} |
| + |
| TEST_F(InMemoryURLIndexTest, Retrieval) { |
| // See if a very specific term gives a single result. |
| ScoredHistoryMatches matches = url_index_->HistoryItemsForTerms( |