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

Unified Diff: chrome/browser/history/history_querying_unittest.cc

Issue 43054: Stop history search going on beyond the start of history.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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
Index: chrome/browser/history/history_querying_unittest.cc
===================================================================
--- chrome/browser/history/history_querying_unittest.cc (revision 11260)
+++ chrome/browser/history/history_querying_unittest.cc (working copy)
@@ -199,6 +199,32 @@
EXPECT_TRUE(NthResultIs(results, 3, 1));
}
+TEST_F(HistoryQueryTest, ReachedBeginning) {
+ ASSERT_TRUE(history_.get());
+
+ QueryOptions options;
+ QueryResults results;
+
+ QueryHistory(std::wstring(), options, &results);
+ EXPECT_TRUE(results.reached_beginning());
+
+ options.begin_time = test_entries[1].time;
+ QueryHistory(std::wstring(), options, &results);
+ EXPECT_FALSE(results.reached_beginning());
+
+ options.begin_time = test_entries[0].time + TimeDelta::FromMicroseconds(1);
+ QueryHistory(std::wstring(), options, &results);
+ EXPECT_FALSE(results.reached_beginning());
+
+ options.begin_time = test_entries[0].time;
+ QueryHistory(std::wstring(), options, &results);
+ EXPECT_TRUE(results.reached_beginning());
+
+ options.begin_time = test_entries[0].time - TimeDelta::FromMicroseconds(1);
+ QueryHistory(std::wstring(), options, &results);
+ EXPECT_TRUE(results.reached_beginning());
+}
+
// This does most of the same tests above, but searches for a FTS string that
// will match the pages in question. This will trigger a different code path.
TEST_F(HistoryQueryTest, FTS) {

Powered by Google App Engine
This is Rietveld 408576698