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

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

Issue 10735089: DownloadManager::Observer::OnDownloadCreated (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 cbc583852176f42d7d48e7e7ea50d7732b604998..fb6d5f89a9f9254f5ed0eef062d840f9e9cbdbdc 100644
--- a/content/browser/download/download_item_impl_unittest.cc
+++ b/content/browser/download/download_item_impl_unittest.cc
@@ -299,12 +299,12 @@ TEST_F(DownloadItemTest, NotificationAfterOnTargetPathDetermined) {
DownloadItemImpl* safe_item = CreateDownloadItem(DownloadItem::IN_PROGRESS);
MockObserver safe_observer(safe_item);
- // Calling OnTargetPathDetermined does not trigger notification if danger type
- // is NOT_DANGEROUS.
+ // Calling OnTargetPathDetermined triggers notification regardless of danger
+ // type.
safe_item->OnTargetPathDetermined(
FilePath(kDummyPath), DownloadItem::TARGET_DISPOSITION_OVERWRITE,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS);
- EXPECT_FALSE(safe_observer.CheckUpdated());
+ EXPECT_TRUE(safe_observer.CheckUpdated());
DownloadItemImpl* dangerous_item =
CreateDownloadItem(DownloadItem::IN_PROGRESS);
@@ -326,7 +326,7 @@ TEST_F(DownloadItemTest, NotificationAfterOnTargetPathSelected) {
FilePath(kDummyPath), DownloadItem::TARGET_DISPOSITION_PROMPT,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS);
item->OnTargetPathSelected(FilePath(kDummyPath));
- EXPECT_FALSE(observer.CheckUpdated());
+ EXPECT_TRUE(observer.CheckUpdated());
}
TEST_F(DownloadItemTest, NotificationAfterOnContentCheckCompleted) {
@@ -337,7 +337,7 @@ TEST_F(DownloadItemTest, NotificationAfterOnContentCheckCompleted) {
safe_item->OnTargetPathDetermined(
FilePath(kDummyPath), DownloadItem::TARGET_DISPOSITION_OVERWRITE,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS);
- EXPECT_FALSE(safe_observer.CheckUpdated());
+ EXPECT_TRUE(safe_observer.CheckUpdated());
safe_item->OnAllDataSaved(1, "");
EXPECT_TRUE(safe_observer.CheckUpdated());
safe_item->OnContentCheckCompleted(
@@ -352,7 +352,7 @@ TEST_F(DownloadItemTest, NotificationAfterOnContentCheckCompleted) {
unsafeurl_item->OnTargetPathDetermined(
FilePath(kDummyPath), DownloadItem::TARGET_DISPOSITION_OVERWRITE,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS);
- EXPECT_FALSE(unsafeurl_observer.CheckUpdated());
+ EXPECT_TRUE(unsafeurl_observer.CheckUpdated());
unsafeurl_item->OnAllDataSaved(1, "");
EXPECT_TRUE(unsafeurl_observer.CheckUpdated());
unsafeurl_item->OnContentCheckCompleted(
@@ -369,7 +369,7 @@ TEST_F(DownloadItemTest, NotificationAfterOnContentCheckCompleted) {
unsafefile_item->OnTargetPathDetermined(
FilePath(kDummyPath), DownloadItem::TARGET_DISPOSITION_OVERWRITE,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS);
- EXPECT_FALSE(unsafefile_observer.CheckUpdated());
+ EXPECT_TRUE(unsafefile_observer.CheckUpdated());
unsafefile_item->OnAllDataSaved(1, "");
EXPECT_TRUE(unsafefile_observer.CheckUpdated());
unsafefile_item->OnContentCheckCompleted(

Powered by Google App Engine
This is Rietveld 408576698