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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/stl_util.h" | 6 #include "base/stl_util.h" |
7 #include "base/threading/thread.h" | 7 #include "base/threading/thread.h" |
8 #include "content/browser/download/byte_stream.h" | 8 #include "content/browser/download/byte_stream.h" |
9 #include "content/browser/download/download_create_info.h" | 9 #include "content/browser/download/download_create_info.h" |
10 #include "content/browser/download/download_file_manager.h" | 10 #include "content/browser/download/download_file_manager.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 info_->download_id = | 214 info_->download_id = |
215 content::DownloadId(kValidDownloadItemIdDomain, ++next_id); | 215 content::DownloadId(kValidDownloadItemIdDomain, ++next_id); |
216 info_->prompt_user_for_save_location = false; | 216 info_->prompt_user_for_save_location = false; |
217 info_->url_chain.push_back(GURL()); | 217 info_->url_chain.push_back(GURL()); |
218 info_->state = state; | 218 info_->state = state; |
219 | 219 |
220 scoped_ptr<DownloadRequestHandleInterface> request_handle( | 220 scoped_ptr<DownloadRequestHandleInterface> request_handle( |
221 new testing::NiceMock<MockRequestHandle>); | 221 new testing::NiceMock<MockRequestHandle>); |
222 DownloadItemImpl* download = | 222 DownloadItemImpl* download = |
223 new DownloadItemImpl(&delegate_, *(info_.get()), | 223 new DownloadItemImpl(&delegate_, *(info_.get()), |
224 request_handle.Pass(), false, net::BoundNetLog()); | 224 request_handle.Pass(), net::BoundNetLog()); |
225 allocated_downloads_.insert(download); | 225 allocated_downloads_.insert(download); |
226 return download; | 226 return download; |
227 } | 227 } |
228 | 228 |
229 // Destroy a previously created download item. | 229 // Destroy a previously created download item. |
230 void DestroyDownloadItem(DownloadItem* item) { | 230 void DestroyDownloadItem(DownloadItem* item) { |
231 allocated_downloads_.erase(item); | 231 allocated_downloads_.erase(item); |
232 delete item; | 232 delete item; |
233 } | 233 } |
234 | 234 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 DownloadItemImpl* item = CreateDownloadItem(DownloadItem::IN_PROGRESS); | 533 DownloadItemImpl* item = CreateDownloadItem(DownloadItem::IN_PROGRESS); |
534 | 534 |
535 EXPECT_FALSE(item->GetFileExternallyRemoved()); | 535 EXPECT_FALSE(item->GetFileExternallyRemoved()); |
536 item->OnDownloadedFileRemoved(); | 536 item->OnDownloadedFileRemoved(); |
537 EXPECT_TRUE(item->GetFileExternallyRemoved()); | 537 EXPECT_TRUE(item->GetFileExternallyRemoved()); |
538 } | 538 } |
539 | 539 |
540 TEST(MockDownloadItem, Compiles) { | 540 TEST(MockDownloadItem, Compiles) { |
541 MockDownloadItem mock_item; | 541 MockDownloadItem mock_item; |
542 } | 542 } |
OLD | NEW |