diff options
author | Ted Gould <ted@gould.cx> | 2013-11-15 22:20:40 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2013-11-15 22:20:40 -0600 |
commit | fc3c64800be186946252921639c79cd712c6a4f5 (patch) | |
tree | 24624c3429f104334111a1cf31d04b8608a89c57 | |
parent | 30e3f1f9d404c77ee32d2e004c2c9327192f5872 (diff) | |
download | ayatana-indicator-sound-fc3c64800be186946252921639c79cd712c6a4f5.tar.gz ayatana-indicator-sound-fc3c64800be186946252921639c79cd712c6a4f5.tar.bz2 ayatana-indicator-sound-fc3c64800be186946252921639c79cd712c6a4f5.zip |
Make sure we can see names coming on the bus and call the acquired signal
-rw-r--r-- | tests/name-watch-test.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/name-watch-test.cc b/tests/name-watch-test.cc index 64f681d..66daadc 100644 --- a/tests/name-watch-test.cc +++ b/tests/name-watch-test.cc @@ -54,6 +54,33 @@ TEST_F(NameWatchTest, BaseWatch) &callback_count, NULL); + guint name1 = g_bus_own_name(G_BUS_TYPE_SESSION, + "com.foo.bar", + G_BUS_NAME_OWNER_FLAGS_NONE, + NULL, NULL, NULL, NULL, NULL); + guint name2 = g_bus_own_name(G_BUS_TYPE_SESSION, + "com.foo.bar_too", + G_BUS_NAME_OWNER_FLAGS_NONE, + NULL, NULL, NULL, NULL, NULL); + + g_usleep(100000); + while (g_main_pending()) + g_main_iteration(TRUE); + g_usleep(100000); + while (g_main_pending()) + g_main_iteration(TRUE); + + + ASSERT_EQ(callback_count.appeared, 2); + + g_bus_unown_name(name1); + g_bus_unown_name(name2); + + g_usleep(100000); + while (g_main_pending()) + g_main_iteration(TRUE); + + ASSERT_EQ(callback_count.vanished, 2); bus_unwatch_namespace(ns_watch); } |