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

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

Issue 7484063: Add a browser-test for downloading an anchor with a suggested name for download. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « no previous file | chrome/test/data/download-anchor-attrib.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_browsertest.cc
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index 2f5ca58d62af4d9b4e4f1ab61210458b364aaf60..8ca4c6a7f3438e7d4d4e8b2b5e5c727ef38a4b02 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -1548,6 +1548,24 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_BrowserCloseAfterDownload) {
signal.Wait();
}
+// Test to make sure the 'download' attribute in anchor tag is respected.
+IN_PROC_BROWSER_TEST_F(DownloadTest, AnchorDownloadTag) {
+ ASSERT_TRUE(InitialSetup(false));
+ FilePath file(FILE_PATH_LITERAL("download-anchor-attrib.html"));
+ GURL url(URLRequestMockHTTPJob::GetMockUrl(file));
+
+ // Create a download, wait until it's complete, and confirm
+ // we're in the expected state.
+ scoped_ptr<DownloadsObserver> observer(CreateWaiter(browser(), 1));
+ ui_test_utils::NavigateToURL(browser(), url);
+ observer->WaitForFinished();
+
+ // Confirm the downloaded data exists.
+ FilePath downloaded_file = GetDownloadDirectory(browser());
+ downloaded_file = downloaded_file.Append(FILE_PATH_LITERAL("a_red_dot.png"));
+ EXPECT_TRUE(file_util::PathExists(downloaded_file));
+}
+
// Test to make sure auto-open works.
IN_PROC_BROWSER_TEST_F(DownloadTest, AutoOpen) {
ASSERT_TRUE(InitialSetup(false));
« no previous file with comments | « no previous file | chrome/test/data/download-anchor-attrib.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698