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

Side by Side Diff: chrome/browser/history/expire_history_backend_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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "app/gfx/codec/jpeg_codec.h" 5 #include "app/gfx/codec/jpeg_codec.h"
6 #include "base/basictypes.h" 6 #include "base/basictypes.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 267
268 bool ExpireHistoryTest::HasThumbnail(URLID url_id) { 268 bool ExpireHistoryTest::HasThumbnail(URLID url_id) {
269 std::vector<unsigned char> temp_data; 269 std::vector<unsigned char> temp_data;
270 return thumb_db_->GetPageThumbnail(url_id, &temp_data); 270 return thumb_db_->GetPageThumbnail(url_id, &temp_data);
271 } 271 }
272 272
273 int ExpireHistoryTest::CountTextMatchesForURL(const GURL& url) { 273 int ExpireHistoryTest::CountTextMatchesForURL(const GURL& url) {
274 if (!text_db_.get()) 274 if (!text_db_.get())
275 return 0; 275 return 0;
276 276
277 // "body" should match all pagesx in the example data. 277 // "body" should match all pages in the example data.
278 std::vector<TextDatabase::Match> results; 278 std::vector<TextDatabase::Match> results;
279 QueryOptions options; 279 QueryOptions options;
280 options.most_recent_visit_only = false;
281 Time first_time; 280 Time first_time;
282 text_db_->GetTextMatches(L"body", options, &results, &first_time); 281 text_db_->GetTextMatches(L"body", options, &results, &first_time);
283 282
284 int count = 0; 283 int count = 0;
285 for (size_t i = 0; i < results.size(); i++) { 284 for (size_t i = 0; i < results.size(); i++) {
286 if (results[i].url == url) 285 if (results[i].url == url)
287 count++; 286 count++;
288 } 287 }
289 return count; 288 return count;
290 } 289 }
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 EXPECT_TRUE(all->Read(now, main_db_.get(), &visits, 1)); 738 EXPECT_TRUE(all->Read(now, main_db_.get(), &visits, 1));
740 EXPECT_EQ(1U, visits.size()); 739 EXPECT_EQ(1U, visits.size());
741 } 740 }
742 741
743 // TODO(brettw) add some visits with no URL to make sure everything is updated 742 // TODO(brettw) add some visits with no URL to make sure everything is updated
744 // properly. Have the visits also refer to nonexistant FTS rows. 743 // properly. Have the visits also refer to nonexistant FTS rows.
745 // 744 //
746 // Maybe also refer to invalid favicons. 745 // Maybe also refer to invalid favicons.
747 746
748 } // namespace history 747 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_history_api.cc ('k') | chrome/browser/history/history_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698