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

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

Issue 267563004: Avoid issuing a Read() after draining a request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-upload to see if it would make bots happy. Created 6 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 | chrome/test/data/downloads/empty.bin » ('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 17bcd366ba26e90ab68aa192106006053de03c1a..1114fc41471deb017d77c010a139419445bbf96c 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -3212,3 +3212,17 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, Resumption_MultipleAttempts) {
EXPECT_FALSE(DidShowFileChooser());
}
+
+// The file empty.bin is served with a MIME type of application/octet-stream.
+// The content body is empty. Make sure this case is handled properly and we
+// don't regress on http://crbug.com/320394.
+IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadTest_GZipWithNoContent) {
+ ASSERT_TRUE(test_server()->Start());
+ GURL url(test_server()->GetURL("files/downloads/empty.bin"));
+ // Downloading the same URL twice causes the second request to be served from
+ // cached (with a high probability). This test verifies that that doesn't
+ // happen regardless of whether the request is served via the cache or from
+ // the network.
+ DownloadAndWait(browser(), url);
+ DownloadAndWait(browser(), url);
+}
« no previous file with comments | « no previous file | chrome/test/data/downloads/empty.bin » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698