| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/download/download_ui_controller.h" | 5 #include "chrome/browser/download/download_ui_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 .WillRepeatedly(Return(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)); | 233 .WillRepeatedly(Return(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)); |
| 234 EXPECT_CALL(*item, GetLastReason()) | 234 EXPECT_CALL(*item, GetLastReason()) |
| 235 .WillRepeatedly(Return(content::DOWNLOAD_INTERRUPT_REASON_NONE)); | 235 .WillRepeatedly(Return(content::DOWNLOAD_INTERRUPT_REASON_NONE)); |
| 236 EXPECT_CALL(*item, GetReceivedBytes()).WillRepeatedly(Return(0)); | 236 EXPECT_CALL(*item, GetReceivedBytes()).WillRepeatedly(Return(0)); |
| 237 EXPECT_CALL(*item, GetReceivedSlices()).WillRepeatedly( | 237 EXPECT_CALL(*item, GetReceivedSlices()).WillRepeatedly( |
| 238 ReturnRefOfCopy(std::vector<content::DownloadItem::ReceivedSlice>())); | 238 ReturnRefOfCopy(std::vector<content::DownloadItem::ReceivedSlice>())); |
| 239 EXPECT_CALL(*item, GetTotalBytes()).WillRepeatedly(Return(0)); | 239 EXPECT_CALL(*item, GetTotalBytes()).WillRepeatedly(Return(0)); |
| 240 EXPECT_CALL(*item, GetTargetDisposition()).WillRepeatedly( | 240 EXPECT_CALL(*item, GetTargetDisposition()).WillRepeatedly( |
| 241 Return(content::DownloadItem::TARGET_DISPOSITION_OVERWRITE)); | 241 Return(content::DownloadItem::TARGET_DISPOSITION_OVERWRITE)); |
| 242 EXPECT_CALL(*item, GetOpened()).WillRepeatedly(Return(false)); | 242 EXPECT_CALL(*item, GetOpened()).WillRepeatedly(Return(false)); |
| 243 EXPECT_CALL(*item, GetLastAccessTime()).WillRepeatedly(Return(base::Time())); |
| 243 EXPECT_CALL(*item, GetMimeType()).WillRepeatedly(Return(std::string())); | 244 EXPECT_CALL(*item, GetMimeType()).WillRepeatedly(Return(std::string())); |
| 244 EXPECT_CALL(*item, GetURL()).WillRepeatedly(ReturnRefOfCopy(GURL())); | 245 EXPECT_CALL(*item, GetURL()).WillRepeatedly(ReturnRefOfCopy(GURL())); |
| 245 EXPECT_CALL(*item, GetWebContents()).WillRepeatedly(Return(nullptr)); | 246 EXPECT_CALL(*item, GetWebContents()).WillRepeatedly(Return(nullptr)); |
| 246 EXPECT_CALL(*item, IsTemporary()).WillRepeatedly(Return(false)); | 247 EXPECT_CALL(*item, IsTemporary()).WillRepeatedly(Return(false)); |
| 247 return item; | 248 return item; |
| 248 } | 249 } |
| 249 | 250 |
| 250 std::unique_ptr<DownloadUIController::Delegate> | 251 std::unique_ptr<DownloadUIController::Delegate> |
| 251 DownloadUIControllerTest::GetTestDelegate() { | 252 DownloadUIControllerTest::GetTestDelegate() { |
| 252 std::unique_ptr<DownloadUIController::Delegate> delegate( | 253 std::unique_ptr<DownloadUIController::Delegate> delegate( |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 // DownloadUIController. It should ignore the download since it's marked as | 355 // DownloadUIController. It should ignore the download since it's marked as |
| 355 // being restored from history. | 356 // being restored from history. |
| 356 ASSERT_TRUE(manager_observer()); | 357 ASSERT_TRUE(manager_observer()); |
| 357 manager_observer()->OnDownloadCreated(manager(), item.get()); | 358 manager_observer()->OnDownloadCreated(manager(), item.get()); |
| 358 | 359 |
| 359 // Finally, the expectation we've been waiting for: | 360 // Finally, the expectation we've been waiting for: |
| 360 EXPECT_FALSE(notified_item()); | 361 EXPECT_FALSE(notified_item()); |
| 361 } | 362 } |
| 362 | 363 |
| 363 } // namespace | 364 } // namespace |
| OLD | NEW |