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

Unified Diff: components/omnibox/browser/in_memory_url_index_unittest.cc

Issue 2846673006: Omnibox: Make InMemoryURLIndex respect hidden URLRows (Closed)
Patch Set: address mpearson comments Created 3 years, 8 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/history/core/browser/url_database.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « components/history/core/browser/url_database.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698