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

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

Issue 10704026: Reland DownloadItem::Observer::OnDownloadDestroyed() replaces DownloadItem::REMOVING (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 5 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
Index: chrome/browser/history/history_unittest.cc
diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc
index a83c595eefac41ca2de2248ead7b8102edbe3e68..4bd2a71bcf5c4f218af1927a1beafee32da57886 100644
--- a/chrome/browser/history/history_unittest.cc
+++ b/chrome/browser/history/history_unittest.cc
@@ -323,7 +323,7 @@ TEST_F(HistoryTest, ClearBrowsingData_Downloads) {
EXPECT_EQ(0U, downloads.size());
// Keep track of these as we need to update them later during the test.
- DownloadID in_progress, removing;
+ DownloadID in_progress;
// Create one with a 0 time.
EXPECT_NE(0, AddDownload(DownloadItem::COMPLETE, Time()));
@@ -336,23 +336,22 @@ TEST_F(HistoryTest, ClearBrowsingData_Downloads) {
EXPECT_NE(0, in_progress = AddDownload(DownloadItem::IN_PROGRESS, month_ago));
EXPECT_NE(0, AddDownload(DownloadItem::CANCELLED, month_ago));
EXPECT_NE(0, AddDownload(DownloadItem::INTERRUPTED, month_ago));
- EXPECT_NE(0, removing = AddDownload(DownloadItem::REMOVING, month_ago));
// Test to see if inserts worked.
db_->QueryDownloads(&downloads);
- EXPECT_EQ(9U, downloads.size());
+ EXPECT_EQ(8U, downloads.size());
// Try removing from current timestamp. This should delete the one in the
// future and one very recent one.
db_->RemoveDownloadsBetween(now, Time());
db_->QueryDownloads(&downloads);
- EXPECT_EQ(7U, downloads.size());
+ EXPECT_EQ(6U, downloads.size());
// Try removing from two months ago. This should not delete items that are
// 'in progress' or in 'removing' state.
db_->RemoveDownloadsBetween(now - TimeDelta::FromDays(60), Time());
db_->QueryDownloads(&downloads);
- EXPECT_EQ(3U, downloads.size());
+ EXPECT_EQ(2U, downloads.size());
// Download manager converts to TimeT, which is lossy, so we do the same
// for comparison.
@@ -364,7 +363,6 @@ TEST_F(HistoryTest, ClearBrowsingData_Downloads) {
EXPECT_EQ(DownloadItem::IN_PROGRESS, downloads[1].state);
EXPECT_EQ(month_ago_lossy.ToInternalValue(),
downloads[1].start_time.ToInternalValue());
- EXPECT_EQ(DownloadItem::REMOVING, downloads[2].state);
EXPECT_EQ(month_ago_lossy.ToInternalValue(),
downloads[2].start_time.ToInternalValue());
@@ -377,7 +375,6 @@ TEST_F(HistoryTest, ClearBrowsingData_Downloads) {
data.db_handle = in_progress;
EXPECT_TRUE(db_->UpdateDownload(data));
data.state = DownloadItem::CANCELLED;
- data.db_handle = removing;
EXPECT_TRUE(db_->UpdateDownload(data));
// Try removing from Time=0. This should delete all.

Powered by Google App Engine
This is Rietveld 408576698