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

Unified Diff: base/message_loop_unittest.cc

Issue 9034032: And now NewRunnableMethod(), you die. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chrome_frame_automation Created 8 years, 12 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.pump ('k') | base/message_pump_glib_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop_unittest.cc
diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc
index 01a57c876121fa8599dcc785899a757a22421650..a4f732a3c5dd8666f830f037a84bb3901ca78402 100644
--- a/base/message_loop_unittest.cc
+++ b/base/message_loop_unittest.cc
@@ -81,38 +81,6 @@ class Foo : public base::RefCounted<Foo> {
std::string result_;
};
-// TODO(ajwong): Remove this once we've finished getting rid of the PostTask()
-// compatibility methods.
-void RunTest_PostLegacyTask(MessageLoop::Type message_loop_type) {
- MessageLoop loop(message_loop_type);
-
- // Add tests to message loop
- scoped_refptr<Foo> foo(new Foo());
- std::string a("a"), b("b"), c("c"), d("d");
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- foo.get(), &Foo::Test0));
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- foo.get(), &Foo::Test1ConstRef, a));
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- foo.get(), &Foo::Test1Ptr, &b));
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- foo.get(), &Foo::Test1Int, 100));
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- foo.get(), &Foo::Test2Ptr, &a, &c));
- MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- foo.get(), &Foo::Test2Mixed, a, &d));
-
- // After all tests, post a message that will shut down the message loop
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
- &MessageLoop::Quit, base::Unretained(MessageLoop::current())));
-
- // Now kick things off
- MessageLoop::current()->Run();
-
- EXPECT_EQ(foo->test_count(), 105);
- EXPECT_EQ(foo->result(), "abacad");
-}
-
void RunTest_PostTask(MessageLoop::Type message_loop_type) {
MessageLoop loop(message_loop_type);
@@ -1299,12 +1267,6 @@ void RunTest_WaitForIO() {
// that message loops work properly in all configurations. Of course, in some
// cases, a unit test may only be for a particular type of loop.
-TEST(MessageLoopTest, PostLegacyTask) {
- RunTest_PostLegacyTask(MessageLoop::TYPE_DEFAULT);
- RunTest_PostLegacyTask(MessageLoop::TYPE_UI);
- RunTest_PostLegacyTask(MessageLoop::TYPE_IO);
-}
-
TEST(MessageLoopTest, PostTask) {
RunTest_PostTask(MessageLoop::TYPE_DEFAULT);
RunTest_PostTask(MessageLoop::TYPE_UI);
« no previous file with comments | « base/callback.h.pump ('k') | base/message_pump_glib_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698