aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-03-17 09:59:32 -0500
committerCharles Kerr <charles.kerr@canonical.com>2016-03-17 09:59:32 -0500
commitc63d90da0f1d9cbd1eee5dd66a9828c51cc8dcc9 (patch)
treeb5ef7bc596476d6d64f128a7a12e5dd002eafe57 /tests
parent65eba5e107b0499aec4bed55be202bf1df6710bb (diff)
downloadayatana-indicator-display-c63d90da0f1d9cbd1eee5dd66a9828c51cc8dcc9.tar.gz
ayatana-indicator-display-c63d90da0f1d9cbd1eee5dd66a9828c51cc8dcc9.tar.bz2
ayatana-indicator-display-c63d90da0f1d9cbd1eee5dd66a9828c51cc8dcc9.zip
de-dupe use of dbus names
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/usb-manager-test.cpp13
-rw-r--r--tests/unit/usb-snap-test.cpp13
-rw-r--r--tests/utils/dbus-types.h5
3 files changed, 14 insertions, 17 deletions
diff --git a/tests/integration/usb-manager-test.cpp b/tests/integration/usb-manager-test.cpp
index 5e3377d..82c170e 100644
--- a/tests/integration/usb-manager-test.cpp
+++ b/tests/integration/usb-manager-test.cpp
@@ -25,6 +25,7 @@
#include <tests/utils/gtest-qt-print-helpers.h>
#include <tests/utils/qdbus-helpers.h>
+#include <src/dbus-names.h>
#include <src/usb-manager.h>
#include <libqtdbustest/DBusTestRunner.h>
@@ -93,10 +94,10 @@ protected:
OrgFreedesktopDBusMockInterface& notificationsMockInterface()
{
- return dbusMock.mockInterface("org.freedesktop.Notifications",
- "/org/freedesktop/Notifications",
- "org.freedesktop.Notifications",
- QDBusConnection::SessionBus);
+ return dbusMock.mockInterface(DBusNames::Notify::NAME,
+ DBusNames::Notify::PATH,
+ DBusNames::Notify::INTERFACE,
+ QDBusConnection::SessionBus);
}
QtDBusTest::DBusTestRunner dbusTestRunner;
@@ -151,8 +152,8 @@ TEST_F(UsbManagerFixture, Allow)
// click on allow in the notification
notificationsMockInterface().EmitSignal(
- DBusTypes::NOTIFY_DBUS_INTERFACE,
- "ActionInvoked",
+ DBusNames::Notify::INTERFACE,
+ DBusNames::Notify::ActionInvoked::NAME,
"us",
QVariantList() << uint32_t(1) << "allow"
);
diff --git a/tests/unit/usb-snap-test.cpp b/tests/unit/usb-snap-test.cpp
index e8f8bb2..dc17696 100644
--- a/tests/unit/usb-snap-test.cpp
+++ b/tests/unit/usb-snap-test.cpp
@@ -23,6 +23,7 @@
#include <tests/utils/glib-fixture.h>
#include <tests/utils/gtest-qt-print-helpers.h>
+#include <src/dbus-names.h>
#include <src/usb-snap.h>
#include <glib.h>
@@ -75,10 +76,10 @@ protected:
OrgFreedesktopDBusMockInterface& notificationsMockInterface()
{
- return dbusMock.mockInterface("org.freedesktop.Notifications",
- "/org/freedesktop/Notifications",
- "org.freedesktop.Notifications",
- QDBusConnection::SessionBus);
+ return dbusMock.mockInterface(DBusNames::Notify::NAME,
+ DBusNames::Notify::PATH,
+ DBusNames::Notify::INTERFACE,
+ QDBusConnection::SessionBus);
}
QtDBusTest::DBusTestRunner dbusTestRunner;
@@ -144,8 +145,8 @@ TEST_F(UsbSnapFixture, TestRoundTrip)
// fake a user interaction with the fdo notification
notificationsMockInterface().EmitSignal(
- DBusTypes::NOTIFY_DBUS_INTERFACE,
- "ActionInvoked",
+ DBusNames::Notify::INTERFACE,
+ DBusNames::Notify::ActionInvoked::NAME,
"us",
QVariantList() << id << test.action_to_invoke);
diff --git a/tests/utils/dbus-types.h b/tests/utils/dbus-types.h
index c2dfb81..3b3a02d 100644
--- a/tests/utils/dbus-types.h
+++ b/tests/utils/dbus-types.h
@@ -39,9 +39,4 @@ namespace DBusTypes
qDBusRegisterMetaType<QVariantDictMap>();
qDBusRegisterMetaType<QStringMap>();
}
- static constexpr char const* NOTIFY_DBUS_NAME = "org.freedesktop.Notifications";
-
- static constexpr char const* NOTIFY_DBUS_INTERFACE = "org.freedesktop.Notifications";
-
- static constexpr char const* NOTIFY_DBUS_PATH = "/org/freedesktop/Notifications";
}