diff options
author | skyostil <skyostil@chromium.org> | 2015-06-05 07:20:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-05 14:21:03 +0000 |
commit | 5d18b2493af36d77d3c491854e3d56f46f5f747c (patch) | |
tree | 23ff6852c9f044115ba2694d1bc76aae05e6c842 /content/browser/browser_thread_unittest.cc | |
parent | ca894ec12feb1a5166bdc639d87f915513627637 (diff) | |
download | chromium_src-5d18b2493af36d77d3c491854e3d56f46f5f747c.zip chromium_src-5d18b2493af36d77d3c491854e3d56f46f5f747c.tar.gz chromium_src-5d18b2493af36d77d3c491854e3d56f46f5f747c.tar.bz2 |
content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs
This patch was mostly autogenerated with
https://codereview.chromium.org/1010073002/.
BUG=465354
TBR=nick@chromium.org
Review URL: https://codereview.chromium.org/1159623009
Cr-Commit-Position: refs/heads/master@{#333043}
Diffstat (limited to 'content/browser/browser_thread_unittest.cc')
-rw-r--r-- | content/browser/browser_thread_unittest.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/content/browser/browser_thread_unittest.cc b/content/browser/browser_thread_unittest.cc index 3f1f8cd..9b23057 100644 --- a/content/browser/browser_thread_unittest.cc +++ b/content/browser/browser_thread_unittest.cc @@ -4,10 +4,10 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/location.h" #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_loop.h" -#include "base/message_loop/message_loop_proxy.h" #include "base/sequenced_task_runner_helpers.h" +#include "base/single_thread_task_runner.h" #include "content/browser/browser_thread_impl.h" #include "content/public/test/test_browser_thread.h" #include "testing/gtest/include/gtest/gtest.h" @@ -19,7 +19,7 @@ class BrowserThreadTest : public testing::Test { public: void Release() const { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - loop_.PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); + loop_.task_runner()->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } protected: @@ -37,7 +37,8 @@ class BrowserThreadTest : public testing::Test { static void BasicFunction(base::MessageLoop* message_loop) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); + message_loop->task_runner()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); } class DeletedOnFile @@ -53,7 +54,8 @@ class BrowserThreadTest : public testing::Test { ~DeletedOnFile() { CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - message_loop_->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); + message_loop_->task_runner()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); } base::MessageLoop* message_loop_; @@ -88,24 +90,24 @@ TEST_F(BrowserThreadTest, ReleasedOnCorrectThread) { base::MessageLoop::current()->Run(); } -TEST_F(BrowserThreadTest, PostTaskViaMessageLoopProxy) { - scoped_refptr<base::MessageLoopProxy> message_loop_proxy = +TEST_F(BrowserThreadTest, PostTaskViaTaskRunner) { + scoped_refptr<base::SingleThreadTaskRunner> task_runner = BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE); - message_loop_proxy->PostTask( + task_runner->PostTask( FROM_HERE, base::Bind(&BasicFunction, base::MessageLoop::current())); base::MessageLoop::current()->Run(); } -TEST_F(BrowserThreadTest, ReleaseViaMessageLoopProxy) { - scoped_refptr<base::MessageLoopProxy> message_loop_proxy = +TEST_F(BrowserThreadTest, ReleaseViaTaskRunner) { + scoped_refptr<base::SingleThreadTaskRunner> task_runner = BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI); - message_loop_proxy->ReleaseSoon(FROM_HERE, this); + task_runner->ReleaseSoon(FROM_HERE, this); base::MessageLoop::current()->Run(); } TEST_F(BrowserThreadTest, PostTaskAndReply) { // Most of the heavy testing for PostTaskAndReply() is done inside the - // MessageLoopProxy test. This just makes sure we get piped through at all. + // task runner test. This just makes sure we get piped through at all. ASSERT_TRUE(BrowserThread::PostTaskAndReply( BrowserThread::FILE, FROM_HERE, |