aboutsummaryrefslogtreecommitdiff
path: root/tests/integration/indicator-sound-test-base.cpp
diff options
context:
space:
mode:
authorcharles kerr <charlesk@canonical.com>2016-01-13 20:37:55 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2016-01-13 20:37:55 +0000
commite43001712810b56a1579545ecafd9f9826e7a438 (patch)
tree068221198bc1ca78180ac7106d2303cbc4e3079e /tests/integration/indicator-sound-test-base.cpp
parent9a861c0911ce8345f48909993249c8a74d8bfb2c (diff)
parent9b72c7f662440844bf59521e124f59bcbddec4a5 (diff)
downloadayatana-indicator-sound-e43001712810b56a1579545ecafd9f9826e7a438.tar.gz
ayatana-indicator-sound-e43001712810b56a1579545ecafd9f9826e7a438.tar.bz2
ayatana-indicator-sound-e43001712810b56a1579545ecafd9f9826e7a438.zip
Be more selective about when to show and dismiss the High Volume Warning Dialog. Fixes: #1504065
Approved by: PS Jenkins bot, Xavi Garcia
Diffstat (limited to 'tests/integration/indicator-sound-test-base.cpp')
-rw-r--r--tests/integration/indicator-sound-test-base.cpp24
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)