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

Unified Diff: base/callback_unittest.cc

Issue 2753953003: Remove RunMixin from base::Callback implementation (Closed)
Patch Set: rebase Created 3 years, 9 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/callback.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/callback_unittest.cc
diff --git a/base/callback_unittest.cc b/base/callback_unittest.cc
index a41736946a13f5f6c9b6c3d1492c0a93d153c476..455c2740e6922e263b35a4d0a5df7e4ee509fd72 100644
--- a/base/callback_unittest.cc
+++ b/base/callback_unittest.cc
@@ -148,6 +148,23 @@ TEST_F(CallbackTest, ResetAndReturn) {
ASSERT_TRUE(tfr.cb_already_run);
}
+TEST_F(CallbackTest, NullAfterMoveRun) {
+ Closure cb = Bind([] {});
+ ASSERT_TRUE(cb);
+ std::move(cb).Run();
+ ASSERT_FALSE(cb);
+
+ const Closure cb2 = Bind([] {});
+ ASSERT_TRUE(cb2);
+ std::move(cb2).Run();
+ ASSERT_TRUE(cb2);
+
+ OnceClosure cb3 = BindOnce([] {});
+ ASSERT_TRUE(cb3);
+ std::move(cb3).Run();
+ ASSERT_FALSE(cb3);
+}
+
class CallbackOwner : public base::RefCounted<CallbackOwner> {
public:
explicit CallbackOwner(bool* deleted) {
« no previous file with comments | « base/callback.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698