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

Side by Side Diff: chrome/browser/history/expire_history_backend_unittest.cc

Issue 10031028: Single URL Expires Were Not Being Deleted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/expire_history_backend.cc ('k') | chrome/browser/history/history.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <algorithm>
5 #include <string> 6 #include <string>
6 #include <utility> 7 #include <utility>
7 8
8 #include "base/basictypes.h" 9 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
10 #include "base/file_path.h" 11 #include "base/file_path.h"
11 #include "base/file_util.h" 12 #include "base/file_util.h"
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
13 #include "base/path_service.h" 14 #include "base/path_service.h"
14 #include "base/scoped_temp_dir.h" 15 #include "base/scoped_temp_dir.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 main_db_->GetVisitsForURL(row.id(), &visits); 375 main_db_->GetVisitsForURL(row.id(), &visits);
375 EXPECT_EQ(0U, visits.size()); 376 EXPECT_EQ(0U, visits.size());
376 377
377 // Thumbnail should be gone. 378 // Thumbnail should be gone.
378 // TODO(sky): fix this, see comment in HasThumbnail. 379 // TODO(sky): fix this, see comment in HasThumbnail.
379 // EXPECT_FALSE(HasThumbnail(row.id())); 380 // EXPECT_FALSE(HasThumbnail(row.id()));
380 381
381 bool found_delete_notification = false; 382 bool found_delete_notification = false;
382 for (size_t i = 0; i < notifications_.size(); i++) { 383 for (size_t i = 0; i < notifications_.size(); i++) {
383 if (notifications_[i].first == chrome::NOTIFICATION_HISTORY_URLS_DELETED) { 384 if (notifications_[i].first == chrome::NOTIFICATION_HISTORY_URLS_DELETED) {
384 const URLsDeletedDetails* deleted_details = 385 const history::URLRows& rows(reinterpret_cast<URLsDeletedDetails*>(
385 reinterpret_cast<URLsDeletedDetails*>(notifications_[i].second); 386 notifications_[i].second)->rows);
386 if (deleted_details->urls.find(row.url()) != 387 if (std::find_if(rows.begin(), rows.end(),
387 deleted_details->urls.end()) { 388 history::URLRow::URLRowHasURL(row.url())) != rows.end()) {
388 found_delete_notification = true; 389 found_delete_notification = true;
389 } 390 }
390 } else { 391 } else {
391 EXPECT_NE(notifications_[i].first, 392 EXPECT_NE(notifications_[i].first,
392 chrome::NOTIFICATION_HISTORY_URL_VISITED); 393 chrome::NOTIFICATION_HISTORY_URL_VISITED);
393 EXPECT_NE(notifications_[i].first, 394 EXPECT_NE(notifications_[i].first,
394 chrome::NOTIFICATION_HISTORY_URLS_MODIFIED); 395 chrome::NOTIFICATION_HISTORY_URLS_MODIFIED);
395 } 396 }
396 } 397 }
397 EXPECT_TRUE(found_delete_notification); 398 EXPECT_TRUE(found_delete_notification);
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 main_db_->GetVisitsForURL(url_id, &archived_visits); 953 main_db_->GetVisitsForURL(url_id, &archived_visits);
953 EXPECT_EQ(0U, archived_visits.size()); 954 EXPECT_EQ(0U, archived_visits.size());
954 } 955 }
955 956
956 // TODO(brettw) add some visits with no URL to make sure everything is updated 957 // TODO(brettw) add some visits with no URL to make sure everything is updated
957 // properly. Have the visits also refer to nonexistent FTS rows. 958 // properly. Have the visits also refer to nonexistent FTS rows.
958 // 959 //
959 // Maybe also refer to invalid favicons. 960 // Maybe also refer to invalid favicons.
960 961
961 } // namespace history 962 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/expire_history_backend.cc ('k') | chrome/browser/history/history.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698