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

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

Issue 1005783003: Fix ThumbnailDatabase::RetainDataForPageUrls() to drop unretained page mappings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/history/core/browser/thumbnail_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/thumbnail_database_unittest.cc
diff --git a/chrome/browser/history/thumbnail_database_unittest.cc b/chrome/browser/history/thumbnail_database_unittest.cc
index 0b2c6ab9bd06463515e6698613766555b8b47540..04b9a5a1266c07bcced327045856cad5d1989018 100644
--- a/chrome/browser/history/thumbnail_database_unittest.cc
+++ b/chrome/browser/history/thumbnail_database_unittest.cc
@@ -306,10 +306,15 @@ TEST_F(ThumbnailDatabaseTest, RetainDataForPageUrls) {
db.BeginTransaction();
- // Build a database mapping kPageUrl1 -> kIconUrl1, kPageUrl2 ->
- // kIconUrl2, kPageUrl3 -> kIconUrl1, and kPageUrl5 -> kIconUrl5.
- // Then retain kPageUrl1, kPageUrl3, and kPageUrl5. kPageUrl2
- // should go away, but the others should be retained correctly.
+ // Build a database mapping
+ // kPageUrl1 -> kIconUrl1
+ // kPageUrl2 -> kIconUrl2
+ // kPageUrl3 -> kIconUrl1
+ // kPageUrl4 -> kIconUrl1
+ // kPageUrl5 -> kIconUrl5
+ // Then retain kPageUrl1, kPageUrl3, and kPageUrl5. kPageUrl2
+ // and kPageUrl4 should go away, but the others should be retained
+ // correctly.
// TODO(shess): This would probably make sense as a golden file.
@@ -323,6 +328,7 @@ TEST_F(ThumbnailDatabaseTest, RetainDataForPageUrls) {
db.AddFaviconBitmap(kept_id1, favicon1, base::Time::Now(), kLargeSize);
db.AddIconMapping(kPageUrl1, kept_id1);
db.AddIconMapping(kPageUrl3, kept_id1);
+ db.AddIconMapping(kPageUrl4, kept_id1);
favicon_base::FaviconID unkept_id =
db.AddFavicon(kIconUrl2, favicon_base::FAVICON);
@@ -367,8 +373,9 @@ TEST_F(ThumbnailDatabaseTest, RetainDataForPageUrls) {
sizeof(kBlob2),
kBlob2));
- // The one not retained should be missing.
+ // The ones not retained should be missing.
EXPECT_FALSE(db.GetFaviconIDForFaviconURL(kPageUrl2, false, NULL));
+ EXPECT_FALSE(db.GetFaviconIDForFaviconURL(kPageUrl4, false, NULL));
// Schema should be the same.
EXPECT_EQ(original_schema, db.db_.GetSchema());
« no previous file with comments | « no previous file | components/history/core/browser/thumbnail_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698