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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 .WillRepeatedly(Return(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)); | 222 .WillRepeatedly(Return(content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)); |
223 EXPECT_CALL(*item, GetLastReason()) | 223 EXPECT_CALL(*item, GetLastReason()) |
224 .WillRepeatedly(Return(content::DOWNLOAD_INTERRUPT_REASON_NONE)); | 224 .WillRepeatedly(Return(content::DOWNLOAD_INTERRUPT_REASON_NONE)); |
225 EXPECT_CALL(*item, GetReceivedBytes()).WillRepeatedly(Return(0)); | 225 EXPECT_CALL(*item, GetReceivedBytes()).WillRepeatedly(Return(0)); |
226 EXPECT_CALL(*item, GetTotalBytes()).WillRepeatedly(Return(0)); | 226 EXPECT_CALL(*item, GetTotalBytes()).WillRepeatedly(Return(0)); |
227 EXPECT_CALL(*item, GetTargetDisposition()).WillRepeatedly( | 227 EXPECT_CALL(*item, GetTargetDisposition()).WillRepeatedly( |
228 Return(content::DownloadItem::TARGET_DISPOSITION_OVERWRITE)); | 228 Return(content::DownloadItem::TARGET_DISPOSITION_OVERWRITE)); |
229 EXPECT_CALL(*item, GetOpened()).WillRepeatedly(Return(false)); | 229 EXPECT_CALL(*item, GetOpened()).WillRepeatedly(Return(false)); |
230 EXPECT_CALL(*item, GetMimeType()).WillRepeatedly(Return(std::string())); | 230 EXPECT_CALL(*item, GetMimeType()).WillRepeatedly(Return(std::string())); |
231 EXPECT_CALL(*item, GetURL()).WillRepeatedly(testing::ReturnRefOfCopy(GURL())); | 231 EXPECT_CALL(*item, GetURL()).WillRepeatedly(testing::ReturnRefOfCopy(GURL())); |
| 232 EXPECT_CALL(*item, GetWebContents()).WillRepeatedly(Return(nullptr)); |
232 EXPECT_CALL(*item, IsTemporary()).WillRepeatedly(Return(false)); | 233 EXPECT_CALL(*item, IsTemporary()).WillRepeatedly(Return(false)); |
233 return item.Pass(); | 234 return item.Pass(); |
234 } | 235 } |
235 | 236 |
236 scoped_ptr<DownloadUIController::Delegate> | 237 scoped_ptr<DownloadUIController::Delegate> |
237 DownloadUIControllerTest::GetTestDelegate() { | 238 DownloadUIControllerTest::GetTestDelegate() { |
238 scoped_ptr<DownloadUIController::Delegate> delegate( | 239 scoped_ptr<DownloadUIController::Delegate> delegate( |
239 new TestDelegate(notified_item_receiver_factory_.GetWeakPtr())); | 240 new TestDelegate(notified_item_receiver_factory_.GetWeakPtr())); |
240 return delegate.Pass(); | 241 return delegate.Pass(); |
241 } | 242 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 // DownloadUIController. It should ignore the download since it's marked as | 341 // DownloadUIController. It should ignore the download since it's marked as |
341 // being restored from history. | 342 // being restored from history. |
342 ASSERT_TRUE(manager_observer()); | 343 ASSERT_TRUE(manager_observer()); |
343 manager_observer()->OnDownloadCreated(manager(), item.get()); | 344 manager_observer()->OnDownloadCreated(manager(), item.get()); |
344 | 345 |
345 // Finally, the expectation we've been waiting for: | 346 // Finally, the expectation we've been waiting for: |
346 EXPECT_FALSE(notified_item()); | 347 EXPECT_FALSE(notified_item()); |
347 } | 348 } |
348 | 349 |
349 } // namespace | 350 } // namespace |
OLD | NEW |