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

Unified Diff: base/bind_helpers_unittest.cc

Issue 23514018: Add Reset to ScopedClosureRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
« base/bind_helpers.cc ('K') | « base/bind_helpers.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/bind_helpers_unittest.cc
diff --git a/base/bind_helpers_unittest.cc b/base/bind_helpers_unittest.cc
index 3ef2d7543540464ddefc06c14d9726078d18a2b0..26e82c48ded4a9d2fbb1ed5caee572fac28dd777 100644
--- a/base/bind_helpers_unittest.cc
+++ b/base/bind_helpers_unittest.cc
@@ -36,4 +36,16 @@ TEST(BindHelpersTest, TestScopedClosureRunnerRelease) {
EXPECT_EQ(1, run_count);
}
+TEST(BindHelpersTest, TestScopedClosureRunnerReset) {
+ int run_count_1 = 0;
+ int run_count_2 = 0;
+ {
+ base::ScopedClosureRunner runner(base::Bind(&Increment, &run_count_1));
+ runner.Reset(base::Bind(&Increment, &run_count_2));
+ EXPECT_EQ(1, run_count_1);
+ EXPECT_EQ(0, run_count_2);
+ }
+ EXPECT_EQ(1, run_count_2);
+}
+
} // namespace
« base/bind_helpers.cc ('K') | « base/bind_helpers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698