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

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

Issue 1444253003: Use If-Range instead of If-Match/If-Unmodified-Since for partial requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make it obvious that the interrupt reason is obsolete. Created 5 years, 1 month 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
Index: content/browser/download/download_browsertest.cc
diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc
index 9bad4d3f421135165c7113baa601d8c35b3ba4df..37b9b8584e21ce103e0f8288ab69a8bc9a856ac8 100644
--- a/content/browser/download/download_browsertest.cc
+++ b/content/browser/download/download_browsertest.cc
@@ -1181,57 +1181,6 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest, ResumeInterruptedDownloadNoRange) {
recorder.CompareToExpectedRecord(expected_record, arraysize(expected_record));
}
-// Confirm restart fallback happens if a precondition is failed.
-IN_PROC_BROWSER_TEST_F(DownloadContentTest,
- ResumeInterruptedDownloadBadPrecondition) {
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kEnableDownloadResumption);
- ASSERT_TRUE(spawned_test_server()->Start());
-
- GURL url = spawned_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));
- WaitForData(download, GetSafeBufferChunk());
-
- RecordingDownloadObserver recorder(download);
-
- ReleaseRSTAndConfirmInterruptForResume(download);
- 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));
- download->Resume();
- completion_observer.WaitForEvent();
-
- 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
- {DownloadItem::INTERRUPTED, GetSafeBufferChunk()},
- // Starting continuation
- {DownloadItem::IN_PROGRESS, GetSafeBufferChunk()},
- // Server precondition fail.
- {DownloadItem::INTERRUPTED, 0},
- // Notification of successful restart.
- {DownloadItem::IN_PROGRESS, 0},
- // Completion.
- {DownloadItem::COMPLETE, GetSafeBufferChunk() * 3},
- };
-
- recorder.CompareToExpectedRecord(expected_record, arraysize(expected_record));
-}
-
// Confirm we don't try to resume if we don't have a verifier.
IN_PROC_BROWSER_TEST_F(DownloadContentTest,
ResumeInterruptedDownloadNoVerifiers) {

Powered by Google App Engine
This is Rietveld 408576698