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

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

Issue 10695087: Kill DownloadManagerImpl::save_page_downloads_ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 5 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
« no previous file with comments | « content/browser/download/download_manager_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 // system :-{. 546 // system :-{.
547 } 547 }
548 548
549 // Does DownloadStopped remove Download from appropriate queues? 549 // Does DownloadStopped remove Download from appropriate queues?
550 // This test tests persisted downloads. 550 // This test tests persisted downloads.
551 TEST_F(DownloadManagerTest, OnDownloadStopped_Persisted) { 551 TEST_F(DownloadManagerTest, OnDownloadStopped_Persisted) {
552 // Put a mock we have a handle to on the download manager. 552 // Put a mock we have a handle to on the download manager.
553 content::MockDownloadItem& item(AddItemToManager()); 553 content::MockDownloadItem& item(AddItemToManager());
554 int download_id = item.GetId(); 554 int download_id = item.GetId();
555 int64 db_handle = 0x7; 555 int64 db_handle = 0x7;
556 EXPECT_CALL(item, GetExternalData(_))
557 .WillOnce(Return(static_cast<DownloadItem::ExternalData*>(NULL)));
556 AddItemToHistory(item, db_handle); 558 AddItemToHistory(item, db_handle);
557 559
558 EXPECT_CALL(item, IsPersisted()) 560 EXPECT_CALL(item, IsPersisted())
559 .WillRepeatedly(Return(true)); 561 .WillRepeatedly(Return(true));
560 EXPECT_CALL(GetMockDownloadManagerDelegate(), 562 EXPECT_CALL(GetMockDownloadManagerDelegate(),
561 UpdateItemInPersistentStore(&item)); 563 UpdateItemInPersistentStore(&item));
562 EXPECT_CALL(item, GetState()) 564 EXPECT_CALL(item, GetState())
563 .WillRepeatedly(Return(DownloadItem::CANCELLED)); 565 .WillRepeatedly(Return(DownloadItem::CANCELLED));
564 EXPECT_CALL(item, GetDbHandle()) 566 EXPECT_CALL(item, GetDbHandle())
565 .WillRepeatedly(Return(db_handle)); 567 .WillRepeatedly(Return(db_handle));
566 568
567 EXPECT_CALL(item, OffThreadCancel(&GetMockDownloadFileManager())); 569 EXPECT_CALL(item, OffThreadCancel(&GetMockDownloadFileManager()));
568 download_manager_->DownloadStopped(&item); 570 download_manager_->DownloadStopped(&item);
569 EXPECT_EQ(NULL, GetActiveDownloadItem(download_id)); 571 EXPECT_EQ(NULL, GetActiveDownloadItem(download_id));
570 } 572 }
OLDNEW
« no previous file with comments | « content/browser/download/download_manager_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698