diff options
Diffstat (limited to 'tests/sound-menu.cc')
-rw-r--r-- | tests/sound-menu.cc | 36 |
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(§ion); @@ -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); +} + // |