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

Side by Side Diff: content/browser/download/download_browsertest.cc

Issue 1835913002: [Merge M50] [Downloads] Retain a BlobDataHandle in DownloadUrlParameters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/download/download_manager_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file contains download browser tests that are known to be runnable 5 // This file contains download browser tests that are known to be runnable
6 // in a pure content context. Over time tests should be migrated here. 6 // in a pure content context. Over time tests should be migrated here.
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <utility> 10 #include <utility>
(...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after
2096 GURL document_url = embedded_test_server()->GetURL( 2096 GURL document_url = embedded_test_server()->GetURL(
2097 "/download/download-attribute.html?target=about:version"); 2097 "/download/download-attribute.html?target=about:version");
2098 DownloadItem* download = StartDownloadAndReturnItem(shell(), document_url); 2098 DownloadItem* download = StartDownloadAndReturnItem(shell(), document_url);
2099 WaitForInterrupt(download); 2099 WaitForInterrupt(download);
2100 2100
2101 EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST, 2101 EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST,
2102 download->GetLastReason()); 2102 download->GetLastReason());
2103 EXPECT_FALSE(download->CanResume()); 2103 EXPECT_FALSE(download->CanResume());
2104 } 2104 }
2105 2105
2106 IN_PROC_BROWSER_TEST_F(DownloadContentTest, DownloadAttributeBlobURL) {
2107 ASSERT_TRUE(embedded_test_server()->Start());
2108
2109 GURL document_url =
2110 embedded_test_server()->GetURL("/download/download-attribute-blob.html");
2111 DownloadItem* download = StartDownloadAndReturnItem(shell(), document_url);
2112 WaitForCompletion(download);
2113
2114 EXPECT_STREQ(FILE_PATH_LITERAL("suggested-filename.txt"),
2115 download->GetTargetFilePath().BaseName().value().c_str());
2116 }
2117
2106 // The file empty.bin is served with a MIME type of application/octet-stream. 2118 // The file empty.bin is served with a MIME type of application/octet-stream.
2107 // The content body is empty. Make sure this case is handled properly and we 2119 // The content body is empty. Make sure this case is handled properly and we
2108 // don't regress on http://crbug.com/320394. 2120 // don't regress on http://crbug.com/320394.
2109 IN_PROC_BROWSER_TEST_F(DownloadContentTest, DownloadGZipWithNoContent) { 2121 IN_PROC_BROWSER_TEST_F(DownloadContentTest, DownloadGZipWithNoContent) {
2110 GURL url = net::URLRequestMockHTTPJob::GetMockUrl("empty.bin"); 2122 GURL url = net::URLRequestMockHTTPJob::GetMockUrl("empty.bin");
2111 NavigateToURLAndWaitForDownload(shell(), url, DownloadItem::COMPLETE); 2123 NavigateToURLAndWaitForDownload(shell(), url, DownloadItem::COMPLETE);
2112 // That's it. This should work without crashing. 2124 // That's it. This should work without crashing.
2113 } 2125 }
2114 2126
2115 // Make sure that sniffed MIME types are correctly passed through to the 2127 // Make sure that sniffed MIME types are correctly passed through to the
(...skipping 20 matching lines...) Expand all
2136 2148
2137 std::vector<DownloadItem*> downloads; 2149 std::vector<DownloadItem*> downloads;
2138 DownloadManagerForShell(shell())->GetAllDownloads(&downloads); 2150 DownloadManagerForShell(shell())->GetAllDownloads(&downloads);
2139 ASSERT_EQ(1u, downloads.size()); 2151 ASSERT_EQ(1u, downloads.size());
2140 2152
2141 EXPECT_EQ(FILE_PATH_LITERAL("Jumboshrimp.txt"), 2153 EXPECT_EQ(FILE_PATH_LITERAL("Jumboshrimp.txt"),
2142 downloads[0]->GetTargetFilePath().BaseName().value()); 2154 downloads[0]->GetTargetFilePath().BaseName().value());
2143 } 2155 }
2144 2156
2145 } // namespace content 2157 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/download/download_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698