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

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

Issue 23496076: WIP - Refactor programmatic downloads Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « chrome/common/extensions/api/downloads.idl ('k') | content/browser/download/download_create_info.h » ('j') | 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 767819edbcfe98419912a45dabb2ac60c8c7091e..1bafbc32616374d140e4fbd767b8eaa55543c0d5 100644
--- a/content/browser/download/download_browsertest.cc
+++ b/content/browser/download/download_browsertest.cc
@@ -16,7 +16,7 @@
#include "content/browser/download/download_file_impl.h"
#include "content/browser/download/download_item_impl.h"
#include "content/browser/download/download_manager_impl.h"
-#include "content/browser/download/download_resource_handler.h"
+#include "content/browser/download/download_request_model.h"
#include "content/browser/plugin_service_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/power_save_blocker.h"
@@ -515,7 +515,7 @@ class DownloadContentTest : public ContentBrowserTest {
// to send its reset, to get around hard close semantics on the Windows
// socket layer implementation.
int GetSafeBufferChunk() const {
- return (DownloadResourceHandler::kDownloadByteStreamSize /
+ return (DownloadRequestModel::kDownloadByteStreamSize /
ByteStreamWriter::kFractionBufferBeforeSending) + 1;
}
@@ -1125,12 +1125,12 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest,
switches::kEnableDownloadResumption);
ASSERT_TRUE(test_server()->Start());
- GURL url = test_server()->GetURL(
- base::StringPrintf(
- // First download hits an RST, rest don't, precondition fail.
- "rangereset?size=%d&rst_boundary=%d&"
- "token=NoRange&rst_limit=1&fail_precondition=2",
- GetSafeBufferChunk() * 3, GetSafeBufferChunk()));
+ GURL url = test_server()->GetURL(base::StringPrintf(
+ // First download hits an RST, rest don't, precondition fail.
+ "rangereset?size=%d&rst_boundary=%d&"
+ "token=BadPrecondition&rst_limit=1&fail_precondition=2",
+ GetSafeBufferChunk() * 3,
+ GetSafeBufferChunk()));
// Start the download and wait for first data chunk.
DownloadItem* download(StartDownloadAndReturnItem(url));
@@ -1142,6 +1142,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest,
ConfirmFileStatusForResume(
download, true, GetSafeBufferChunk(), GetSafeBufferChunk() * 3,
base::FilePath(FILE_PATH_LITERAL("rangereset.crdownload")));
+ EXPECT_EQ("BadPrecondition2", download->GetETag());
DownloadUpdatedObserver completion_observer(
download, base::Bind(DownloadCompleteFilter));
@@ -1151,6 +1152,7 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest,
ConfirmFileStatusForResume(
download, true, GetSafeBufferChunk() * 3, GetSafeBufferChunk() * 3,
base::FilePath(FILE_PATH_LITERAL("rangereset")));
+ EXPECT_EQ("BadPrecondition0", download->GetETag());
static const RecordingDownloadObserver::RecordStruct expected_record[] = {
// Result of RST
« no previous file with comments | « chrome/common/extensions/api/downloads.idl ('k') | content/browser/download/download_create_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698