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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/data/downloads/empty.bin » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <sstream> 5 #include <sstream>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 3194 matching lines...) Expand 10 before | Expand all | Expand 10 after
3205 3205
3206 // No errors this time. The download should complete successfully. 3206 // No errors this time. The download should complete successfully.
3207 EXPECT_FALSE(completion_observer->IsFinished()); 3207 EXPECT_FALSE(completion_observer->IsFinished());
3208 completion_observer->StartObserving(); 3208 completion_observer->StartObserving();
3209 download->Resume(); 3209 download->Resume();
3210 completion_observer->WaitForFinished(); 3210 completion_observer->WaitForFinished();
3211 EXPECT_EQ(DownloadItem::COMPLETE, download->GetState()); 3211 EXPECT_EQ(DownloadItem::COMPLETE, download->GetState());
3212 3212
3213 EXPECT_FALSE(DidShowFileChooser()); 3213 EXPECT_FALSE(DidShowFileChooser());
3214 } 3214 }
3215
3216 // The file empty.bin is served with a MIME type of application/octet-stream.
3217 // The content body is empty. Make sure this case is handled properly and we
3218 // don't regress on http://crbug.com/320394.
3219 IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadTest_GZipWithNoContent) {
3220 ASSERT_TRUE(test_server()->Start());
3221 GURL url(test_server()->GetURL("files/downloads/empty.bin"));
3222 // Downloading the same URL twice causes the second request to be served from
3223 // cached (with a high probability). This test verifies that that doesn't
davidben 2014/05/09 16:04:24 Nit: s/that that doesn't happen/that it doesn't cr
3224 // happen regardless of whether the request is served via the cache or from
3225 // the network.
3226 DownloadAndWait(browser(), url);
3227 DownloadAndWait(browser(), url);
3228 }
OLDNEW
« 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