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

Side by Side Diff: base/message_loop_proxy_impl_unittest.cc

Issue 7529003: Make base::MessageLoops have names at construction time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add name argument to MessageLoop Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
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/threading/thread.h" 10 #include "base/threading/thread.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "testing/platform_test.h" 12 #include "testing/platform_test.h"
13 13
14 14
15 class MessageLoopProxyImplTest : public testing::Test { 15 class MessageLoopProxyImplTest : public testing::Test {
16 public: 16 public:
17 MessageLoopProxyImplTest() : loop_("MessageLoopProxyImplTest") { }
17 void Release() const { 18 void Release() const {
18 AssertOnIOThread(); 19 AssertOnIOThread();
19 Quit(); 20 Quit();
20 } 21 }
21 22
22 void Quit() const { 23 void Quit() const {
23 loop_.PostTask(FROM_HERE, new MessageLoop::QuitTask); 24 loop_.PostTask(FROM_HERE, new MessageLoop::QuitTask);
24 } 25 }
25 26
26 void AssertOnIOThread() const { 27 void AssertOnIOThread() const {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 scoped_ptr<base::Thread> test_thread( 164 scoped_ptr<base::Thread> test_thread(
164 new base::Thread("MessageLoopProxyImplTest_Dummy")); 165 new base::Thread("MessageLoopProxyImplTest_Dummy"));
165 test_thread->Start(); 166 test_thread->Start();
166 message_loop_proxy = test_thread->message_loop_proxy(); 167 message_loop_proxy = test_thread->message_loop_proxy();
167 } 168 }
168 bool ret = message_loop_proxy->PostTask( 169 bool ret = message_loop_proxy->PostTask(
169 FROM_HERE, 170 FROM_HERE,
170 base::Bind(&MessageLoopProxyImplTest::AssertNotRun)); 171 base::Bind(&MessageLoopProxyImplTest::AssertNotRun));
171 EXPECT_FALSE(ret); 172 EXPECT_FALSE(ret);
172 } 173 }
OLDNEW
« base/message_loop.h ('K') | « base/message_loop.cc ('k') | base/message_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698