diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-04 00:57:39 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-04 00:57:39 +0000 |
commit | ac4c668a5d726a0aa77097b11c4e63b188d3b47c (patch) | |
tree | 08d345b0170311401ef03c9f5342b7ea46752420 /base/message_loop_unittest.cc | |
parent | 1f139d1513ac3332cf940820e8be5195ca21333a (diff) | |
download | chromium_src-ac4c668a5d726a0aa77097b11c4e63b188d3b47c.zip chromium_src-ac4c668a5d726a0aa77097b11c4e63b188d3b47c.tar.gz chromium_src-ac4c668a5d726a0aa77097b11c4e63b188d3b47c.tar.bz2 |
And now NewRunnableMethod(), you die.
Kill off NewRunnableMethod() and remove silly declarations of unused ScopedRunnableMethodFactory(s).
BUG=none
TEST=existing.
Review URL: http://codereview.chromium.org/9034032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116250 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop_unittest.cc')
-rw-r--r-- | base/message_loop_unittest.cc | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc index 01a57c8..e528286 100644 --- a/base/message_loop_unittest.cc +++ b/base/message_loop_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -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); |