Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 // There should be no visits. | 326 // There should be no visits. |
| 327 VisitVector visits; | 327 VisitVector visits; |
| 328 main_db_->GetVisitsForURL(row.id(), &visits); | 328 main_db_->GetVisitsForURL(row.id(), &visits); |
| 329 EXPECT_EQ(0U, visits.size()); | 329 EXPECT_EQ(0U, visits.size()); |
| 330 | 330 |
| 331 // Thumbnail should be gone. | 331 // Thumbnail should be gone. |
| 332 // TODO(sky): fix this, see comment in HasThumbnail. | 332 // TODO(sky): fix this, see comment in HasThumbnail. |
| 333 // EXPECT_FALSE(HasThumbnail(row.id())); | 333 // EXPECT_FALSE(HasThumbnail(row.id())); |
| 334 | 334 |
| 335 bool found_delete_notification = false; | 335 bool found_delete_notification = false; |
| 336 for (const std::pair<bool, URLRows>& pair : urls_deleted_notifications_) { | 336 for (const URLsDeletedNotificationList::value_type& pair : |
|
sdefresne
2015/01/14 10:47:08
nit: I slightly prefer const auto& here.
vmpstr
2015/01/14 17:32:16
Done.
| |
| 337 urls_deleted_notifications_) { | |
| 337 EXPECT_EQ(expired, pair.first); | 338 EXPECT_EQ(expired, pair.first); |
| 338 const history::URLRows& rows(pair.second); | 339 const history::URLRows& rows(pair.second); |
| 339 history::URLRows::const_iterator it_row = std::find_if( | 340 history::URLRows::const_iterator it_row = std::find_if( |
| 340 rows.begin(), rows.end(), history::URLRow::URLRowHasURL(row.url())); | 341 rows.begin(), rows.end(), history::URLRow::URLRowHasURL(row.url())); |
| 341 if (it_row != rows.end()) { | 342 if (it_row != rows.end()) { |
| 342 // Further verify that the ID is set to what had been in effect in the | 343 // Further verify that the ID is set to what had been in effect in the |
| 343 // main database before the deletion. The InMemoryHistoryBackend relies | 344 // main database before the deletion. The InMemoryHistoryBackend relies |
| 344 // on this to delete its cached copy of the row. | 345 // on this to delete its cached copy of the row. |
| 345 EXPECT_EQ(row.id(), it_row->id()); | 346 EXPECT_EQ(row.id(), it_row->id()); |
| 346 found_delete_notification = true; | 347 found_delete_notification = true; |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 874 EXPECT_TRUE(all->Read(now, main_db_.get(), &visits, 1)); | 875 EXPECT_TRUE(all->Read(now, main_db_.get(), &visits, 1)); |
| 875 EXPECT_EQ(1U, visits.size()); | 876 EXPECT_EQ(1U, visits.size()); |
| 876 } | 877 } |
| 877 | 878 |
| 878 // TODO(brettw) add some visits with no URL to make sure everything is updated | 879 // TODO(brettw) add some visits with no URL to make sure everything is updated |
| 879 // properly. Have the visits also refer to nonexistent FTS rows. | 880 // properly. Have the visits also refer to nonexistent FTS rows. |
| 880 // | 881 // |
| 881 // Maybe also refer to invalid favicons. | 882 // Maybe also refer to invalid favicons. |
| 882 | 883 |
| 883 } // namespace history | 884 } // namespace history |
| OLD | NEW |