| 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 // This file contains download browser tests that are known to be runnable | 5 // This file contains download browser tests that are known to be runnable |
| 6 // in a pure content context. Over time tests should be migrated here. | 6 // in a pure content context. Over time tests should be migrated here. |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 WaitForData(download, GetSafeBufferChunk()); | 1204 WaitForData(download, GetSafeBufferChunk()); |
| 1205 | 1205 |
| 1206 RecordingDownloadObserver recorder(download); | 1206 RecordingDownloadObserver recorder(download); |
| 1207 | 1207 |
| 1208 ReleaseRSTAndConfirmInterruptForResume(download); | 1208 ReleaseRSTAndConfirmInterruptForResume(download); |
| 1209 ConfirmFileStatusForResume( | 1209 ConfirmFileStatusForResume( |
| 1210 download, true, GetSafeBufferChunk(), GetSafeBufferChunk() * 3, | 1210 download, true, GetSafeBufferChunk(), GetSafeBufferChunk() * 3, |
| 1211 base::FilePath(FILE_PATH_LITERAL("rangereset.crdownload"))); | 1211 base::FilePath(FILE_PATH_LITERAL("rangereset.crdownload"))); |
| 1212 | 1212 |
| 1213 // Delete the intermediate file. | 1213 // Delete the intermediate file. |
| 1214 base::Delete(download->GetFullPath(), false); | 1214 base::DeleteFile(download->GetFullPath(), false); |
| 1215 | 1215 |
| 1216 DownloadUpdatedObserver completion_observer( | 1216 DownloadUpdatedObserver completion_observer( |
| 1217 download, base::Bind(DownloadCompleteFilter)); | 1217 download, base::Bind(DownloadCompleteFilter)); |
| 1218 download->Resume(); | 1218 download->Resume(); |
| 1219 completion_observer.WaitForEvent(); | 1219 completion_observer.WaitForEvent(); |
| 1220 | 1220 |
| 1221 ConfirmFileStatusForResume( | 1221 ConfirmFileStatusForResume( |
| 1222 download, true, GetSafeBufferChunk() * 3, GetSafeBufferChunk() * 3, | 1222 download, true, GetSafeBufferChunk() * 3, GetSafeBufferChunk() * 3, |
| 1223 base::FilePath(FILE_PATH_LITERAL("rangereset"))); | 1223 base::FilePath(FILE_PATH_LITERAL("rangereset"))); |
| 1224 | 1224 |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1567 // Start the second download and wait until it's done. The test server is | 1567 // Start the second download and wait until it's done. The test server is |
| 1568 // single threaded. The response to this download request should follow the | 1568 // single threaded. The response to this download request should follow the |
| 1569 // response to the previous resumption request. | 1569 // response to the previous resumption request. |
| 1570 GURL url2(test_server()->GetURL("rangereset?size=100&rst_limit=0&token=x")); | 1570 GURL url2(test_server()->GetURL("rangereset?size=100&rst_limit=0&token=x")); |
| 1571 DownloadAndWait(shell(), url2, DownloadItem::COMPLETE); | 1571 DownloadAndWait(shell(), url2, DownloadItem::COMPLETE); |
| 1572 | 1572 |
| 1573 EXPECT_TRUE(EnsureNoPendingDownloads()); | 1573 EXPECT_TRUE(EnsureNoPendingDownloads()); |
| 1574 } | 1574 } |
| 1575 | 1575 |
| 1576 } // namespace content | 1576 } // namespace content |
| OLD | NEW |