| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 const std::vector<DownloadItem::ReceivedSlice>& received_slices, | 207 const std::vector<DownloadItem::ReceivedSlice>& received_slices, |
| 208 const net::NetLogWithSource& net_log, | 208 const net::NetLogWithSource& net_log, |
| 209 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker, | 209 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker, |
| 210 base::WeakPtr<DownloadDestinationObserver> observer, | 210 base::WeakPtr<DownloadDestinationObserver> observer, |
| 211 base::WeakPtr<DownloadFileWithDelayFactory> owner) | 211 base::WeakPtr<DownloadFileWithDelayFactory> owner) |
| 212 : DownloadFileImpl(std::move(save_info), | 212 : DownloadFileImpl(std::move(save_info), |
| 213 default_download_directory, | 213 default_download_directory, |
| 214 std::move(stream), | 214 std::move(stream), |
| 215 received_slices, | 215 received_slices, |
| 216 net_log, | 216 net_log, |
| 217 false, | |
| 218 observer), | 217 observer), |
| 219 owner_(owner) {} | 218 owner_(owner) {} |
| 220 | 219 |
| 221 DownloadFileWithDelay::~DownloadFileWithDelay() {} | 220 DownloadFileWithDelay::~DownloadFileWithDelay() {} |
| 222 | 221 |
| 223 void DownloadFileWithDelay::RenameAndUniquify( | 222 void DownloadFileWithDelay::RenameAndUniquify( |
| 224 const base::FilePath& full_path, | 223 const base::FilePath& full_path, |
| 225 const RenameCompletionCallback& callback) { | 224 const RenameCompletionCallback& callback) { |
| 226 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 225 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
| 227 DownloadFileImpl::RenameAndUniquify( | 226 DownloadFileImpl::RenameAndUniquify( |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 std::unique_ptr<ByteStreamReader> stream, | 315 std::unique_ptr<ByteStreamReader> stream, |
| 317 const std::vector<DownloadItem::ReceivedSlice>& received_slices, | 316 const std::vector<DownloadItem::ReceivedSlice>& received_slices, |
| 318 const net::NetLogWithSource& net_log, | 317 const net::NetLogWithSource& net_log, |
| 319 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker, | 318 std::unique_ptr<device::PowerSaveBlocker> power_save_blocker, |
| 320 base::WeakPtr<DownloadDestinationObserver> observer) | 319 base::WeakPtr<DownloadDestinationObserver> observer) |
| 321 : DownloadFileImpl(std::move(save_info), | 320 : DownloadFileImpl(std::move(save_info), |
| 322 default_downloads_directory, | 321 default_downloads_directory, |
| 323 std::move(stream), | 322 std::move(stream), |
| 324 received_slices, | 323 received_slices, |
| 325 net_log, | 324 net_log, |
| 326 false, | |
| 327 observer) {} | 325 observer) {} |
| 328 | 326 |
| 329 ~CountingDownloadFile() override { | 327 ~CountingDownloadFile() override { |
| 330 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 328 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
| 331 active_files_--; | 329 active_files_--; |
| 332 } | 330 } |
| 333 | 331 |
| 334 void Initialize(const InitializeCallback& callback) override { | 332 void Initialize(const InitializeCallback& callback) override { |
| 335 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 333 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
| 336 active_files_++; | 334 active_files_++; |
| (...skipping 2319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2656 GURL document_url = | 2654 GURL document_url = |
| 2657 origin_two.GetURL("/iframe-host.html?target=" + frame_url.spec()); | 2655 origin_two.GetURL("/iframe-host.html?target=" + frame_url.spec()); |
| 2658 DownloadItem* download = StartDownloadAndReturnItem(shell(), document_url); | 2656 DownloadItem* download = StartDownloadAndReturnItem(shell(), document_url); |
| 2659 WaitForCompletion(download); | 2657 WaitForCompletion(download); |
| 2660 | 2658 |
| 2661 EXPECT_STREQ(FILE_PATH_LITERAL("download-test.lib"), | 2659 EXPECT_STREQ(FILE_PATH_LITERAL("download-test.lib"), |
| 2662 download->GetTargetFilePath().BaseName().value().c_str()); | 2660 download->GetTargetFilePath().BaseName().value().c_str()); |
| 2663 } | 2661 } |
| 2664 | 2662 |
| 2665 } // namespace content | 2663 } // namespace content |
| OLD | NEW |