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

Unified Diff: chrome/browser/download/notification/download_notification_browsertest.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: rebase & use embedded server 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
« no previous file with comments | « no previous file | chrome/browser/download/notification/download_notification_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/notification/download_notification_browsertest.cc
diff --git a/chrome/browser/download/notification/download_notification_browsertest.cc b/chrome/browser/download/notification/download_notification_browsertest.cc
index 54176eb2b6fcc05917450afcfc6b81e0f373bf0c..1556bfdeed994ea511f242ebf75f65b22d9e8534 100644
--- a/chrome/browser/download/notification/download_notification_browsertest.cc
+++ b/chrome/browser/download/notification/download_notification_browsertest.cc
@@ -510,6 +510,26 @@ IN_PROC_BROWSER_TEST_F(DownloadNotificationTest, DiscardDangerousFile) {
EXPECT_FALSE(base::PathExists(GetDownloadPath().Append(filename.BaseName())));
}
+IN_PROC_BROWSER_TEST_F(DownloadNotificationTest, DownloadImageFile) {
+ GURL download_url(embedded_test_server()->GetURL(
+ "/downloads/image-octet-stream.png"));
+
+ content::DownloadTestObserverTerminal download_terminal_observer(
+ GetDownloadManager(browser()), 1u, /* wait_count */
+ content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_IGNORE);
+
+ CreateDownloadForBrowserAndURL(browser(), download_url);
+
+ // Wait for the download completion.
+ download_terminal_observer.WaitForFinished();
+
+ // Waits for download completion.
+ while (GetNotification(notification_id())->image().IsEmpty()) {
+ NotificationUpdateObserver download_change_notification_observer;
+ download_change_notification_observer.Wait();
+ }
+}
+
IN_PROC_BROWSER_TEST_F(DownloadNotificationTest,
CloseNotificationAfterDownload) {
CreateDownload();
« no previous file with comments | « no previous file | chrome/browser/download/notification/download_notification_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698