OLD | NEW |
---|---|
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 Loading... | |
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 } | |
OLD | NEW |