mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
Add GTestDBus object
This is a helper to write unit tests using a private dbus-daemon. session_bus_up/down() are now just wrappers around a GTestDBus singleton. https://bugzilla.gnome.org/show_bug.cgi?id=672985
This commit is contained in:
committed by
David Zeuthen
parent
f8a8e90398
commit
1b5f70b5b0
@@ -741,11 +741,6 @@ test_proxy (void)
|
||||
|
||||
session_bus_up ();
|
||||
|
||||
/* TODO: wait a bit for the bus to come up.. ideally session_bus_up() won't return
|
||||
* until one can connect to the bus but that's not how things work right now
|
||||
*/
|
||||
usleep (500 * 1000);
|
||||
|
||||
error = NULL;
|
||||
connection = g_bus_get_sync (G_BUS_TYPE_SESSION,
|
||||
NULL,
|
||||
@@ -894,11 +889,7 @@ main (int argc,
|
||||
/* all the tests rely on a shared main loop */
|
||||
loop = g_main_loop_new (NULL, FALSE);
|
||||
|
||||
/* all the tests use a session bus with a well-known address that we can bring up and down
|
||||
* using session_bus_up() and session_bus_down().
|
||||
*/
|
||||
g_unsetenv ("DISPLAY");
|
||||
g_setenv ("DBUS_SESSION_BUS_ADDRESS", session_bus_get_temporary_address (), TRUE);
|
||||
g_test_dbus_unset ();
|
||||
|
||||
g_test_add_func ("/gdbus/proxy", test_proxy);
|
||||
g_test_add_func ("/gdbus/proxy/no-properties", test_no_properties);
|
||||
|
Reference in New Issue
Block a user