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

Unified Diff: base/task_runner_util_unittest.cc

Issue 12226007: base: Convert the remaining uses of MessageLoop::RunUntilIdle to RunLoop variant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win Created 7 years, 10 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/system_monitor/system_monitor_unittest.cc ('k') | no next file » | 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 d4d37692bace08028a619dccb7a752494cbaafdd..f02a388a43100a143f7e625bf46c884943b13392 100644
--- a/base/task_runner_util_unittest.cc
+++ b/base/task_runner_util_unittest.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/message_loop.h"
+#include "base/run_loop.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
@@ -65,31 +66,29 @@ void ExpectScopedFoo(scoped_ptr_malloc<Foo, FreeFooFunctor> foo) {
} // namespace
TEST(TaskRunnerHelpersTest, PostTaskAndReplyWithResult) {
- MessageLoop message_loop;
int result = 0;
- PostTaskAndReplyWithResult(
- message_loop.message_loop_proxy(),
- FROM_HERE,
- Bind(&ReturnFourtyTwo),
- Bind(&StoreValue, &result));
+ MessageLoop message_loop;
+ PostTaskAndReplyWithResult(message_loop.message_loop_proxy(),
+ FROM_HERE,
+ Bind(&ReturnFourtyTwo),
+ Bind(&StoreValue, &result));
- message_loop.RunUntilIdle();
+ RunLoop().RunUntilIdle();
EXPECT_EQ(42, result);
}
TEST(TaskRunnerHelpersTest, PostTaskAndReplyWithResultImplicitConvert) {
- MessageLoop message_loop;
double result = 0;
- PostTaskAndReplyWithResult(
- message_loop.message_loop_proxy(),
- FROM_HERE,
- Bind(&ReturnFourtyTwo),
- Bind(&StoreDoubleValue, &result));
+ MessageLoop message_loop;
+ PostTaskAndReplyWithResult(message_loop.message_loop_proxy(),
+ FROM_HERE,
+ Bind(&ReturnFourtyTwo),
+ Bind(&StoreDoubleValue, &result));
- message_loop.RunUntilIdle();
+ RunLoop().RunUntilIdle();
EXPECT_DOUBLE_EQ(42.0, result);
}
@@ -99,14 +98,12 @@ TEST(TaskRunnerHelpersTest, PostTaskAndReplyWithResultPassed) {
g_foo_free_count = 0;
MessageLoop message_loop;
+ PostTaskAndReplyWithResult(message_loop.message_loop_proxy(),
+ FROM_HERE,
+ Bind(&CreateFoo),
+ Bind(&ExpectFoo));
- PostTaskAndReplyWithResult(
- message_loop.message_loop_proxy(),
- FROM_HERE,
- Bind(&CreateFoo),
- Bind(&ExpectFoo));
-
- message_loop.RunUntilIdle();
+ RunLoop().RunUntilIdle();
EXPECT_EQ(1, g_foo_destruct_count);
EXPECT_EQ(0, g_foo_free_count);
@@ -117,14 +114,12 @@ TEST(TaskRunnerHelpersTest, PostTaskAndReplyWithResultPassedFreeProc) {
g_foo_free_count = 0;
MessageLoop message_loop;
+ PostTaskAndReplyWithResult(message_loop.message_loop_proxy(),
+ FROM_HERE,
+ Bind(&CreateScopedFoo),
+ Bind(&ExpectScopedFoo));
- PostTaskAndReplyWithResult(
- message_loop.message_loop_proxy(),
- FROM_HERE,
- Bind(&CreateScopedFoo),
- Bind(&ExpectScopedFoo));
-
- message_loop.RunUntilIdle();
+ RunLoop().RunUntilIdle();
EXPECT_EQ(1, g_foo_destruct_count);
EXPECT_EQ(1, g_foo_free_count);
« no previous file with comments | « base/system_monitor/system_monitor_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698