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

Unified Diff: chrome/browser/download/download_item_unittest.cc

Issue 8503018: Split DownloadItem into an ABC, an Impl, and a Mock. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: merge Created 9 years, 1 month 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/download/download_item_unittest.cc
diff --git a/chrome/browser/download/download_item_unittest.cc b/chrome/browser/download/download_item_unittest.cc
index 1a0a4f0b793f10d8b7415379c5d3d532a932bb90..86d7aaafc88c4ab0152f3b687a260ed552fca17b 100644
--- a/chrome/browser/download/download_item_unittest.cc
+++ b/chrome/browser/download/download_item_unittest.cc
@@ -8,8 +8,10 @@
#include "content/browser/download/download_id.h"
#include "content/browser/download/download_id_factory.h"
#include "content/browser/download/download_item.h"
+#include "content/browser/download/download_request_handle.h"
#include "content/browser/download/download_status_updater.h"
#include "content/browser/download/interrupt_reasons.h"
+#include "content/browser/download/mock_download_item.h"
#include "content/browser/download/mock_download_manager.h"
#include "content/browser/download/mock_download_manager_delegate.h"
#include "content/test/test_browser_thread.h"
@@ -191,7 +193,7 @@ TEST_F(DownloadItemTest, NotificationAfterSetFileCheckResults) {
DownloadItem* safe_item = CreateDownloadItem(DownloadItem::IN_PROGRESS);
MockObserver safe_observer(safe_item);
- DownloadStateInfo state = safe_item->state_info();;
+ DownloadStateInfo state = safe_item->GetStateInfo();;
state.danger = DownloadStateInfo::NOT_DANGEROUS;
safe_item->SetFileCheckResults(state);
ASSERT_FALSE(safe_observer.CheckUpdated());
@@ -200,7 +202,7 @@ TEST_F(DownloadItemTest, NotificationAfterSetFileCheckResults) {
DownloadItem* unsafeurl_item = CreateDownloadItem(DownloadItem::IN_PROGRESS);
MockObserver unsafeurl_observer(unsafeurl_item);
- state = unsafeurl_item->state_info();;
+ state = unsafeurl_item->GetStateInfo();;
state.danger = DownloadStateInfo::DANGEROUS_URL;
unsafeurl_item->SetFileCheckResults(state);
ASSERT_TRUE(unsafeurl_observer.CheckUpdated());
@@ -211,7 +213,7 @@ TEST_F(DownloadItemTest, NotificationAfterSetFileCheckResults) {
DownloadItem* unsafefile_item = CreateDownloadItem(DownloadItem::IN_PROGRESS);
MockObserver unsafefile_observer(unsafefile_item);
- state = unsafefile_item->state_info();;
+ state = unsafefile_item->GetStateInfo();;
state.danger = DownloadStateInfo::DANGEROUS_FILE;
unsafefile_item->SetFileCheckResults(state);
ASSERT_TRUE(unsafefile_observer.CheckUpdated());
@@ -248,3 +250,7 @@ TEST_F(DownloadItemTest, NotificationAfterTogglePause) {
item->TogglePause();
ASSERT_TRUE(observer.CheckUpdated());
}
+
+TEST(MockDownloadItem, Compiles) {
+ MockDownloadItem mock_item;
+}
« no previous file with comments | « chrome/browser/download/download_item_model.cc ('k') | chrome/browser/download/download_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698