| Index: dbus/bus_unittest.cc
|
| diff --git a/dbus/bus_unittest.cc b/dbus/bus_unittest.cc
|
| index 4e7e8fd73714a6499f2aba283b647f202890fcca..4011556b3f5a63d59345d9c9e2e5c270c503e0d0 100644
|
| --- a/dbus/bus_unittest.cc
|
| +++ b/dbus/bus_unittest.cc
|
| @@ -108,6 +108,37 @@ TEST(BusTest, GetExportedObject) {
|
| bus->ShutdownAndBlock();
|
| }
|
|
|
| +TEST(BusTest, UnregisterExportedObject) {
|
| + // Start the D-Bus thread.
|
| + base::Thread::Options thread_options;
|
| + thread_options.message_loop_type = MessageLoop::TYPE_IO;
|
| + base::Thread dbus_thread("D-Bus thread");
|
| + dbus_thread.StartWithOptions(thread_options);
|
| +
|
| + // Create the bus.
|
| + dbus::Bus::Options options;
|
| + options.dbus_thread_message_loop_proxy = dbus_thread.message_loop_proxy();
|
| + scoped_refptr<dbus::Bus> bus = new dbus::Bus(options);
|
| + ASSERT_FALSE(bus->shutdown_completed());
|
| +
|
| + dbus::ExportedObject* object_proxy1 =
|
| + bus->GetExportedObject(dbus::ObjectPath("/org/chromium/TestObject"));
|
| + ASSERT_TRUE(object_proxy1);
|
| +
|
| + bus->UnregisterExportedObject(dbus::ObjectPath("/org/chromium/TestObject"));
|
| +
|
| + // This should return a new object.
|
| + dbus::ExportedObject* object_proxy2 =
|
| + bus->GetExportedObject(dbus::ObjectPath("/org/chromium/TestObject"));
|
| + ASSERT_TRUE(object_proxy2);
|
| + EXPECT_NE(object_proxy1, object_proxy2);
|
| +
|
| + // Shut down synchronously.
|
| + bus->ShutdownOnDBusThreadAndBlock();
|
| + EXPECT_TRUE(bus->shutdown_completed());
|
| + dbus_thread.Stop();
|
| +}
|
| +
|
| TEST(BusTest, ShutdownAndBlock) {
|
| dbus::Bus::Options options;
|
| scoped_refptr<dbus::Bus> bus = new dbus::Bus(options);
|
|
|