diff options
Diffstat (limited to 'tests/integration/indicator-sound-test-base.cpp')
-rw-r--r-- | tests/integration/indicator-sound-test-base.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp index 3b9c58d..91abf42 100644 --- a/tests/integration/indicator-sound-test-base.cpp +++ b/tests/integration/indicator-sound-test-base.cpp @@ -163,13 +163,31 @@ bool IndicatorSoundTestBase::clearGSettingsPlayers() << "com.canonical.indicator.sound" << "interested-media-players" << "[]"); - if (!clearPlayers.waitForStarted()) + + return runProcess(clearPlayers); +} + +bool IndicatorSoundTestBase::resetAllowAmplifiedVolume() +{ + QProcess proc; + + proc.start("gsettings", QStringList() + << "reset" + << "com.ubuntu.sound" + << "allow-amplified-volume"); + + return runProcess(proc); +} + +bool IndicatorSoundTestBase::runProcess(QProcess& proc) +{ + if (!proc.waitForStarted()) return false; - if (!clearPlayers.waitForFinished()) + if (!proc.waitForFinished()) return false; - return clearPlayers.exitCode() == 0; + return proc.exitCode() == 0; } bool IndicatorSoundTestBase::startTestMprisPlayer(QString const& playerName) |