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

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: CamelCase 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 85edae9c42a7d7f08a555eaef4b632ca01454405..7c1c5f7d2330f43adf7dde060c3b07e27c2cd62a 100644
--- a/chrome/browser/download/download_item_unittest.cc
+++ b/chrome/browser/download/download_item_unittest.cc
@@ -10,6 +10,7 @@
#include "content/browser/download/download_item.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 +192,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.is_dangerous_file = false;
state.is_dangerous_url = false;
safe_item->SetFileCheckResults(state);
@@ -201,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.is_dangerous_file = false;
state.is_dangerous_url = true;
unsafeurl_item->SetFileCheckResults(state);
@@ -213,7 +214,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.is_dangerous_file = true;
state.is_dangerous_url = false;
unsafefile_item->SetFileCheckResults(state);
@@ -251,3 +252,7 @@ TEST_F(DownloadItemTest, NotificationAfterTogglePause) {
item->TogglePause();
ASSERT_TRUE(observer.CheckUpdated());
}
+
+TEST(MockDownloadItem, Compiles) {
cbentzel 2011/11/16 12:28:44 Do you want to remove this test?
benjhayden 2011/11/18 18:59:34 No, because it ensures that MockDownloadItem doesn
+ MockDownloadItem mock_item;
+}

Powered by Google App Engine
This is Rietveld 408576698