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-16 15:00:47 +0100
committerXavi Garcia Mena <xavi.garcia.mena@canonical.com>2016-03-16 15:00:47 +0100
commit2269139ef937dfd92c39cef15b5385b0070c7883 (patch)
tree7e13ff0824fca11512ce9c0df6914eafda23c7bd /tests/integration/indicator-sound-test-base.cpp
parente24fb23ad146190a7ba873abb620e2a6def0ad21 (diff)
downloadayatana-indicator-sound-2269139ef937dfd92c39cef15b5385b0070c7883.tar.gz
ayatana-indicator-sound-2269139ef937dfd92c39cef15b5385b0070c7883.tar.bz2
ayatana-indicator-sound-2269139ef937dfd92c39cef15b5385b0070c7883.zip
Changed code to get root icon, tests added
Diffstat (limited to 'tests/integration/indicator-sound-test-base.cpp')
-rw-r--r--tests/integration/indicator-sound-test-base.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp
index 9225c1d..b8608f6 100644
--- a/tests/integration/indicator-sound-test-base.cpp
+++ b/tests/integration/indicator-sound-test-base.cpp
@@ -989,6 +989,49 @@ QVariantList IndicatorSoundTestBase::getActionValue(QString const &action)
return QVariantList();
}
+QStringList IndicatorSoundTestBase::getRootIconValue(bool *isValid)
+{
+ QString result = 0;
+
+ QVariantList varList = getActionValue("root");
+ if (isValid != nullptr)
+ {
+ *isValid = false;
+ }
+ if (varList.at(0).canConvert<QDBusArgument>())
+ {
+ const QDBusArgument dbusArg = qvariant_cast<QDBusArgument>(varList.at(0));
+ if (dbusArg.currentType() == QDBusArgument::MapType)
+ {
+ QVariantMap map;
+ dbusArg >> map;
+ QVariantMap::const_iterator iter = map.find("icon");
+ if (iter != map.end())
+ {
+ const QDBusArgument iconArg = qvariant_cast<QDBusArgument>((*iter));
+ if (iconArg.currentType() == QDBusArgument::StructureType)
+ {
+ QString name;
+ QVariant iconValue;
+ iconArg.beginStructure();
+ iconArg >> name;
+ iconArg >> iconValue;
+ if (name == "themed" && iconValue.type() == QVariant::StringList)
+ {
+ if (isValid != nullptr)
+ {
+ *isValid = true;
+ }
+ }
+ iconArg.endStructure();
+ return iconValue.toStringList();
+ }
+ }
+ }
+ }
+ return QStringList();
+}
+
qlonglong IndicatorSoundTestBase::getVolumeSyncValue(bool *isValid)
{
qlonglong result = 0;