Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Side by Side Diff: content/browser/download/download_item_impl_unittest.cc

Issue 23496076: WIP - Refactor programmatic downloads Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/callback.h" 5 #include "base/callback.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "content/browser/byte_stream.h" 10 #include "content/browser/byte_stream.h"
11 #include "content/browser/download/download_create_info.h" 11 #include "content/browser/download/download_create_info.h"
12 #include "content/browser/download/download_file_factory.h" 12 #include "content/browser/download/download_file_factory.h"
13 #include "content/browser/download/download_item_impl.h" 13 #include "content/browser/download/download_item_impl.h"
14 #include "content/browser/download/download_item_impl_delegate.h" 14 #include "content/browser/download/download_item_impl_delegate.h"
15 #include "content/browser/download/download_request_handle.h" 15 #include "content/browser/download/download_request_handle.h"
16 #include "content/browser/download/mock_download_file.h" 16 #include "content/browser/download/mock_download_file.h"
17 #include "content/public/browser/download_destination_observer.h" 17 #include "content/public/browser/download_destination_observer.h"
18 #include "content/public/browser/download_interrupt_reasons.h" 18 #include "content/public/browser/download_interrupt_reasons.h"
19 #include "content/public/browser/download_url_parameters.h" 19 #include "content/public/browser/download_url_parameters.h"
20 #include "content/public/common/content_switches.h" 20 #include "content/public/common/content_switches.h"
21 #include "content/public/test/mock_download_item.h" 21 #include "content/public/test/mock_download_item.h"
22 #include "content/public/test/test_browser_context.h"
22 #include "content/public/test/test_browser_thread.h" 23 #include "content/public/test/test_browser_thread.h"
23 #include "testing/gmock/include/gmock/gmock.h" 24 #include "testing/gmock/include/gmock/gmock.h"
24 #include "testing/gtest/include/gtest/gtest.h" 25 #include "testing/gtest/include/gtest/gtest.h"
25 26
26 using ::testing::_; 27 using ::testing::_;
27 using ::testing::NiceMock; 28 using ::testing::NiceMock;
28 using ::testing::Property; 29 using ::testing::Property;
29 using ::testing::Return; 30 using ::testing::Return;
30 using ::testing::SaveArg; 31 using ::testing::SaveArg;
31 using ::testing::StrictMock; 32 using ::testing::StrictMock;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 void SetDefaultExpectations() { 81 void SetDefaultExpectations() {
81 EXPECT_CALL(*this, AssertStateConsistent(_)) 82 EXPECT_CALL(*this, AssertStateConsistent(_))
82 .WillRepeatedly(Return()); 83 .WillRepeatedly(Return());
83 EXPECT_CALL(*this, ShouldOpenFileBasedOnExtension(_)) 84 EXPECT_CALL(*this, ShouldOpenFileBasedOnExtension(_))
84 .WillRepeatedly(Return(false)); 85 .WillRepeatedly(Return(false));
85 EXPECT_CALL(*this, ShouldOpenDownload(_, _)) 86 EXPECT_CALL(*this, ShouldOpenDownload(_, _))
86 .WillRepeatedly(Return(true)); 87 .WillRepeatedly(Return(true));
87 } 88 }
88 }; 89 };
89 90
90 class MockRequestHandle : public DownloadRequestHandleInterface { 91 class MockRequestHandle : public DownloadRequestHandle {
91 public: 92 public:
92 MOCK_CONST_METHOD0(GetWebContents, WebContents*()); 93 MOCK_METHOD1(Start, void(const RequestStartedCallback&));
93 MOCK_CONST_METHOD0(GetDownloadManager, DownloadManager*());
94 MOCK_CONST_METHOD0(PauseRequest, void()); 94 MOCK_CONST_METHOD0(PauseRequest, void());
95 MOCK_CONST_METHOD0(ResumeRequest, void()); 95 MOCK_CONST_METHOD0(ResumeRequest, void());
96 MOCK_CONST_METHOD0(CancelRequest, void()); 96 MOCK_CONST_METHOD0(CancelRequest, void());
97 MOCK_CONST_METHOD0(DebugString, std::string()); 97 MOCK_CONST_METHOD0(DebugString, std::string());
98 }; 98 };
99 99
100 // Schedules a task to invoke the RenameCompletionCallback with |new_path| on 100 // Schedules a task to invoke the RenameCompletionCallback with |new_path| on
101 // the UI thread. Should only be used as the action for 101 // the UI thread. Should only be used as the action for
102 // MockDownloadFile::Rename as follows: 102 // MockDownloadFile::Rename as follows:
103 // EXPECT_CALL(download_file, Rename*(_,_)) 103 // EXPECT_CALL(download_file, Rename*(_,_))
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 // don't call the function that deletes it, so we do so ourselves. 224 // don't call the function that deletes it, so we do so ourselves.
225 scoped_ptr<DownloadCreateInfo> info_; 225 scoped_ptr<DownloadCreateInfo> info_;
226 226
227 info_.reset(new DownloadCreateInfo()); 227 info_.reset(new DownloadCreateInfo());
228 static uint32 next_id = DownloadItem::kInvalidId + 1; 228 static uint32 next_id = DownloadItem::kInvalidId + 1;
229 info_->save_info = scoped_ptr<DownloadSaveInfo>(new DownloadSaveInfo()); 229 info_->save_info = scoped_ptr<DownloadSaveInfo>(new DownloadSaveInfo());
230 info_->save_info->prompt_for_save_location = false; 230 info_->save_info->prompt_for_save_location = false;
231 info_->url_chain.push_back(GURL()); 231 info_->url_chain.push_back(GURL());
232 info_->etag = "SomethingToSatisfyResumption"; 232 info_->etag = "SomethingToSatisfyResumption";
233 233
234 DownloadItemImpl* download = 234 DownloadItemImpl* download = new DownloadItemImpl(
235 new DownloadItemImpl( 235 &delegate_, next_id++, *(info_.get()), net::BoundNetLog());
236 &delegate_, next_id++, *(info_.get()), net::BoundNetLog());
237 allocated_downloads_.insert(download); 236 allocated_downloads_.insert(download);
238 return download; 237 return download;
239 } 238 }
240 239
241 // Add DownloadFile to DownloadItem 240 // Add DownloadFile to DownloadItem
242 MockDownloadFile* AddDownloadFileToDownloadItem( 241 MockDownloadFile* AddDownloadFileToDownloadItem(
243 DownloadItemImpl* item, 242 DownloadItemImpl* item,
244 DownloadItemImplDelegate::DownloadTargetCallback *callback) { 243 DownloadItemImplDelegate::DownloadTargetCallback *callback) {
245 MockDownloadFile* mock_download_file(new StrictMock<MockDownloadFile>); 244 MockDownloadFile* mock_download_file(new StrictMock<MockDownloadFile>);
246 scoped_ptr<DownloadFile> download_file(mock_download_file); 245 scoped_ptr<DownloadFile> download_file(mock_download_file);
247 EXPECT_CALL(*mock_download_file, Initialize(_)); 246 EXPECT_CALL(*mock_download_file, Initialize(_));
248 if (callback) { 247 if (callback) {
249 // Save the callback. 248 // Save the callback.
250 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(item, _)) 249 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(item, _))
251 .WillOnce(SaveArg<1>(callback)); 250 .WillOnce(SaveArg<1>(callback));
252 } else { 251 } else {
253 // Drop it on the floor. 252 // Drop it on the floor.
254 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(item, _)); 253 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(item, _));
255 } 254 }
256 255
257 scoped_ptr<DownloadRequestHandleInterface> request_handle( 256 scoped_ptr<DownloadRequestHandle> request_handle(
258 new NiceMock<MockRequestHandle>); 257 new NiceMock<MockRequestHandle>);
259 item->Start(download_file.Pass(), request_handle.Pass()); 258 item->Start(download_file.Pass(), request_handle.Pass());
260 loop_.RunUntilIdle(); 259 loop_.RunUntilIdle();
261 260
262 // So that we don't have a function writing to a stack variable 261 // So that we don't have a function writing to a stack variable
263 // lying around if the above failed. 262 // lying around if the above failed.
264 mock_delegate()->VerifyAndClearExpectations(); 263 mock_delegate()->VerifyAndClearExpectations();
265 EXPECT_CALL(*mock_delegate(), AssertStateConsistent(_)) 264 EXPECT_CALL(*mock_delegate(), AssertStateConsistent(_))
266 .WillRepeatedly(Return()); 265 .WillRepeatedly(Return());
267 EXPECT_CALL(*mock_delegate(), ShouldOpenFileBasedOnExtension(_)) 266 EXPECT_CALL(*mock_delegate(), ShouldOpenFileBasedOnExtension(_))
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 MockObserver observer(item); 409 MockObserver observer(item);
411 410
412 DestroyDownloadItem(item); 411 DestroyDownloadItem(item);
413 ASSERT_TRUE(observer.CheckDestroyed()); 412 ASSERT_TRUE(observer.CheckDestroyed());
414 } 413 }
415 414
416 TEST_F(DownloadItemTest, ContinueAfterInterrupted) { 415 TEST_F(DownloadItemTest, ContinueAfterInterrupted) {
417 CommandLine::ForCurrentProcess()->AppendSwitch( 416 CommandLine::ForCurrentProcess()->AppendSwitch(
418 switches::kEnableDownloadResumption); 417 switches::kEnableDownloadResumption);
419 418
419 TestBrowserContext test_browser_context;
420 DownloadItemImpl* item = CreateDownloadItem(); 420 DownloadItemImpl* item = CreateDownloadItem();
421 MockObserver observer(item); 421 MockObserver observer(item);
422 DownloadItemImplDelegate::DownloadTargetCallback callback;
423 MockDownloadFile* download_file = 422 MockDownloadFile* download_file =
424 DoIntermediateRename(item, DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS); 423 DoIntermediateRename(item, DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS);
425 424
425 EXPECT_CALL(*mock_delegate(), GetBrowserContext())
426 .WillRepeatedly(Return(&test_browser_context));
427 EXPECT_CALL(*mock_delegate(), MockResumeInterruptedDownload(_, _));
428
426 // Interrupt the download, using a continuable interrupt. 429 // Interrupt the download, using a continuable interrupt.
427 EXPECT_CALL(*download_file, FullPath()) 430 EXPECT_CALL(*download_file, FullPath())
428 .WillOnce(Return(base::FilePath())); 431 .WillOnce(Return(base::FilePath()));
429 EXPECT_CALL(*download_file, Detach()); 432 EXPECT_CALL(*download_file, Detach());
430 item->DestinationObserverAsWeakPtr()->DestinationError( 433 item->DestinationObserverAsWeakPtr()->DestinationError(
431 DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR); 434 DOWNLOAD_INTERRUPT_REASON_FILE_TRANSIENT_ERROR);
432 ASSERT_TRUE(observer.CheckUpdated()); 435 ASSERT_TRUE(observer.CheckUpdated());
433 // Should attempt to auto-resume. Because we don't have a mock WebContents, 436
434 // ResumeInterruptedDownload() will abort early, with another interrupt, 437 // Should attempt to auto-resume. This is checked by verifying the expectation
435 // which will be ignored. 438 // for the MockResumeInterruptedDownload() call for the mock_delegate() above.
436 ASSERT_EQ(1, observer.GetInterruptCount()); 439 ASSERT_EQ(1, observer.GetInterruptCount());
437 ASSERT_EQ(0, observer.GetResumeCount()); 440 ASSERT_EQ(0, observer.GetResumeCount());
438 RunAllPendingInMessageLoops(); 441 RunAllPendingInMessageLoops();
439 442
440 CleanupItem(item, download_file, DownloadItem::INTERRUPTED); 443 CleanupItem(item, download_file, DownloadItem::INTERRUPTED);
441 } 444 }
442 445
443 // Same as above, but with a non-continuable interrupt. 446 // Same as above, but with a non-continuable interrupt.
444 TEST_F(DownloadItemTest, RestartAfterInterrupted) { 447 TEST_F(DownloadItemTest, RestartAfterInterrupted) {
445 CommandLine::ForCurrentProcess()->AppendSwitch( 448 CommandLine::ForCurrentProcess()->AppendSwitch(
446 switches::kEnableDownloadResumption); 449 switches::kEnableDownloadResumption);
447 450
451 TestBrowserContext test_browser_context;
448 DownloadItemImpl* item = CreateDownloadItem(); 452 DownloadItemImpl* item = CreateDownloadItem();
449 MockObserver observer(item); 453 MockObserver observer(item);
450 DownloadItemImplDelegate::DownloadTargetCallback callback;
451 MockDownloadFile* download_file = 454 MockDownloadFile* download_file =
452 DoIntermediateRename(item, DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS); 455 DoIntermediateRename(item, DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS);
453 456
457 EXPECT_CALL(*mock_delegate(), GetBrowserContext())
458 .WillRepeatedly(Return(&test_browser_context));
459 EXPECT_CALL(*mock_delegate(), MockResumeInterruptedDownload(_, _))
460 .Times(0);
461
454 // Interrupt the download, using a restartable interrupt. 462 // Interrupt the download, using a restartable interrupt.
455 EXPECT_CALL(*download_file, Cancel()); 463 EXPECT_CALL(*download_file, Cancel());
456 item->DestinationObserverAsWeakPtr()->DestinationError( 464 item->DestinationObserverAsWeakPtr()->DestinationError(
457 DOWNLOAD_INTERRUPT_REASON_FILE_FAILED); 465 DOWNLOAD_INTERRUPT_REASON_FILE_FAILED);
458 ASSERT_TRUE(observer.CheckUpdated()); 466 ASSERT_TRUE(observer.CheckUpdated());
459 // Should not try to auto-resume. 467 // Should not try to auto-resume.
460 ASSERT_EQ(1, observer.GetInterruptCount()); 468 ASSERT_EQ(1, observer.GetInterruptCount());
461 ASSERT_EQ(0, observer.GetResumeCount()); 469 ASSERT_EQ(0, observer.GetResumeCount());
462 RunAllPendingInMessageLoops(); 470 RunAllPendingInMessageLoops();
463 471
464 CleanupItem(item, download_file, DownloadItem::INTERRUPTED); 472 CleanupItem(item, download_file, DownloadItem::INTERRUPTED);
465 } 473 }
466 474
467 TEST_F(DownloadItemTest, LimitRestartsAfterInterrupted) { 475 TEST_F(DownloadItemTest, LimitRestartsAfterInterrupted) {
468 CommandLine::ForCurrentProcess()->AppendSwitch( 476 CommandLine::ForCurrentProcess()->AppendSwitch(
469 switches::kEnableDownloadResumption); 477 switches::kEnableDownloadResumption);
470 478
479 TestBrowserContext test_browser_context;
471 DownloadItemImpl* item = CreateDownloadItem(); 480 DownloadItemImpl* item = CreateDownloadItem();
472 base::WeakPtr<DownloadDestinationObserver> as_observer( 481 base::WeakPtr<DownloadDestinationObserver> as_observer(
473 item->DestinationObserverAsWeakPtr()); 482 item->DestinationObserverAsWeakPtr());
474 MockObserver observer(item); 483 MockObserver observer(item);
475 MockDownloadFile* mock_download_file(NULL); 484 MockDownloadFile* mock_download_file(NULL);
476 scoped_ptr<DownloadFile> download_file; 485 scoped_ptr<DownloadFile> download_file;
477 MockRequestHandle* mock_request_handle(NULL); 486 MockRequestHandle* mock_request_handle(NULL);
478 scoped_ptr<DownloadRequestHandleInterface> request_handle; 487 scoped_ptr<DownloadRequestHandle> request_handle;
479 DownloadItemImplDelegate::DownloadTargetCallback callback; 488 DownloadItemImplDelegate::DownloadTargetCallback callback;
480 489
481 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(item, _)) 490 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(item, _))
482 .WillRepeatedly(SaveArg<1>(&callback)); 491 .WillRepeatedly(SaveArg<1>(&callback));
492 EXPECT_CALL(*mock_delegate(), GetBrowserContext())
493 .WillRepeatedly(Return(&test_browser_context));
494 EXPECT_CALL(*mock_delegate(), MockResumeInterruptedDownload(_, _))
495 .Times(DownloadItemImpl::kMaxAutoResumeAttempts);
483 for (int i = 0; i < (DownloadItemImpl::kMaxAutoResumeAttempts + 1); ++i) { 496 for (int i = 0; i < (DownloadItemImpl::kMaxAutoResumeAttempts + 1); ++i) {
484 DVLOG(20) << "Loop iteration " << i; 497 DVLOG(20) << "Loop iteration " << i;
485 498
486 mock_download_file = new NiceMock<MockDownloadFile>; 499 mock_download_file = new NiceMock<MockDownloadFile>;
487 download_file.reset(mock_download_file); 500 download_file.reset(mock_download_file);
488 mock_request_handle = new NiceMock<MockRequestHandle>; 501 mock_request_handle = new NiceMock<MockRequestHandle>;
489 request_handle.reset(mock_request_handle); 502 request_handle.reset(mock_request_handle);
490 503
491 ON_CALL(*mock_download_file, FullPath()) 504 ON_CALL(*mock_download_file, FullPath())
492 .WillByDefault(Return(base::FilePath())); 505 .WillByDefault(Return(base::FilePath()));
493 506
494 // It's too complicated to set up a WebContents instance that would cause
495 // the MockDownloadItemDelegate's ResumeInterruptedDownload() function
496 // to be callled, so we simply verify that GetWebContents() is called.
497 if (i < (DownloadItemImpl::kMaxAutoResumeAttempts - 1)) {
498 EXPECT_CALL(*mock_request_handle, GetWebContents())
499 .WillRepeatedly(Return(static_cast<WebContents*>(NULL)));
500 }
501
502 // Copied key parts of DoIntermediateRename & AddDownloadFileToDownloadItem 507 // Copied key parts of DoIntermediateRename & AddDownloadFileToDownloadItem
503 // to allow for holding onto the request handle. 508 // to allow for holding onto the request handle.
504 item->Start(download_file.Pass(), request_handle.Pass()); 509 item->Start(download_file.Pass(), request_handle.Pass());
505 RunAllPendingInMessageLoops(); 510 RunAllPendingInMessageLoops();
506 if (i == 0) { 511 if (i == 0) {
507 // Target determination is only done the first time through. 512 // Target determination is only done the first time through.
508 base::FilePath target_path(kDummyPath); 513 base::FilePath target_path(kDummyPath);
509 base::FilePath intermediate_path( 514 base::FilePath intermediate_path(
510 target_path.InsertBeforeExtensionASCII("x")); 515 target_path.InsertBeforeExtensionASCII("x"));
511 EXPECT_CALL(*mock_download_file, RenameAndUniquify(intermediate_path, _)) 516 EXPECT_CALL(*mock_download_file, RenameAndUniquify(intermediate_path, _))
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 EXPECT_EQ(new_intermediate_path, item->GetFullPath()); 610 EXPECT_EQ(new_intermediate_path, item->GetFullPath());
606 611
607 CleanupItem(item, download_file, DownloadItem::IN_PROGRESS); 612 CleanupItem(item, download_file, DownloadItem::IN_PROGRESS);
608 } 613 }
609 614
610 TEST_F(DownloadItemTest, NotificationAfterTogglePause) { 615 TEST_F(DownloadItemTest, NotificationAfterTogglePause) {
611 DownloadItemImpl* item = CreateDownloadItem(); 616 DownloadItemImpl* item = CreateDownloadItem();
612 MockObserver observer(item); 617 MockObserver observer(item);
613 MockDownloadFile* mock_download_file(new MockDownloadFile); 618 MockDownloadFile* mock_download_file(new MockDownloadFile);
614 scoped_ptr<DownloadFile> download_file(mock_download_file); 619 scoped_ptr<DownloadFile> download_file(mock_download_file);
615 scoped_ptr<DownloadRequestHandleInterface> request_handle( 620 scoped_ptr<DownloadRequestHandle> request_handle(
616 new NiceMock<MockRequestHandle>); 621 new NiceMock<MockRequestHandle>);
617 622
618 EXPECT_CALL(*mock_download_file, Initialize(_)); 623 EXPECT_CALL(*mock_download_file, Initialize(_));
619 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(_, _)); 624 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(_, _));
620 item->Start(download_file.Pass(), request_handle.Pass()); 625 item->Start(download_file.Pass(), request_handle.Pass());
621 626
622 item->Pause(); 627 item->Pause();
623 ASSERT_TRUE(observer.CheckUpdated()); 628 ASSERT_TRUE(observer.CheckUpdated());
624 629
625 ASSERT_TRUE(item->IsPaused()); 630 ASSERT_TRUE(item->IsPaused());
(...skipping 28 matching lines...) Expand all
654 item->GetFileNameToReportUser().value()); 659 item->GetFileNameToReportUser().value());
655 CleanupItem(item, download_file, DownloadItem::IN_PROGRESS); 660 CleanupItem(item, download_file, DownloadItem::IN_PROGRESS);
656 } 661 }
657 662
658 // Test to make sure that Start method calls DF initialize properly. 663 // Test to make sure that Start method calls DF initialize properly.
659 TEST_F(DownloadItemTest, Start) { 664 TEST_F(DownloadItemTest, Start) {
660 MockDownloadFile* mock_download_file(new MockDownloadFile); 665 MockDownloadFile* mock_download_file(new MockDownloadFile);
661 scoped_ptr<DownloadFile> download_file(mock_download_file); 666 scoped_ptr<DownloadFile> download_file(mock_download_file);
662 DownloadItemImpl* item = CreateDownloadItem(); 667 DownloadItemImpl* item = CreateDownloadItem();
663 EXPECT_CALL(*mock_download_file, Initialize(_)); 668 EXPECT_CALL(*mock_download_file, Initialize(_));
664 scoped_ptr<DownloadRequestHandleInterface> request_handle( 669 scoped_ptr<DownloadRequestHandle> request_handle(
665 new NiceMock<MockRequestHandle>); 670 new NiceMock<MockRequestHandle>);
666 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(item, _)); 671 EXPECT_CALL(*mock_delegate(), DetermineDownloadTarget(item, _));
667 item->Start(download_file.Pass(), request_handle.Pass()); 672 item->Start(download_file.Pass(), request_handle.Pass());
668 RunAllPendingInMessageLoops(); 673 RunAllPendingInMessageLoops();
669 674
670 CleanupItem(item, mock_download_file, DownloadItem::IN_PROGRESS); 675 CleanupItem(item, mock_download_file, DownloadItem::IN_PROGRESS);
671 } 676 }
672 677
673 // Test that the delegate is invoked after the download file is renamed. 678 // Test that the delegate is invoked after the download file is renamed.
674 TEST_F(DownloadItemTest, CallbackAfterRename) { 679 TEST_F(DownloadItemTest, CallbackAfterRename) {
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 base::Unretained(&returned_path))); 1272 base::Unretained(&returned_path)));
1268 RunAllPendingInMessageLoops(); 1273 RunAllPendingInMessageLoops();
1269 EXPECT_TRUE(returned_path.empty()); 1274 EXPECT_TRUE(returned_path.empty());
1270 } 1275 }
1271 1276
1272 TEST(MockDownloadItem, Compiles) { 1277 TEST(MockDownloadItem, Compiles) {
1273 MockDownloadItem mock_item; 1278 MockDownloadItem mock_item;
1274 } 1279 }
1275 1280
1276 } // namespace content 1281 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_item_impl.cc ('k') | content/browser/download/download_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698