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

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

Issue 1958283004: [Branch M51] Cleanup unnecessary test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_browsertest.cc
diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc
index 43723432d0505e4c59670c923117631545139f3e..e9b1c4cb248fe9b0ca49a4adc1dfbbebea87737a 100644
--- a/content/browser/download/download_browsertest.cc
+++ b/content/browser/download/download_browsertest.cc
@@ -2222,74 +2222,6 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeRestoredDownload_ShortFile) {
EXPECT_EQ(parameters.size, completed_requests[1]->transferred_byte_count);
}
-IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeRestoredDownload_LongFile) {
- // These numbers are sufficiently large that the intermediate file won't be
- // read in a single Read().
- const int kFileSize = 1024 * 1024;
- const int kIntermediateSize = kFileSize / 2 + 111;
-
- TestDownloadRequestHandler request_handler;
- TestDownloadRequestHandler::Parameters parameters;
- parameters.size = kFileSize;
- request_handler.StartServing(parameters);
-
- base::FilePath intermediate_file_path =
- GetDownloadDirectory().AppendASCII("intermediate");
- std::vector<GURL> url_chain;
-
- // Size of file is slightly longer than the size known to DownloadItem.
- std::vector<char> buffer(kIntermediateSize + 100);
- request_handler.GetPatternBytes(
- parameters.pattern_generator_seed, 0, buffer.size(), buffer.data());
- ASSERT_EQ(
- kIntermediateSize + 100,
- base::WriteFile(intermediate_file_path, buffer.data(), buffer.size()));
- url_chain.push_back(request_handler.url());
-
- DownloadItem* download = DownloadManagerForShell(shell())->CreateDownloadItem(
- "F7FB1F59-7DE1-4845-AFDB-8A688F70F583",
- 1,
- intermediate_file_path,
- base::FilePath(),
- url_chain,
- GURL(),
- GURL(),
- GURL(),
- "application/octet-stream",
- "application/octet-stream",
- base::Time::Now(),
- base::Time(),
- parameters.etag,
- std::string(),
- kIntermediateSize,
- parameters.size,
- std::string(),
- DownloadItem::INTERRUPTED,
- DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
- DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED,
- false);
-
- download->Resume();
- WaitForCompletion(download);
-
- EXPECT_FALSE(base::PathExists(intermediate_file_path));
- ReadAndVerifyFileContents(parameters.pattern_generator_seed,
- parameters.size,
- download->GetTargetFilePath());
-
- TestDownloadRequestHandler::CompletedRequests completed_requests;
- request_handler.GetCompletedRequestInfo(&completed_requests);
-
- // There should be only one request. The intermediate file should be truncated
- // to the expected size, and the request should be issued for the remainder.
- //
- // TODO(asanka): Ideally we'll check that the intermediate file matches
- // expectations prior to issuing the first resumption request.
- ASSERT_EQ(1u, completed_requests.size());
- EXPECT_EQ(parameters.size - kIntermediateSize,
- completed_requests[0]->transferred_byte_count);
-}
-
// Test that the referrer header is set correctly for a download that's resumed
// partially.
IN_PROC_BROWSER_TEST_F(DownloadContentTest, ReferrerForPartialResumption) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698