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

Unified Diff: content/browser/download/download_item_impl_unittest.cc

Issue 16994004: Remove DownloadItem::Is*() in favor of DI::GetState() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@di-getstate-2
Patch Set: Created 7 years, 6 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: content/browser/download/download_item_impl_unittest.cc
diff --git a/content/browser/download/download_item_impl_unittest.cc b/content/browser/download/download_item_impl_unittest.cc
index baa292801ead18bc84ee7169e3a53ff7443f9c30..4ec72afe72c11b69dbec72784f98ac8eef266fc0 100644
--- a/content/browser/download/download_item_impl_unittest.cc
+++ b/content/browser/download/download_item_impl_unittest.cc
@@ -764,7 +764,7 @@ TEST_F(DownloadItemTest, InterruptedBeforeIntermediateRename) {
AddDownloadFileToDownloadItem(item, &callback);
item->DestinationObserverAsWeakPtr()->DestinationError(
DOWNLOAD_INTERRUPT_REASON_FILE_FAILED);
- ASSERT_TRUE(item->IsInProgress());
+ ASSERT_EQ(DownloadItem::IN_PROGRESS, item->GetState());
base::FilePath final_path(base::FilePath(kDummyPath).AppendASCII("foo.bar"));
base::FilePath intermediate_path(final_path.InsertBeforeExtensionASCII("x"));
@@ -782,7 +782,7 @@ TEST_F(DownloadItemTest, InterruptedBeforeIntermediateRename) {
// All the callbacks should have happened by now.
::testing::Mock::VerifyAndClearExpectations(download_file);
mock_delegate()->VerifyAndClearExpectations();
- EXPECT_TRUE(item->IsInterrupted());
+ EXPECT_EQ(DownloadItem::INTERRUPTED, item->GetState());
EXPECT_TRUE(item->GetFullPath().empty());
EXPECT_EQ(final_path, item->GetTargetFilePath());
}
@@ -891,7 +891,7 @@ TEST_F(DownloadItemTest, EnabledActionsForNormalDownload) {
DoIntermediateRename(item, DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS);
// InProgress
- ASSERT_TRUE(item->IsInProgress());
+ ASSERT_EQ(DownloadItem::IN_PROGRESS, item->GetState());
ASSERT_FALSE(item->GetTargetFilePath().empty());
EXPECT_TRUE(item->CanShowInFolder());
EXPECT_TRUE(item->CanOpenDownload());
@@ -908,7 +908,7 @@ TEST_F(DownloadItemTest, EnabledActionsForNormalDownload) {
item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string());
RunAllPendingInMessageLoops();
- ASSERT_TRUE(item->IsComplete());
+ ASSERT_EQ(DownloadItem::COMPLETE, item->GetState());
EXPECT_TRUE(item->CanShowInFolder());
EXPECT_TRUE(item->CanOpenDownload());
}
@@ -920,7 +920,7 @@ TEST_F(DownloadItemTest, EnabledActionsForTemporaryDownload) {
item->SetIsTemporary(true);
// InProgress Temporary
- ASSERT_TRUE(item->IsInProgress());
+ ASSERT_EQ(DownloadItem::IN_PROGRESS, item->GetState());
ASSERT_FALSE(item->GetTargetFilePath().empty());
ASSERT_TRUE(item->IsTemporary());
EXPECT_FALSE(item->CanShowInFolder());
@@ -938,7 +938,7 @@ TEST_F(DownloadItemTest, EnabledActionsForTemporaryDownload) {
item->DestinationObserverAsWeakPtr()->DestinationCompleted(std::string());
RunAllPendingInMessageLoops();
- ASSERT_TRUE(item->IsComplete());
+ ASSERT_EQ(DownloadItem::COMPLETE, item->GetState());
EXPECT_FALSE(item->CanShowInFolder());
EXPECT_FALSE(item->CanOpenDownload());
}
@@ -953,7 +953,7 @@ TEST_F(DownloadItemTest, EnabledActionsForInterruptedDownload) {
DOWNLOAD_INTERRUPT_REASON_FILE_FAILED);
RunAllPendingInMessageLoops();
- ASSERT_TRUE(item->IsInterrupted());
+ ASSERT_EQ(DownloadItem::INTERRUPTED, item->GetState());
ASSERT_FALSE(item->GetTargetFilePath().empty());
EXPECT_FALSE(item->CanShowInFolder());
EXPECT_FALSE(item->CanOpenDownload());
@@ -968,7 +968,7 @@ TEST_F(DownloadItemTest, EnabledActionsForCancelledDownload) {
item->Cancel(true);
RunAllPendingInMessageLoops();
- ASSERT_TRUE(item->IsCancelled());
+ ASSERT_EQ(DownloadItem::CANCELLED, item->GetState());
EXPECT_FALSE(item->CanShowInFolder());
EXPECT_FALSE(item->CanOpenDownload());
}

Powered by Google App Engine
This is Rietveld 408576698