| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 dbus::ExportedObject* object_proxy3 = | 102 dbus::ExportedObject* object_proxy3 = |
| 103 bus->GetExportedObject( | 103 bus->GetExportedObject( |
| 104 dbus::ObjectPath("/org/chromium/DifferentTestObject")); | 104 dbus::ObjectPath("/org/chromium/DifferentTestObject")); |
| 105 ASSERT_TRUE(object_proxy3); | 105 ASSERT_TRUE(object_proxy3); |
| 106 EXPECT_NE(object_proxy1, object_proxy3); | 106 EXPECT_NE(object_proxy1, object_proxy3); |
| 107 | 107 |
| 108 bus->ShutdownAndBlock(); | 108 bus->ShutdownAndBlock(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 // http://crbug.com/137846 | 111 // http://crbug.com/137846 |
| 112 TEST(BusTest, FLAKY_UnregisterExportedObject) { | 112 TEST(BusTest, DISABLED_UnregisterExportedObject) { |
| 113 // Start the D-Bus thread. | 113 // Start the D-Bus thread. |
| 114 base::Thread::Options thread_options; | 114 base::Thread::Options thread_options; |
| 115 thread_options.message_loop_type = MessageLoop::TYPE_IO; | 115 thread_options.message_loop_type = MessageLoop::TYPE_IO; |
| 116 base::Thread dbus_thread("D-Bus thread"); | 116 base::Thread dbus_thread("D-Bus thread"); |
| 117 dbus_thread.StartWithOptions(thread_options); | 117 dbus_thread.StartWithOptions(thread_options); |
| 118 | 118 |
| 119 // Create the bus. | 119 // Create the bus. |
| 120 dbus::Bus::Options options; | 120 dbus::Bus::Options options; |
| 121 options.dbus_thread_message_loop_proxy = dbus_thread.message_loop_proxy(); | 121 options.dbus_thread_message_loop_proxy = dbus_thread.message_loop_proxy(); |
| 122 scoped_refptr<dbus::Bus> bus = new dbus::Bus(options); | 122 scoped_refptr<dbus::Bus> bus = new dbus::Bus(options); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 ASSERT_FALSE(bus->AddFilterFunction(&DummyHandler, &data1)); | 182 ASSERT_FALSE(bus->AddFilterFunction(&DummyHandler, &data1)); |
| 183 // Can add the same function with different data. | 183 // Can add the same function with different data. |
| 184 ASSERT_TRUE(bus->AddFilterFunction(&DummyHandler, &data2)); | 184 ASSERT_TRUE(bus->AddFilterFunction(&DummyHandler, &data2)); |
| 185 | 185 |
| 186 ASSERT_TRUE(bus->RemoveFilterFunction(&DummyHandler, &data1)); | 186 ASSERT_TRUE(bus->RemoveFilterFunction(&DummyHandler, &data1)); |
| 187 ASSERT_FALSE(bus->RemoveFilterFunction(&DummyHandler, &data1)); | 187 ASSERT_FALSE(bus->RemoveFilterFunction(&DummyHandler, &data1)); |
| 188 ASSERT_TRUE(bus->RemoveFilterFunction(&DummyHandler, &data2)); | 188 ASSERT_TRUE(bus->RemoveFilterFunction(&DummyHandler, &data2)); |
| 189 | 189 |
| 190 bus->ShutdownAndBlock(); | 190 bus->ShutdownAndBlock(); |
| 191 } | 191 } |
| OLD | NEW |