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

Unified Diff: chrome/browser/download/notification/download_notification_item_unittest.cc

Issue 1159363002: [Download Notification] Show preview if downloaded file is image (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments #41 Created 5 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: chrome/browser/download/notification/download_notification_item_unittest.cc
diff --git a/chrome/browser/download/notification/download_notification_item_unittest.cc b/chrome/browser/download/notification/download_notification_item_unittest.cc
index 9939f14acad69814f08c3ec6e2ae896f9ddbce3c..cd799e8162fdbff4329b8b3635b2e312041f1211 100644
--- a/chrome/browser/download/notification/download_notification_item_unittest.cc
+++ b/chrome/browser/download/notification/download_notification_item_unittest.cc
@@ -22,6 +22,8 @@
using testing::NiceMock;
using testing::Return;
+using testing::ReturnRef;
Lei Zhang 2015/06/16 18:35:08 nit: no longer used
yoshiki 2015/06/18 10:48:04 Done.
+using testing::ReturnRefOfCopy;
using testing::_;
namespace {
@@ -67,6 +69,9 @@ class MockDownloadNotificationItemDelegate
size_t on_download_stopped_call_count_;
};
+const base::FilePath::CharType kDownloadItemTargetPathString[] =
+ FILE_PATH_LITERAL("/tmp/TITLE.bin");
+
} // anonymous namespace
namespace test {
@@ -90,6 +95,7 @@ class DownloadNotificationItemTest : public testing::Test {
DownloadNotificationItem::SetStubNotificationUIManagerForTesting(
ui_manager_.get());
+ base::FilePath download_item_target_path(kDownloadItemTargetPathString);
download_item_.reset(new NiceMock<content::MockDownloadItem>());
ON_CALL(*download_item_, GetId()).WillByDefault(Return(12345));
ON_CALL(*download_item_, GetState())
@@ -97,6 +103,8 @@ class DownloadNotificationItemTest : public testing::Test {
ON_CALL(*download_item_, IsDangerous()).WillByDefault(Return(false));
ON_CALL(*download_item_, GetFileNameToReportUser())
.WillByDefault(Return(base::FilePath("TITLE.bin")));
+ ON_CALL(*download_item_, GetTargetFilePath())
+ .WillByDefault(ReturnRefOfCopy(download_item_target_path));
ON_CALL(*download_item_, GetDangerType())
.WillByDefault(Return(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS));
ON_CALL(*download_item_, IsDone()).WillByDefault(Return(false));

Powered by Google App Engine
This is Rietveld 408576698