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

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: Addressed comments #12 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 369fccd8b603f30ccaf0196b13e53d690d963eee..5913659abcc0c7b4f70ce9171380bdd7930b639c 100644
--- a/chrome/browser/download/notification/download_notification_browsertest.cc
+++ b/chrome/browser/download/notification/download_notification_browsertest.cc
@@ -501,6 +501,28 @@ IN_PROC_BROWSER_TEST_F(DownloadNotificationTest, DiscardDangerousFile) {
EXPECT_FALSE(base::PathExists(GetDownloadPath().Append(filename.BaseName())));
}
+IN_PROC_BROWSER_TEST_F(DownloadNotificationTest, DownloadImageFile) {
asanka 2015/06/11 15:46:43 In addition, we'd need tests for a file with an im
+ ASSERT_TRUE(test_server()->Start());
+ GURL download_url(
+ test_server()->GetURL("files/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