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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // This should not. | 101 // This should not. |
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 TEST(BusTest, UnregisterExportedObject) { | 111 // http://crbug.com/137846 |
| 112 TEST(BusTest, FLAKY_UnregisterExportedObject) { |
112 // Start the D-Bus thread. | 113 // Start the D-Bus thread. |
113 base::Thread::Options thread_options; | 114 base::Thread::Options thread_options; |
114 thread_options.message_loop_type = MessageLoop::TYPE_IO; | 115 thread_options.message_loop_type = MessageLoop::TYPE_IO; |
115 base::Thread dbus_thread("D-Bus thread"); | 116 base::Thread dbus_thread("D-Bus thread"); |
116 dbus_thread.StartWithOptions(thread_options); | 117 dbus_thread.StartWithOptions(thread_options); |
117 | 118 |
118 // Create the bus. | 119 // Create the bus. |
119 dbus::Bus::Options options; | 120 dbus::Bus::Options options; |
120 options.dbus_thread_message_loop_proxy = dbus_thread.message_loop_proxy(); | 121 options.dbus_thread_message_loop_proxy = dbus_thread.message_loop_proxy(); |
121 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... |
181 ASSERT_FALSE(bus->AddFilterFunction(&DummyHandler, &data1)); | 182 ASSERT_FALSE(bus->AddFilterFunction(&DummyHandler, &data1)); |
182 // Can add the same function with different data. | 183 // Can add the same function with different data. |
183 ASSERT_TRUE(bus->AddFilterFunction(&DummyHandler, &data2)); | 184 ASSERT_TRUE(bus->AddFilterFunction(&DummyHandler, &data2)); |
184 | 185 |
185 ASSERT_TRUE(bus->RemoveFilterFunction(&DummyHandler, &data1)); | 186 ASSERT_TRUE(bus->RemoveFilterFunction(&DummyHandler, &data1)); |
186 ASSERT_FALSE(bus->RemoveFilterFunction(&DummyHandler, &data1)); | 187 ASSERT_FALSE(bus->RemoveFilterFunction(&DummyHandler, &data1)); |
187 ASSERT_TRUE(bus->RemoveFilterFunction(&DummyHandler, &data2)); | 188 ASSERT_TRUE(bus->RemoveFilterFunction(&DummyHandler, &data2)); |
188 | 189 |
189 bus->ShutdownAndBlock(); | 190 bus->ShutdownAndBlock(); |
190 } | 191 } |
OLD | NEW |