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

Unified Diff: content/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: Add reliable repro of crash. 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
Index: content/browser/download/download_browsertest.cc
diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc
index 9e8cab2fb87f8e9b8d0925748f95b6e9468d1134..8f35b63e5761b099ddcf4ac804e62587dd66fa9c 100644
--- a/content/browser/download/download_browsertest.cc
+++ b/content/browser/download/download_browsertest.cc
@@ -1797,4 +1797,18 @@ IN_PROC_BROWSER_TEST_F(DownloadContentTest,
ASSERT_TRUE(origin_two.ShutdownAndWaitUntilComplete());
}
+// 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(DownloadContentTest, DownloadGZipWithNoContent) {
+ EmbeddedTestServer test_server;
+ ASSERT_TRUE(test_server.InitializeAndWaitUntilReady());
+
+ GURL url = test_server.GetURL("/empty.bin");
+ test_server.ServeFilesFromDirectory(GetTestFilePath("download", ""));
+
+ NavigateToURLAndWaitForDownload(shell(), url, DownloadItem::COMPLETE);
+ // That's it. This should work without crashing.
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698