aboutsummaryrefslogtreecommitdiff
path: root/tests/integration
diff options
context:
space:
mode:
authorXavi Garcia Mena <xavi.garcia.mena@canonical.com>2016-02-22 19:50:55 +0100
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2016-02-22 19:50:55 +0100
commitba4e4b3973a00902ff0f3d9eb4650f5f61e76c78 (patch)
tree80521ced842b9c1c8b765c56ee9e08eb7916a8c8 /tests/integration
parentde4abb7448d329f7e7c20e01f8b14f22627a69a3 (diff)
downloadayatana-indicator-sound-ba4e4b3973a00902ff0f3d9eb4650f5f61e76c78.tar.gz
ayatana-indicator-sound-ba4e4b3973a00902ff0f3d9eb4650f5f61e76c78.tar.bz2
ayatana-indicator-sound-ba4e4b3973a00902ff0f3d9eb4650f5f61e76c78.zip
Changed last running player to user Accounts service
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/indicator-sound-test-base.cpp33
-rw-r--r--tests/integration/indicator-sound-test-base.h4
2 files changed, 34 insertions, 3 deletions
diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp
index f61857e..8242fb6 100644
--- a/tests/integration/indicator-sound-test-base.cpp
+++ b/tests/integration/indicator-sound-test-base.cpp
@@ -448,13 +448,40 @@ bool IndicatorSoundTestBase::initializeMenuChangedSignal()
return true;
}
-bool IndicatorSoundTestBase::waitVolumeChangedInIndicator()
+QVariant IndicatorSoundTestBase::waitPropertyChanged(QString property)
{
+ QVariant ret_val;
if (signal_spy_volume_changed_)
{
- return signal_spy_volume_changed_->wait();
+ signal_spy_volume_changed_->wait();
+ if (signal_spy_volume_changed_->count())
+ {
+ QList<QVariant> arguments = signal_spy_volume_changed_->takeFirst();
+ if (arguments.size() == 3 && static_cast<QMetaType::Type>(arguments.at(1).type()) == QMetaType::QVariantMap)
+ {
+ QVariantMap map = arguments.at(1).toMap();
+ QMapIterator<QString, QVariant> iter(map);
+ while (iter.hasNext()) {
+ iter.next();
+ if (iter.key() == property)
+ {
+ return iter.value();
+ }
+ }
+ }
+ }
}
- return false;
+ return ret_val;
+}
+bool IndicatorSoundTestBase::waitVolumeChangedInIndicator()
+{
+ QVariant val = waitPropertyChanged("Volume");
+ return !val.isNull();
+}
+
+QVariant IndicatorSoundTestBase::waitLastRunningPlayerChanged()
+{
+ return waitPropertyChanged("LastRunningPlayer");
}
void IndicatorSoundTestBase::initializeAccountsInterface()
diff --git a/tests/integration/indicator-sound-test-base.h b/tests/integration/indicator-sound-test-base.h
index 969fd69..ecdbd7d 100644
--- a/tests/integration/indicator-sound-test-base.h
+++ b/tests/integration/indicator-sound-test-base.h
@@ -144,6 +144,10 @@ protected:
float getVolumeValue(bool *isValid = nullptr);
+ QVariant waitPropertyChanged(QString property);
+
+ QVariant waitLastRunningPlayerChanged();
+
QtDBusTest::DBusTestRunner dbusTestRunner;
QtDBusMock::DBusMock dbusMock;