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

Unified Diff: content/browser/download/download_item_impl_unittest.cc

Issue 11150027: Handle the case where IAttachmentExecute::Save() deletes a downloaded file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + Address comments + Update strings Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/download/download_item_impl_unittest.cc
diff --git a/content/browser/download/download_item_impl_unittest.cc b/content/browser/download/download_item_impl_unittest.cc
index bedab099c5c2880f7fcf329a8d87a4afc8c8257e..2f5ba7a6d4e0a42e049212eac5068f7412fb7591 100644
--- a/content/browser/download/download_item_impl_unittest.cc
+++ b/content/browser/download/download_item_impl_unittest.cc
@@ -78,16 +78,13 @@ ACTION_P(ScheduleRenameCallback, new_path) {
// Schedules a task to invoke the input closure on
// the UI thread. Should only be used as the action for
-// MockDownloadFile::Detach/Cancel as follows:
+// MockDownloadFile::Detach as follows:
// EXPECT_CALL(download_file, Detach(_))
-// .WillOnce(ScheduleClosure()));
-ACTION(ScheduleClosure) {
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, arg0);
-}
-
-// Similarly for scheduling a completion callback.
-ACTION(ScheduleCompleteCallback) {
- BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(arg1));
+// .WillOnce(ScheduleDetachCallback()));
+ACTION(ScheduleDetachCallback) {
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(arg0, DOWNLOAD_INTERRUPT_REASON_NONE));
}
} // namespace
@@ -508,7 +505,7 @@ TEST_F(DownloadItemTest, CallbackAfterRename) {
EXPECT_CALL(*mock_delegate(), ShouldOpenDownload(item))
.WillOnce(Return(true));
EXPECT_CALL(*download_file, Detach(_))
- .WillOnce(ScheduleClosure());
+ .WillOnce(ScheduleDetachCallback());
item->SetIsPersisted();
item->MaybeCompleteDownload();
RunAllPendingInMessageLoops();
« no previous file with comments | « content/browser/download/download_item_impl.cc ('k') | content/browser/download/download_net_log_parameters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698