aboutsummaryrefslogtreecommitdiff
path: root/tests/integration/indicator-sound-test-base.cpp
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2016-03-07 10:13:38 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2016-03-07 10:13:38 +0000
commit57f5cbe43e95d72e0904473ab371e9e016b73956 (patch)
treeb8186a4701bbafcf9fc9a71bbcb35fd9b3ee81d1 /tests/integration/indicator-sound-test-base.cpp
parentde4abb7448d329f7e7c20e01f8b14f22627a69a3 (diff)
parent3aa67455801c7db139be5a9293ddb6d7d703a981 (diff)
downloadayatana-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/indicator-sound-test-base.cpp')
-rw-r--r--tests/integration/indicator-sound-test-base.cpp32
1 files changed, 28 insertions, 4 deletions
diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp
index f61857e..cf60868 100644
--- a/tests/integration/indicator-sound-test-base.cpp
+++ b/tests/integration/indicator-sound-test-base.cpp
@@ -448,13 +448,37 @@ bool IndicatorSoundTestBase::initializeMenuChangedSignal()
return true;
}
-bool IndicatorSoundTestBase::waitVolumeChangedInIndicator()
+QVariant IndicatorSoundTestBase::waitPropertyChanged(QSignalSpy *signalSpy, QString property)
{
- if (signal_spy_volume_changed_)
+ QVariant ret_val;
+ if (signalSpy)
{
- return signal_spy_volume_changed_->wait();
+ signalSpy->wait();
+ if (signalSpy->count())
+ {
+ QList<QVariant> arguments = signalSpy->takeLast();
+ if (arguments.size() == 3 && static_cast<QMetaType::Type>(arguments.at(1).type()) == QMetaType::QVariantMap)
+ {
+ QMap<QString, QVariant> map = arguments.at(1).toMap();
+ QMap<QString, QVariant>::iterator iter = map.find(property);
+ if (iter != map.end())
+ {
+ return iter.value();
+ }
+ }
+ }
}
- return false;
+ return ret_val;
+}
+bool IndicatorSoundTestBase::waitVolumeChangedInIndicator()
+{
+ QVariant val = waitPropertyChanged(signal_spy_volume_changed_.get(), "Volume");
+ return !val.isNull();
+}
+
+QVariant IndicatorSoundTestBase::waitLastRunningPlayerChanged()
+{
+ return waitPropertyChanged(signal_spy_volume_changed_.get(), "LastRunningPlayer");
}
void IndicatorSoundTestBase::initializeAccountsInterface()