diff options
author | Xavi Garcia Mena <xavi.garcia.mena@canonical.com> | 2016-03-07 10:13:38 +0000 |
---|---|---|
committer | CI Train Bot <ci-train-bot@canonical.com> | 2016-03-07 10:13:38 +0000 |
commit | 57f5cbe43e95d72e0904473ab371e9e016b73956 (patch) | |
tree | b8186a4701bbafcf9fc9a71bbcb35fd9b3ee81d1 /tests/integration/test-indicator.cpp | |
parent | de4abb7448d329f7e7c20e01f8b14f22627a69a3 (diff) | |
parent | 3aa67455801c7db139be5a9293ddb6d7d703a981 (diff) | |
download | ayatana-indicator-sound-57f5cbe43e95d72e0904473ab371e9e016b73956.tar.gz ayatana-indicator-sound-57f5cbe43e95d72e0904473ab371e9e016b73956.tar.bz2 ayatana-indicator-sound-57f5cbe43e95d72e0904473ab371e9e016b73956.zip |
This branch sets the last running player using accounts service instead of gsettings.
It also includes a new class AccountsServiceAccess, to centralize all accesses to account service properties.
Approved by: PS Jenkins bot, Charles Kerr
Diffstat (limited to 'tests/integration/test-indicator.cpp')
-rw-r--r-- | tests/integration/test-indicator.cpp | 65 |
1 files changed, 61 insertions, 4 deletions
diff --git a/tests/integration/test-indicator.cpp b/tests/integration/test-indicator.cpp index 33a27af..bc426aa 100644 --- a/tests/integration/test-indicator.cpp +++ b/tests/integration/test-indicator.cpp @@ -394,9 +394,7 @@ TEST_F(TestIndicator, DesktopAddMprisPlayer) .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") ) ) @@ -925,9 +923,7 @@ TEST_F(TestIndicator, DesktopMprisPlayersPlaybackControls) .string_attribute("x-canonical-type", "com.canonical.unity.media-player") ) .item(mh::MenuItemMatcher() - .string_attribute("x-canonical-previous-action","indicator.previous.testplayer3.desktop") .string_attribute("x-canonical-play-action","indicator.play.testplayer3.desktop") - .string_attribute("x-canonical-next-action","indicator.next.testplayer3.desktop") .string_attribute("x-canonical-type","com.canonical.unity.playback-item") ) ) @@ -935,6 +931,67 @@ TEST_F(TestIndicator, DesktopMprisPlayersPlaybackControls) .label("Sound Settingsā¦") ) ).match()); + + // check that the last running player is the one we expect + QVariant lastPlayerRunning = waitLastRunningPlayerChanged(); + EXPECT_TRUE(lastPlayerRunning.type() == QVariant::String); + EXPECT_EQ(lastPlayerRunning.toString(), "testplayer3.desktop"); + + // restart the indicator to simulate a new user session + ASSERT_NO_THROW(startIndicator()); + + // check that player 3 is the only one with playback controls + // as it was the last one being stopped + EXPECT_MATCHRESULT(mh::MenuMatcher(desktopParameters()) + .item(mh::MenuItemMatcher() + .action("indicator.root") + .string_attribute("x-canonical-type", "com.canonical.indicator.root") + .string_attribute("x-canonical-secondary-action", "indicator.mute") + .mode(mh::MenuItemMatcher::Mode::all) + .submenu() + .item(mh::MenuItemMatcher() + .section() + .item(mh::MenuItemMatcher().checkbox() + .label("Mute") + ) + .item(volumeSlider(INITIAL_VOLUME, "Volume")) + ) + .item(mh::MenuItemMatcher() + .section() + .item(mh::MenuItemMatcher() + .action("indicator.testplayer3.desktop") + .label("TestPlayer3") + .themed_icon("icon", {"testplayer"}) + .string_attribute("x-canonical-type", "com.canonical.unity.media-player") + ) + .item(mh::MenuItemMatcher() + .string_attribute("x-canonical-play-action","indicator.play.testplayer3.desktop") + .string_attribute("x-canonical-type","com.canonical.unity.playback-item") + ) + ) + .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() + .section() + .item(mh::MenuItemMatcher() + .action("indicator.testplayer2.desktop") + .label("TestPlayer2") + .themed_icon("icon", {"testplayer"}) + .string_attribute("x-canonical-type", "com.canonical.unity.media-player") + ) + ) + .item(mh::MenuItemMatcher() + .label("Sound Settingsā¦") + ) + ).match()); + } TEST_F(TestIndicator, DesktopMprisPlayerButtonsState) |