diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2016-03-21 13:40:11 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2016-03-21 13:40:11 -0500 |
commit | 7a25132c125f6e5e413ad26ea950ae22bee982f5 (patch) | |
tree | 1870caed0aec4960053bd9e5125574dbcb48b08c /tests/utils/qt-fixture.h | |
parent | 45709c48f34e0909c1309dccac1dd3e047f518fb (diff) | |
download | ayatana-indicator-display-7a25132c125f6e5e413ad26ea950ae22bee982f5.tar.gz ayatana-indicator-display-7a25132c125f6e5e413ad26ea950ae22bee982f5.tar.bz2 ayatana-indicator-display-7a25132c125f6e5e413ad26ea950ae22bee982f5.zip |
if our USB device is disconnected while prompting the user for ADBD, cancel the prompt.
Diffstat (limited to 'tests/utils/qt-fixture.h')
-rw-r--r-- | tests/utils/qt-fixture.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/utils/qt-fixture.h b/tests/utils/qt-fixture.h index 321d56e..0f5722b 100644 --- a/tests/utils/qt-fixture.h +++ b/tests/utils/qt-fixture.h @@ -22,12 +22,13 @@ #define QT_NO_KEYWORDS #include <tests/utils/dbus-types.h> -#include <tests/utils/qdbus-helpers.h> #include <tests/utils/glib-fixture.h> #include <tests/utils/gtest-qt-print-helpers.h> #include <gtest/gtest.h> +#include <QDBusArgument> +#include <QVariant> #include <QSignalSpy> class QtFixture: public GlibFixture @@ -54,5 +55,20 @@ protected: ASSERT_EQ(signalsExpected, signalSpy.size()); } + + bool qDBusArgumentToMap(QVariant const& variant, QVariantMap& map) + { + if (variant.canConvert<QDBusArgument>()) + { + QDBusArgument value(variant.value<QDBusArgument>()); + if (value.currentType() == QDBusArgument::MapType) + { + value >> map; + return true; + } + } + + return false; + } }; |