Lines Matching refs:bus
5 #include "dbus/bus.h"
77 Bus::Options options;
78 scoped_refptr<Bus> bus = new Bus(options);
81 bus->GetObjectProxy("org.chromium.TestService",
87 bus->GetObjectProxy("org.chromium.TestService",
94 bus->GetObjectProxy(
100 bus->ShutdownAndBlock();
104 Bus::Options options;
105 scoped_refptr<Bus> bus = new Bus(options);
108 bus->GetObjectProxyWithOptions(
116 bus->GetObjectProxyWithOptions(
125 bus->GetObjectProxyWithOptions(
132 bus->ShutdownAndBlock();
139 // Start the D-Bus thread.
142 base::Thread dbus_thread("D-Bus thread");
145 // Create the bus.
146 Bus::Options options;
148 scoped_refptr<Bus> bus = new Bus(options);
149 ASSERT_FALSE(bus->shutdown_completed());
153 bus->RemoveObjectProxy("org.chromium.TestService",
158 bus->GetObjectProxy("org.chromium.TestService",
166 // Remove the object from the bus. This will invalidate any other usage of
170 bus->RemoveObjectProxy("org.chromium.TestService",
175 // from the bus, but not deleted from memory.
177 bus->GetObjectProxy("org.chromium.TestService",
189 bus->ShutdownOnDBusThreadAndBlock();
190 EXPECT_TRUE(bus->shutdown_completed());
195 Bus::Options options;
196 scoped_refptr<Bus> bus = new Bus(options);
199 bus->GetExportedObject(ObjectPath("/org/chromium/TestObject"));
204 bus->GetExportedObject(ObjectPath("/org/chromium/TestObject"));
210 bus->GetExportedObject(
215 bus->ShutdownAndBlock();
219 // Start the D-Bus thread.
222 base::Thread dbus_thread("D-Bus thread");
225 // Create the bus.
226 Bus::Options options;
228 scoped_refptr<Bus> bus = new Bus(options);
229 ASSERT_FALSE(bus->shutdown_completed());
232 bus->GetExportedObject(ObjectPath("/org/chromium/TestObject"));
240 bus->UnregisterExportedObject(ObjectPath("/org/chromium/TestObject"));
245 bus->GetExportedObject(ObjectPath("/org/chromium/TestObject"));
253 bus->ShutdownOnDBusThreadAndBlock();
254 EXPECT_TRUE(bus->shutdown_completed());
259 Bus::Options options;
260 scoped_refptr<Bus> bus = new Bus(options);
261 ASSERT_FALSE(bus->shutdown_completed());
264 bus->ShutdownAndBlock();
265 EXPECT_TRUE(bus->shutdown_completed());
269 // Start the D-Bus thread.
272 base::Thread dbus_thread("D-Bus thread");
275 // Create the bus.
276 Bus::Options options;
278 scoped_refptr<Bus> bus = new Bus(options);
279 ASSERT_FALSE(bus->shutdown_completed());
282 bus->ShutdownOnDBusThreadAndBlock();
283 EXPECT_TRUE(bus->shutdown_completed());
288 Bus::Options options;
289 scoped_refptr<Bus> bus = new Bus(options);
291 bus->Connect();
295 ASSERT_TRUE(bus->AddFilterFunction(&DummyHandler, &data1));
297 ASSERT_FALSE(bus->AddFilterFunction(&DummyHandler, &data1));
299 ASSERT_TRUE(bus->AddFilterFunction(&DummyHandler, &data2));
301 ASSERT_TRUE(bus->RemoveFilterFunction(&DummyHandler, &data1));
302 ASSERT_FALSE(bus->RemoveFilterFunction(&DummyHandler, &data1));
303 ASSERT_TRUE(bus->RemoveFilterFunction(&DummyHandler, &data2));
305 bus->ShutdownAndBlock();
309 Bus::Options options;
310 scoped_refptr<Bus> bus = new Bus(options);
313 bus->Connect();
316 bus->AddMatch(
321 bus->AddMatch(
327 ASSERT_TRUE(bus->RemoveMatch(
332 // The rule should be still in the bus since it was removed only once.
334 ASSERT_TRUE(bus->RemoveMatch(
340 ASSERT_FALSE(bus->RemoveMatch(
344 bus->ShutdownAndBlock();
353 // Create the bus.
354 Bus::Options bus_options;
355 scoped_refptr<Bus> bus = new Bus(bus_options);
360 Bus::GetServiceOwnerCallback callback1 =
365 bus->ListenForServiceOwnerChange("org.chromium.TestService", callback1);
367 bus->ListenForServiceOwnerChange("org.chromium.TestService", callback1);
375 ASSERT_TRUE(bus->RequestOwnershipAndBlock("org.chromium.TestService",
376 Bus::REQUIRE_PRIMARY));
383 bus->GetServiceOwnerAndBlock("org.chromium.TestService",
384 Bus::REPORT_ERRORS);
397 Bus::GetServiceOwnerCallback callback2 =
402 bus->ListenForServiceOwnerChange("org.chromium.TestService", callback2);
407 ASSERT_TRUE(bus->ReleaseOwnership("org.chromium.TestService"));
416 bus->UnlistenForServiceOwnerChange("org.chromium.TestService", callback1);
417 bus->UnlistenForServiceOwnerChange("org.chromium.TestService", callback2);
421 bus->ShutdownAndBlock();
422 EXPECT_TRUE(bus->shutdown_completed());