| 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 <string> | 5 #include <string> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 const URLsDeletedDetails* deleted_details = | 384 const URLsDeletedDetails* deleted_details = |
| 385 reinterpret_cast<URLsDeletedDetails*>(notifications_[i].second); | 385 reinterpret_cast<URLsDeletedDetails*>(notifications_[i].second); |
| 386 if (deleted_details->urls.find(row.url()) != | 386 if (deleted_details->urls.find(row.url()) != |
| 387 deleted_details->urls.end()) { | 387 deleted_details->urls.end()) { |
| 388 found_delete_notification = true; | 388 found_delete_notification = true; |
| 389 } | 389 } |
| 390 } else { | 390 } else { |
| 391 EXPECT_NE(notifications_[i].first, | 391 EXPECT_NE(notifications_[i].first, |
| 392 chrome::NOTIFICATION_HISTORY_URL_VISITED); | 392 chrome::NOTIFICATION_HISTORY_URL_VISITED); |
| 393 EXPECT_NE(notifications_[i].first, | 393 EXPECT_NE(notifications_[i].first, |
| 394 chrome::NOTIFICATION_HISTORY_TYPED_URLS_MODIFIED); | 394 chrome::NOTIFICATION_HISTORY_URLS_MODIFIED); |
| 395 } | 395 } |
| 396 } | 396 } |
| 397 EXPECT_TRUE(found_delete_notification); | 397 EXPECT_TRUE(found_delete_notification); |
| 398 } | 398 } |
| 399 | 399 |
| 400 TEST_F(ExpireHistoryTest, DeleteFaviconsIfPossible) { | 400 TEST_F(ExpireHistoryTest, DeleteFaviconsIfPossible) { |
| 401 // Add a favicon record. | 401 // Add a favicon record. |
| 402 const GURL favicon_url("http://www.google.com/favicon.ico"); | 402 const GURL favicon_url("http://www.google.com/favicon.ico"); |
| 403 FaviconID icon_id = thumb_db_->AddFavicon(favicon_url, FAVICON); | 403 FaviconID icon_id = thumb_db_->AddFavicon(favicon_url, FAVICON); |
| 404 EXPECT_TRUE(icon_id); | 404 EXPECT_TRUE(icon_id); |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 main_db_->GetVisitsForURL(url_id, &archived_visits); | 952 main_db_->GetVisitsForURL(url_id, &archived_visits); |
| 953 EXPECT_EQ(0U, archived_visits.size()); | 953 EXPECT_EQ(0U, archived_visits.size()); |
| 954 } | 954 } |
| 955 | 955 |
| 956 // TODO(brettw) add some visits with no URL to make sure everything is updated | 956 // 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. | 957 // properly. Have the visits also refer to nonexistent FTS rows. |
| 958 // | 958 // |
| 959 // Maybe also refer to invalid favicons. | 959 // Maybe also refer to invalid favicons. |
| 960 | 960 |
| 961 } // namespace history | 961 } // namespace history |
| OLD | NEW |