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

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

Issue 2221113003: Revert of Refactor download image-MIME-type-detection code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/download_item_model_unittest.cc
diff --git a/chrome/browser/download/download_item_model_unittest.cc b/chrome/browser/download/download_item_model_unittest.cc
index 7325f00b07b25ae4eba581f975e7309a26d9b690..dfb07feff443ef48d4b1f11afa0a28ef4cd563c8 100644
--- a/chrome/browser/download/download_item_model_unittest.cc
+++ b/chrome/browser/download/download_item_model_unittest.cc
@@ -30,7 +30,6 @@
using ::testing::Mock;
using ::testing::NiceMock;
using ::testing::Return;
-using ::testing::ReturnRef;
using ::testing::ReturnRefOfCopy;
using ::testing::SetArgPointee;
using ::testing::_;
@@ -383,33 +382,6 @@
EXPECT_EQ(DownloadFileType::ALLOW_ON_USER_GESTURE, model().GetDangerLevel());
}
-TEST_F(DownloadItemModelTest, HasSupportedImageMimeType) {
- SetupDownloadItemDefaults();
-
- // When the item has a supported image MIME type, true should be returned.
- ON_CALL(item(), GetMimeType()).WillByDefault(Return("image/png"));
- EXPECT_TRUE(model().HasSupportedImageMimeType());
-
- // An unsupported MIME type should result in false being returned...
- ON_CALL(item(), GetMimeType()).WillByDefault(Return("image/unsupported"));
- EXPECT_FALSE(model().HasSupportedImageMimeType());
-
- // ... unless the target path has a well-known image extension.
- const base::FilePath kImagePath(FILE_PATH_LITERAL("/foo/image.png"));
- ON_CALL(item(), GetTargetFilePath()).WillByDefault(ReturnRef(kImagePath));
- EXPECT_TRUE(model().HasSupportedImageMimeType());
-
- // .txt and missing extensions should also result in false being returned.
- const base::FilePath kTextPath(FILE_PATH_LITERAL("/foo/image.txt"));
- ON_CALL(item(), GetTargetFilePath()).WillByDefault(ReturnRef(kTextPath));
- EXPECT_FALSE(model().HasSupportedImageMimeType());
-
- const base::FilePath kNoExtensionPath(FILE_PATH_LITERAL("/foo/image."));
- ON_CALL(item(), GetTargetFilePath())
- .WillByDefault(ReturnRef(kNoExtensionPath));
- EXPECT_FALSE(model().HasSupportedImageMimeType());
-}
-
TEST_F(DownloadItemModelTest, ShouldRemoveFromShelfWhenComplete) {
const struct TestCase {
DownloadItem::DownloadState state;
« no previous file with comments | « chrome/browser/download/download_item_model.cc ('k') | chrome/browser/download/notification/download_item_notification.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698