diff options
author | Ted Gould <ted@gould.cx> | 2010-08-03 21:13:34 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-08-03 21:13:34 -0500 |
commit | 43e185e0c4828a5eaa0422186198d08edefd12a1 (patch) | |
tree | 690fd693cc09d2f4a6c0502d37f497edd4a60aa6 | |
parent | 6882b4cb557db5bc65f14d6b6e88f8f9667896b2 (diff) | |
download | ayatana-indicator-application-43e185e0c4828a5eaa0422186198d08edefd12a1.tar.gz ayatana-indicator-application-43e185e0c4828a5eaa0422186198d08edefd12a1.tar.bz2 ayatana-indicator-application-43e185e0c4828a5eaa0422186198d08edefd12a1.zip |
More signalling tests.
-rw-r--r-- | tests/test-libappindicator.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test-libappindicator.c b/tests/test-libappindicator.c index e6c8dcc..8d12ac5 100644 --- a/tests/test-libappindicator.c +++ b/tests/test-libappindicator.c @@ -256,9 +256,37 @@ test_libappindicator_label_signals (void) g_signal_connect(G_OBJECT(ci), APP_INDICATOR_SIGNAL_NEW_LABEL, G_CALLBACK(label_signals_cb), &label_signals_count); + /* Shouldn't be a signal as it should be stuck in idle */ app_indicator_set_label(ci, "label", "guide"); g_assert(label_signals_count == 0); + /* Should show up after idle processing */ + label_signals_check(); + g_assert(label_signals_count == 1); + + /* Shouldn't signal with no change */ + label_signals_count = 0; + app_indicator_set_label(ci, "label", "guide"); + label_signals_check(); + g_assert(label_signals_count == 0); + + /* Change one, we should get one signal */ + app_indicator_set_label(ci, "label2", "guide"); + label_signals_check(); + g_assert(label_signals_count == 1); + + /* Change several times, one signal */ + label_signals_count = 0; + app_indicator_set_label(ci, "label1", "guide0"); + app_indicator_set_label(ci, "label1", "guide1"); + app_indicator_set_label(ci, "label2", "guide2"); + app_indicator_set_label(ci, "label3", "guide3"); + label_signals_check(); + g_assert(label_signals_count == 1); + + /* Clear should signal too */ + label_signals_count = 0; + app_indicator_set_label(ci, NULL, NULL); label_signals_check(); g_assert(label_signals_count == 1); |