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

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

Issue 341087: Eliminate QueryOptions::most_recent_visit_only. All non-unittest consumers o... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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 | « chrome/browser/history/history_backend_unittest.cc ('k') | chrome/browser/history/history_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_querying_unittest.cc
===================================================================
--- chrome/browser/history/history_querying_unittest.cc (revision 30836)
+++ chrome/browser/history/history_querying_unittest.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -149,15 +149,13 @@
QueryOptions options;
QueryResults results;
- // First query for all of them to make sure they are there and in
- // chronological order, most recent first.
+ // Test duplicate collapsing.
QueryHistory(std::wstring(), options, &results);
- ASSERT_EQ(5U, results.size());
+ EXPECT_EQ(4U, results.size());
EXPECT_TRUE(NthResultIs(results, 0, 4));
EXPECT_TRUE(NthResultIs(results, 1, 2));
EXPECT_TRUE(NthResultIs(results, 2, 3));
EXPECT_TRUE(NthResultIs(results, 3, 1));
- EXPECT_TRUE(NthResultIs(results, 4, 0));
// Next query a time range. The beginning should be inclusive, the ending
// should be exclusive.
@@ -184,24 +182,6 @@
EXPECT_TRUE(NthResultIs(results, 1, 2));
}
-// Tests duplicate collapsing and not in non-Full Text Search situations.
-TEST_F(HistoryQueryTest, BasicDupes) {
- ASSERT_TRUE(history_.get());
-
- QueryOptions options;
- QueryResults results;
-
- // We did the query for no collapsing in the "Basic" test above, so here we
- // only test collapsing.
- options.most_recent_visit_only = true;
- QueryHistory(std::wstring(), options, &results);
- EXPECT_EQ(4U, results.size());
- EXPECT_TRUE(NthResultIs(results, 0, 4));
- EXPECT_TRUE(NthResultIs(results, 1, 2));
- EXPECT_TRUE(NthResultIs(results, 2, 3));
- EXPECT_TRUE(NthResultIs(results, 3, 1));
-}
-
TEST_F(HistoryQueryTest, ReachedBeginning) {
ASSERT_TRUE(history_.get());
@@ -359,15 +339,7 @@
QueryOptions options;
QueryResults results;
- // First do the search with collapsing.
QueryHistory(std::wstring(L"Other"), options, &results);
- EXPECT_EQ(2, results.urls().size());
- EXPECT_TRUE(NthResultIs(results, 0, 4));
- EXPECT_TRUE(NthResultIs(results, 1, 0));
-
- // Now with collapsing.
- options.most_recent_visit_only = true;
- QueryHistory(std::wstring(L"Other"), options, &results);
EXPECT_EQ(1, results.urls().size());
EXPECT_TRUE(NthResultIs(results, 0, 4));
}
« no previous file with comments | « chrome/browser/history/history_backend_unittest.cc ('k') | chrome/browser/history/history_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698