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

Side by Side Diff: base/message_loop_proxy_impl_unittest.cc

Issue 8888021: Remove MessageLoop::QuitTask() from base. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: *sigh* Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/message_pump_glib_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/message_loop_proxy_impl.h" 5 #include "base/message_loop_proxy_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
11 #include "base/threading/thread.h" 11 #include "base/threading/thread.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "testing/platform_test.h" 13 #include "testing/platform_test.h"
14 14
15 15
16 class MessageLoopProxyImplTest : public testing::Test { 16 class MessageLoopProxyImplTest : public testing::Test {
17 public: 17 public:
18 void Release() const { 18 void Release() const {
19 AssertOnIOThread(); 19 AssertOnIOThread();
20 Quit(); 20 Quit();
21 } 21 }
22 22
23 void Quit() const { 23 void Quit() const {
24 loop_.PostTask(FROM_HERE, new MessageLoop::QuitTask); 24 loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure());
25 } 25 }
26 26
27 void AssertOnIOThread() const { 27 void AssertOnIOThread() const {
28 ASSERT_TRUE(io_thread_->message_loop_proxy()->BelongsToCurrentThread()); 28 ASSERT_TRUE(io_thread_->message_loop_proxy()->BelongsToCurrentThread());
29 ASSERT_EQ(io_thread_->message_loop_proxy(), 29 ASSERT_EQ(io_thread_->message_loop_proxy(),
30 base::MessageLoopProxy::current()); 30 base::MessageLoopProxy::current());
31 } 31 }
32 32
33 void AssertOnFileThread() const { 33 void AssertOnFileThread() const {
34 ASSERT_TRUE(file_thread_->message_loop_proxy()->BelongsToCurrentThread()); 34 ASSERT_TRUE(file_thread_->message_loop_proxy()->BelongsToCurrentThread());
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 scoped_ptr<base::Thread> test_thread( 168 scoped_ptr<base::Thread> test_thread(
169 new base::Thread("MessageLoopProxyImplTest_Dummy")); 169 new base::Thread("MessageLoopProxyImplTest_Dummy"));
170 test_thread->Start(); 170 test_thread->Start();
171 message_loop_proxy = test_thread->message_loop_proxy(); 171 message_loop_proxy = test_thread->message_loop_proxy();
172 } 172 }
173 bool ret = message_loop_proxy->PostTask( 173 bool ret = message_loop_proxy->PostTask(
174 FROM_HERE, 174 FROM_HERE,
175 base::Bind(&MessageLoopProxyImplTest::AssertNotRun)); 175 base::Bind(&MessageLoopProxyImplTest::AssertNotRun));
176 EXPECT_FALSE(ret); 176 EXPECT_FALSE(ret);
177 } 177 }
OLDNEW
« no previous file with comments | « no previous file | base/message_pump_glib_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698