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

Unified Diff: base/task_runner_util_unittest.cc

Issue 10382088: Fix a leak following r135955 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Separate tests Created 8 years, 7 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 | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_runner_util_unittest.cc
diff --git a/base/task_runner_util_unittest.cc b/base/task_runner_util_unittest.cc
index eba3bd6b4f7e4b8292c65a39e9b9104fe027abad..2d0cefe150011196023f78013e68f542d1d60d2b 100644
--- a/base/task_runner_util_unittest.cc
+++ b/base/task_runner_util_unittest.cc
@@ -43,6 +43,7 @@ void ExpectFoo(scoped_ptr<Foo> foo) {
struct FreeFooFunctor {
void operator()(Foo* foo) const {
++g_foo_free_count;
+ delete foo;
};
};
@@ -90,6 +91,13 @@ TEST(TaskRunnerHelpersTest, PostTaskAndReplyWithResultPassed) {
EXPECT_EQ(1, g_foo_destruct_count);
EXPECT_EQ(0, g_foo_free_count);
+}
+
+TEST(TaskRunnerHelpersTest, PostTaskAndReplyWithResultPassedFreeProc) {
+ g_foo_destruct_count = 0;
+ g_foo_free_count = 0;
+
+ MessageLoop message_loop;
PostTaskAndReplyWithResult(
message_loop.message_loop_proxy(),
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698