aboutsummaryrefslogtreecommitdiff
path: root/tests/integration/indicator-sound-test-base.cpp
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-09-23 16:10:54 +0200
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2015-09-23 16:10:54 +0200
commiteb22c54e4587e5941378b066ec8220a56d26db4b (patch)
treeae85ae46280dc6bd1c27c85bec9413c59c264808 /tests/integration/indicator-sound-test-base.cpp
parentb9ef4f6abdefb7b1d31d34f35b742016f1b5b87f (diff)
downloadayatana-indicator-sound-eb22c54e4587e5941378b066ec8220a56d26db4b.tar.gz
ayatana-indicator-sound-eb22c54e4587e5941378b066ec8220a56d26db4b.tar.bz2
ayatana-indicator-sound-eb22c54e4587e5941378b066ec8220a56d26db4b.zip
Added test MPRIS player integration test
Diffstat (limited to 'tests/integration/indicator-sound-test-base.cpp')
-rw-r--r--tests/integration/indicator-sound-test-base.cpp36
1 files changed, 32 insertions, 4 deletions
diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp
index bbede82..2b6b3d7 100644
--- a/tests/integration/indicator-sound-test-base.cpp
+++ b/tests/integration/indicator-sound-test-base.cpp
@@ -79,6 +79,36 @@ bool IndicatorSoundTestBase::setSinkVolume(double volume)
return setVolume.exitCode() == 0;
}
+bool IndicatorSoundTestBase::clearGSettingsPlayers()
+{
+ QProcess clearPlayers;
+
+ clearPlayers.start("gsettings", QStringList()
+ << "set"
+ << "com.canonical.indicator.sound"
+ << "interested-media-players"
+ << "[]");
+ if (!clearPlayers.waitForStarted())
+ return false;
+
+ if (!clearPlayers.waitForFinished())
+ return false;
+
+ return clearPlayers.exitCode() == 0;
+}
+
+bool IndicatorSoundTestBase::startTestMprisPlayer(QString const& playerName)
+{
+ testPlayer1.terminate();
+ testPlayer1.start(MEDIA_PLAYER_MPRIS_BIN, QStringList()
+ << playerName);
+ if (!testPlayer1.waitForStarted())
+ return false;
+
+
+ return true;
+}
+
bool IndicatorSoundTestBase::startTestSound(QString const &role)
{
testSoundProcess.terminate();
@@ -218,15 +248,13 @@ mh::MenuMatcher::Parameters IndicatorSoundTestBase::phoneParameters()
void IndicatorSoundTestBase::SetUp()
{
- setenv("GSETTINGS_SCHEMA_DIR", SCHEMA_DIR, true);
- setenv("GSETTINGS_BACKEND", "memory", true);
+ setenv("XDG_DATA_DIRS", XDG_DATA_DIRS, true);
setenv("DBUS_SYSTEM_BUS_ADDRESS", dbusTestRunner.systemBus().toStdString().c_str(), true);
}
void IndicatorSoundTestBase::TearDown()
{
- unsetenv("GSETTINGS_SCHEMA_DIR");
- unsetenv("GSETTINGS_BACKEND");
+ unsetenv("XDG_DATA_DIRS");
unsetenv("PULSE_SERVER");
}