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

Unified Diff: base/threading/post_task_and_reply_impl_unittest.cc

Issue 2122543002: Replace Closure in TaskRunner::PostTask with OneShotCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@07_oneshot
Patch Set: fix Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/threading/post_task_and_reply_impl.cc ('k') | base/threading/sequenced_worker_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/post_task_and_reply_impl_unittest.cc
diff --git a/base/threading/post_task_and_reply_impl_unittest.cc b/base/threading/post_task_and_reply_impl_unittest.cc
index 8c6faaf8c0afc9a8d01a999f8238c4ecf8823556..bb4a950f916fbdbc7427ea47908ec6a93fa90c44 100644
--- a/base/threading/post_task_and_reply_impl_unittest.cc
+++ b/base/threading/post_task_and_reply_impl_unittest.cc
@@ -27,8 +27,8 @@ class PostTaskAndReplyTaskRunner : public internal::PostTaskAndReplyImpl {
private:
bool PostTask(const tracked_objects::Location& from_here,
- const Closure& task) override {
- return destination_->PostTask(from_here, task);
+ OnceClosure task) override {
+ return destination_->PostTask(from_here, std::move(task));
}
// Non-owning.
@@ -97,8 +97,8 @@ TEST(PostTaskAndReplyImplTest, PostTaskAndReply) {
post_runner->RunUntilIdle();
testing::Mock::VerifyAndClear(&mock_object);
- // Expect the task's argument not to have been deleted yet.
- EXPECT_FALSE(delete_flag);
+ // Expect the task's argument to have been deleted on the target task runner.
+ EXPECT_TRUE(delete_flag);
// Expect the reply to be posted to |reply_runner|.
EXPECT_FALSE(post_runner->HasPendingTask());
@@ -106,7 +106,6 @@ TEST(PostTaskAndReplyImplTest, PostTaskAndReply) {
EXPECT_CALL(mock_object, ReplyMock());
reply_runner->RunUntilIdle();
testing::Mock::VerifyAndClear(&mock_object);
- EXPECT_TRUE(delete_flag);
// Expect no pending task in |post_runner| and |reply_runner|.
EXPECT_FALSE(post_runner->HasPendingTask());
« no previous file with comments | « base/threading/post_task_and_reply_impl.cc ('k') | base/threading/sequenced_worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698