diff options
Diffstat (limited to 'chromium/base/callback_unittest.cc')
-rw-r--r-- | chromium/base/callback_unittest.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chromium/base/callback_unittest.cc b/chromium/base/callback_unittest.cc index 783f3bad4f5..a41736946a1 100644 --- a/chromium/base/callback_unittest.cc +++ b/chromium/base/callback_unittest.cc @@ -115,6 +115,17 @@ TEST_F(CallbackTest, Reset) { EXPECT_TRUE(callback_a_.Equals(null_callback_)); } +TEST_F(CallbackTest, Move) { + // Moving should reset the callback. + ASSERT_FALSE(callback_a_.is_null()); + ASSERT_FALSE(callback_a_.Equals(null_callback_)); + + auto tmp = std::move(callback_a_); + + EXPECT_TRUE(callback_a_.is_null()); + EXPECT_TRUE(callback_a_.Equals(null_callback_)); +} + struct TestForReentrancy { TestForReentrancy() : cb_already_run(false), |