aboutsummaryrefslogtreecommitdiff
path: root/tests/integration/test-indicator.cpp
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-10-01 15:15:16 +0200
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-10-01 15:15:16 +0200
commit2dba91ca24ce98f866498333c7a39e20d68813f7 (patch)
treea7ccbc1f9eaf06d9cb50d766d7476fe70ffef38f /tests/integration/test-indicator.cpp
parent5d88ce9836c1d32abfd369e650354ed855ec4654 (diff)
downloadayatana-indicator-sound-2dba91ca24ce98f866498333c7a39e20d68813f7.tar.gz
ayatana-indicator-sound-2dba91ca24ce98f866498333c7a39e20d68813f7.tar.bz2
ayatana-indicator-sound-2dba91ca24ce98f866498333c7a39e20d68813f7.zip
added mechanism to wait for the gmenu to change. Added player test for the phone profile
Diffstat (limited to 'tests/integration/test-indicator.cpp')
-rw-r--r--tests/integration/test-indicator.cpp47
1 files changed, 46 insertions, 1 deletions
diff --git a/tests/integration/test-indicator.cpp b/tests/integration/test-indicator.cpp
index 82f06a4..22c0041 100644
--- a/tests/integration/test-indicator.cpp
+++ b/tests/integration/test-indicator.cpp
@@ -206,6 +206,51 @@ TEST_F(TestIndicator, PhoneAddMprisPlayer)
.action("indicator.phone-settings")
)
).match());
+
+ // initialize the signal spy
+ EXPECT_TRUE(initializeMenuChangedSignal());
+
+ // start the test player
+ EXPECT_TRUE(startTestMprisPlayer("testplayer1"));
+
+ // wait fot the menu change
+ EXPECT_TRUE(waitMenuChange());
+
+ // finally verify that the player is added
+ EXPECT_MATCHRESULT(mh::MenuMatcher(phoneParameters())
+ .item(mh::MenuItemMatcher()
+ .action("indicator.root")
+ .string_attribute("x-canonical-type", "com.canonical.indicator.root")
+ .string_attribute("x-canonical-scroll-action", "indicator.scroll")
+ .string_attribute("x-canonical-secondary-action", "indicator.mute")
+ .string_attribute("submenu-action", "indicator.indicator-shown")
+ .mode(mh::MenuItemMatcher::Mode::all)
+ .submenu()
+ .item(mh::MenuItemMatcher()
+ .section()
+ .item(silentModeSwitch(false))
+ .item(volumeSlider(INITIAL_VOLUME))
+ )
+ .item(mh::MenuItemMatcher()
+ .section()
+ .item(mh::MenuItemMatcher()
+ .action("indicator.testplayer1.desktop")
+ .label("TestPlayer1")
+ .themed_icon("icon", {"testplayer"})
+ .string_attribute("x-canonical-type", "com.canonical.unity.media-player")
+ )
+ .item(mh::MenuItemMatcher()
+ .string_attribute("x-canonical-previous-action","indicator.previous.testplayer1.desktop")
+ .string_attribute("x-canonical-play-action","indicator.play.testplayer1.desktop")
+ .string_attribute("x-canonical-next-action","indicator.next.testplayer1.desktop")
+ .string_attribute("x-canonical-type","com.canonical.unity.playback-item")
+ )
+ )
+ .item(mh::MenuItemMatcher()
+ .label("Sound Settingsā€¦")
+ .action("indicator.phone-settings")
+ )
+ ).match());
}
TEST_F(TestIndicator, DesktopBasicInitialVolume)
@@ -516,7 +561,7 @@ TEST_F(TestIndicator, DesktopChangeRoleVolume)
EXPECT_TRUE(setSinkVolume(randomVolume));
if (randomVolume != INITIAL_VOLUME)
{
- EXPECT_FALSE(waitVolumeChangedInIndicator());
+ EXPECT_TRUE(waitVolumeChangedInIndicator());
}
// check the indicator