aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2016-02-04 14:49:30 +0100
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2016-02-04 14:49:30 +0100
commit028e56ca8e6fa0c45f163d2ec0923053f71deb33 (patch)
tree8550d337f95ba2d2af863a8a575450c7ca40afbf /tests
parent46f1c75cfbceb69a4f948e935e8661a904b0cf2e (diff)
downloadayatana-indicator-sound-028e56ca8e6fa0c45f163d2ec0923053f71deb33.tar.gz
ayatana-indicator-sound-028e56ca8e6fa0c45f163d2ec0923053f71deb33.tar.bz2
ayatana-indicator-sound-028e56ca8e6fa0c45f163d2ec0923053f71deb33.zip
Added Charles suggestions
Diffstat (limited to 'tests')
-rw-r--r--tests/sound-menu.cc36
1 files changed, 33 insertions, 3 deletions
diff --git a/tests/sound-menu.cc b/tests/sound-menu.cc
index 9f0181c..895b723 100644
--- a/tests/sound-menu.cc
+++ b/tests/sound-menu.cc
@@ -96,9 +96,22 @@ class SoundMenuTest : public ::testing::Test
/* Player control */
verify_item_attribute(section, 1, "x-canonical-type", g_variant_new_string("com.canonical.unity.playback-item"));
- verify_item_attribute(section, 1, "x-canonical-play-action", g_variant_new_string(canPlay ? "indicator.play.player-id" : "indicator.play.player-id.disabled"));
- verify_item_attribute(section, 1, "x-canonical-next-action", g_variant_new_string(canNext ? "indicator.next.player-id" : "indicator.next.player-id.disabled"));
- verify_item_attribute(section, 1, "x-canonical-previous-action", g_variant_new_string(canPrev ? "indicator.previous.player-id" : "indicator.previous.player-id.disabled"));
+ //verify_item_attribute(section, 1, "x-canonical-play-action", g_variant_new_string(""));
+ if (!canPlay) {
+ verify_item_attribute_is_not_set(section, 1, "x-canonical-play-action", G_VARIANT_TYPE_STRING);
+ } else {
+ verify_item_attribute(section, 1, "x-canonical-play-action", g_variant_new_string("indicator.play.player-id"));
+ }
+ if (!canNext) {
+ verify_item_attribute_is_not_set(section, 1, "x-canonical-next-action", G_VARIANT_TYPE_STRING);
+ } else {
+ verify_item_attribute(section, 1, "x-canonical-next-action", g_variant_new_string("indicator.next.player-id"));
+ }
+ if (!canPrev) {
+ verify_item_attribute_is_not_set(section, 1, "x-canonical-previous-action", G_VARIANT_TYPE_STRING);
+ } else {
+ verify_item_attribute(section, 1, "x-canonical-previous-action", g_variant_new_string("indicator.previous.player-id"));
+ }
g_clear_object(&section);
@@ -170,4 +183,21 @@ TEST_F(SoundMenuTest, AddRemovePlayer) {
return;
}
+
+TEST_F(SoundMenuTest, AddRemovePlayerNoPlayNextPrev) {
+ check_player_control_buttons(false, false, false);
+}
+
+TEST_F(SoundMenuTest, AddRemovePlayerNoNext) {
+ check_player_control_buttons(true, false, true);
+}
+
+TEST_F(SoundMenuTest, AddRemovePlayerNoPrev) {
+ check_player_control_buttons(true, true, false);
+}
+
+TEST_F(SoundMenuTest, AddRemovePlayerNoPlay) {
+ check_player_control_buttons(false, true, true);
+}
+
//