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

Side by Side Diff: dbus/bus_unittest.cc

Issue 7800023: Linux: use MessageLoopProxy instead of base::Thread in our DBus client library. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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
« no previous file with comments | « dbus/bus.cc ('k') | dbus/end_to_end_async_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 "dbus/bus.h" 5 #include "dbus/bus.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 TEST(BusTest, ShutdownAndBlockWithDBusThread) { 74 TEST(BusTest, ShutdownAndBlockWithDBusThread) {
75 // Start the D-Bus thread. 75 // Start the D-Bus thread.
76 base::Thread::Options thread_options; 76 base::Thread::Options thread_options;
77 thread_options.message_loop_type = MessageLoop::TYPE_IO; 77 thread_options.message_loop_type = MessageLoop::TYPE_IO;
78 base::Thread dbus_thread("D-Bus thread"); 78 base::Thread dbus_thread("D-Bus thread");
79 dbus_thread.StartWithOptions(thread_options); 79 dbus_thread.StartWithOptions(thread_options);
80 80
81 // Create the bus. 81 // Create the bus.
82 dbus::Bus::Options options; 82 dbus::Bus::Options options;
83 options.dbus_thread = &dbus_thread; 83 options.dbus_thread_message_loop_proxy = dbus_thread.message_loop_proxy();
84 scoped_refptr<dbus::Bus> bus = new dbus::Bus(options); 84 scoped_refptr<dbus::Bus> bus = new dbus::Bus(options);
85 ASSERT_FALSE(bus->shutdown_completed()); 85 ASSERT_FALSE(bus->shutdown_completed());
86 86
87 // Shut down synchronously. 87 // Shut down synchronously.
88 bus->ShutdownOnDBusThreadAndBlock(); 88 bus->ShutdownOnDBusThreadAndBlock();
89 EXPECT_TRUE(bus->shutdown_completed()); 89 EXPECT_TRUE(bus->shutdown_completed());
90 dbus_thread.Stop(); 90 dbus_thread.Stop();
91 } 91 }
OLDNEW
« no previous file with comments | « dbus/bus.cc ('k') | dbus/end_to_end_async_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698