Merge lp:~mterry/unity8/new-input-proxies into lp:unity8

Proposed by Michael Terry
Status: Superseded
Proposed branch: lp:~mterry/unity8/new-input-proxies
Merge into: lp:unity8
Diff against target: 375 lines (+204/-5)
9 files modified
plugins/AccountsService/AccountsService.cpp (+54/-2)
plugins/AccountsService/AccountsService.h (+4/-1)
tests/plugins/AccountsService/CMakeLists.txt (+3/-0)
tests/plugins/AccountsService/PropertiesServer.cpp (+1/-2)
tests/plugins/AccountsService/UscServer.cpp (+28/-0)
tests/plugins/AccountsService/UscServer.h (+39/-0)
tests/plugins/AccountsService/client.cpp (+55/-0)
tests/plugins/AccountsService/interfaces.xml (+10/-0)
tests/plugins/AccountsService/server.cpp (+10/-0)
To merge this branch: bzr merge lp:~mterry/unity8/new-input-proxies
Reviewer Review Type Date Requested Status
Michał Sawicz Abstain
Unity8 CI Bot continuous-integration Needs Fixing
PS Jenkins bot (community) continuous-integration Needs Fixing
Lukáš Tinkl (community) Approve
Review via email: mp+285364@code.launchpad.net

This proposal has been superseded by a proposal from 2016-02-25.

Commit message

Proxy more mouse and touchpad properties to USC (LP: #1540398)

Description of the change

Mostly simple, but I added a converter capacity to our AccountsService proxy relay. And added some tests for proxy support in general (I realized it had been missed!) and specifically the converter support.

Note that MouseDoubleClickSpeed and TouchpadDoubleClickSpeed are not supported on the USC side yet. The properties exist in AccountsService, but USC/Mir haven't caught up. I added them anyway, so that there's one less thing to do to support them. It won't hurt us any to try and fail to proxy them until USC adds support.

= Checklist =

 * Are there any related MPs required for this MP to build/function as expected? Please list.
 Yes, just the pre-requisite.

 * Did you perform an exploratory manual test run of your code change and any related functionality?
 No, it's just adding properties.

 * Did you make sure that your branch does not contain spurious tags?
 Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
 NA

 * If you changed the UI, has there been a design review?
 NA

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2142
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/292/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/412/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/435
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/453
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/453
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/449
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/449/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/449/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/449
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/449/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/449/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/449
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/449/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/449/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/292/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Some minor stuff in inline comments, otherwise looks great

review: Needs Fixing (code-review)
Revision history for this message
Michael Terry (mterry) wrote :

Commented, updated.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Cool, I like it

* Did you perform an exploratory manual test run of the code change and any related functionality?

Yes

* Did CI run pass? If not, please explain why.

No, missing explicit dependency on https://code.launchpad.net/~unity-team/unity-api/surfaceItemSizeHints/+merge/284890 in the chain

* Did you make sure that the branch does not contain spurious tags?

Yes

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

I had to muck with the bzr history due to some pre-req shenanigans. But the diff is the same.

Revision history for this message
Michał Sawicz (saviq) wrote :

CMake Error at tests/plugins/AccountsService/CMakeLists.txt:28 (add_executable):
  Cannot find source file:

    UscServer.cpp

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/new-input-proxies updated
2146. By Michael Terry

Whoops, add missing files

Revision history for this message
Michael Terry (mterry) wrote :

Whoops, forgot to bzr add UscServer.{cpp,h} when I was rebasing this branch. Those files were included in the original MP and review. I just dropped them when futzing with bzr history. :-/

Fixed now.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) :
review: Abstain

Unmerged revisions

2146. By Michael Terry

Whoops, add missing files

2145. By Michael Terry

Proxy more input settings to USC

2144. By Michael Terry

Merge kbdLayout branch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/AccountsService/AccountsService.cpp'
2--- plugins/AccountsService/AccountsService.cpp 2016-02-17 13:47:43 +0000
3+++ plugins/AccountsService/AccountsService.cpp 2016-02-17 13:47:43 +0000
4@@ -41,9 +41,32 @@
5 #define PROP_LICENSE_ACCEPTED QStringLiteral("LicenseAccepted")
6 #define PROP_LICENSE_BASE_PATH QStringLiteral("LicenseBasePath")
7 #define PROP_MOUSE_CURSOR_SPEED QStringLiteral("MouseCursorSpeed")
8+#define PROP_MOUSE_DOUBLE_CLICK_SPEED QStringLiteral("MouseDoubleClickSpeed")
9+#define PROP_MOUSE_PRIMARY_BUTTON QStringLiteral("MousePrimaryButton")
10+#define PROP_MOUSE_SCROLL_SPEED QStringLiteral("MouseScrollSpeed")
11 #define PROP_PASSWORD_DISPLAY_HINT QStringLiteral("PasswordDisplayHint")
12 #define PROP_STATS_WELCOME_SCREEN QStringLiteral("StatsWelcomeScreen")
13 #define PROP_TOUCHPAD_CURSOR_SPEED QStringLiteral("TouchpadCursorSpeed")
14+#define PROP_TOUCHPAD_DISABLE_WHILE_TYPING QStringLiteral("TouchpadDisableWhileTyping")
15+#define PROP_TOUCHPAD_DISABLE_WITH_MOUSE QStringLiteral("TouchpadDisableWithMouse")
16+#define PROP_TOUCHPAD_DOUBLE_CLICK_SPEED QStringLiteral("TouchpadDoubleClickSpeed")
17+#define PROP_TOUCHPAD_PRIMARY_BUTTON QStringLiteral("TouchpadPrimaryButton")
18+#define PROP_TOUCHPAD_SCROLL_SPEED QStringLiteral("TouchpadScrollSpeed")
19+#define PROP_TOUCHPAD_TAP_TO_CLICK QStringLiteral("TouchpadTapToClick")
20+#define PROP_TOUCHPAD_TWO_FINGER_SCROLL QStringLiteral("TouchpadTwoFingerScroll")
21+
22+
23+QVariant primaryButtonConverter(const QVariant &value)
24+{
25+ QString stringValue = value.toString();
26+ if (stringValue == "left") {
27+ return QVariant::fromValue(0);
28+ } else if (stringValue == "right") {
29+ return QVariant::fromValue(1); // Mir is less clear on this -- any non-zero value is the same
30+ } else {
31+ return QVariant::fromValue(0); // default to left
32+ }
33+}
34
35 using StringMap = QMap<QString,QString>;
36 using StringMapList = QList<StringMap>;
37@@ -74,8 +97,30 @@
38
39 registerProxy(IFACE_UBUNTU_INPUT, PROP_MOUSE_CURSOR_SPEED,
40 m_unityInput, QStringLiteral("setMouseCursorSpeed"));
41+ registerProxy(IFACE_UBUNTU_INPUT, PROP_MOUSE_DOUBLE_CLICK_SPEED,
42+ m_unityInput, QStringLiteral("setMouseDoubleClickSpeed"));
43+ registerProxy(IFACE_UBUNTU_INPUT, PROP_MOUSE_PRIMARY_BUTTON,
44+ m_unityInput, QStringLiteral("setMousePrimaryButton"),
45+ primaryButtonConverter);
46+ registerProxy(IFACE_UBUNTU_INPUT, PROP_MOUSE_SCROLL_SPEED,
47+ m_unityInput, QStringLiteral("setMouseScrollSpeed"));
48 registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_CURSOR_SPEED,
49 m_unityInput, QStringLiteral("setTouchpadCursorSpeed"));
50+ registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_SCROLL_SPEED,
51+ m_unityInput, QStringLiteral("setTouchpadScrollSpeed"));
52+ registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_DISABLE_WHILE_TYPING,
53+ m_unityInput, QStringLiteral("setTouchpadDisableWhileTyping"));
54+ registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_DISABLE_WITH_MOUSE,
55+ m_unityInput, QStringLiteral("setTouchpadDisableWithMouse"));
56+ registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_DOUBLE_CLICK_SPEED,
57+ m_unityInput, QStringLiteral("setTouchpadDoubleClickSpeed"));
58+ registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_PRIMARY_BUTTON,
59+ m_unityInput, QStringLiteral("setTouchpadPrimaryButton"),
60+ primaryButtonConverter);
61+ registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_TAP_TO_CLICK,
62+ m_unityInput, QStringLiteral("setTouchpadTapToClick"));
63+ registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_TWO_FINGER_SCROLL,
64+ m_unityInput, QStringLiteral("setTouchpadTwoFingerScroll"));
65
66 setUser(!user.isEmpty() ? user : QString::fromUtf8(qgetenv("USER")));
67 }
68@@ -226,7 +271,13 @@
69 PropertyInfo &info = m_properties[interface][property];
70
71 if (info.proxyInterface) {
72- info.proxyInterface->asyncCall(info.proxyMethod, value);
73+ QVariant finalValue;
74+ if (info.proxyConverter) {
75+ finalValue = info.proxyConverter(value);
76+ } else {
77+ finalValue = value;
78+ }
79+ info.proxyInterface->asyncCall(info.proxyMethod, finalValue);
80 return; // don't bother saving a copy
81 }
82
83@@ -285,12 +336,13 @@
84 }
85 }
86
87-void AccountsService::registerProxy(const QString &interface, const QString &property, QDBusInterface *iface, const QString &method)
88+void AccountsService::registerProxy(const QString &interface, const QString &property, QDBusInterface *iface, const QString &method, ProxyConverter converter)
89 {
90 registerProperty(interface, property, nullptr);
91
92 m_properties[interface][property].proxyInterface = iface;
93 m_properties[interface][property].proxyMethod = method;
94+ m_properties[interface][property].proxyConverter = converter;
95 }
96
97 void AccountsService::registerProperty(const QString &interface, const QString &property, const QString &signal)
98
99=== modified file 'plugins/AccountsService/AccountsService.h'
100--- plugins/AccountsService/AccountsService.h 2016-02-17 13:47:43 +0000
101+++ plugins/AccountsService/AccountsService.h 2016-02-17 13:47:43 +0000
102@@ -117,9 +117,11 @@
103 void onMaybeChanged(const QString &user);
104
105 private:
106+ typedef QVariant (*ProxyConverter)(const QVariant &);
107+
108 void refresh(bool async);
109 void registerProperty(const QString &interface, const QString &property, const QString &signal);
110- void registerProxy(const QString &interface, const QString &property, QDBusInterface *iface, const QString &method);
111+ void registerProxy(const QString &interface, const QString &property, QDBusInterface *iface, const QString &method, ProxyConverter converter = nullptr);
112
113 void updateAllProperties(const QString &interface, bool async);
114 void updateProperty(const QString &interface, const QString &property);
115@@ -135,6 +137,7 @@
116 QString signal{};
117 QDBusInterface *proxyInterface{};
118 QString proxyMethod{};
119+ ProxyConverter proxyConverter{};
120 };
121 typedef QHash< QString, QHash<QString, PropertyInfo> > PropertyHash;
122 PropertyHash m_properties;
123
124=== modified file 'tests/plugins/AccountsService/CMakeLists.txt'
125--- tests/plugins/AccountsService/CMakeLists.txt 2016-02-17 13:47:43 +0000
126+++ tests/plugins/AccountsService/CMakeLists.txt 2016-02-17 13:47:43 +0000
127@@ -16,6 +16,7 @@
128 make_dbus_class(Location com.ubuntu.location.providers.here.AccountsService)
129 make_dbus_class(AccountsUser org.freedesktop.Accounts.User)
130 make_dbus_class(AccountsPrivate com.canonical.unity.AccountsService.Private)
131+make_dbus_class(UscInput com.canonical.Unity.Input)
132
133 include_directories(
134 ${CMAKE_CURRENT_BINARY_DIR}
135@@ -32,9 +33,11 @@
136 ${CMAKE_CURRENT_BINARY_DIR}/PropertiesAdaptor.cpp
137 ${CMAKE_CURRENT_BINARY_DIR}/LocationAdaptor.cpp
138 ${CMAKE_CURRENT_BINARY_DIR}/SecurityPrivacyAdaptor.cpp
139+ ${CMAKE_CURRENT_BINARY_DIR}/UscInputAdaptor.cpp
140 server.cpp
141 AccountsServer.cpp
142 PropertiesServer.cpp
143+ UscServer.cpp
144 )
145 qt5_use_modules(mock-server Core DBus)
146
147
148=== modified file 'tests/plugins/AccountsService/PropertiesServer.cpp'
149--- tests/plugins/AccountsService/PropertiesServer.cpp 2016-02-17 13:47:43 +0000
150+++ tests/plugins/AccountsService/PropertiesServer.cpp 2016-02-17 13:47:43 +0000
151@@ -100,8 +100,7 @@
152 m_properties["com.canonical.unity.AccountsService"]["LauncherItems"] = QVariant::fromValue(QList<QVariantMap>());
153 m_properties["com.canonical.unity.AccountsService.Private"]["FailedLogins"] = 0;
154 m_properties["com.ubuntu.touch.AccountsService.SecurityPrivacy"]["StatsWelcomeScreen"] = true;
155- m_properties["com.ubuntu.AccountsService.Input"]["MouseCursorSpeed"] = 0.5;
156- m_properties["com.ubuntu.AccountsService.Input"]["TouchpadCursorSpeed"] = 0.5;
157+ m_properties["com.ubuntu.AccountsService.Input"]["MousePrimaryButton"] = "right";
158 m_properties["com.ubuntu.AccountsService.SecurityPrivacy"]["EnableLauncherWhileLocked"] = true;
159 m_properties["com.ubuntu.AccountsService.SecurityPrivacy"]["EnableIndicatorsWhileLocked"] = true;
160 m_properties["com.ubuntu.AccountsService.SecurityPrivacy"]["PasswordDisplayHint"] = AccountsService::Keyboard;
161
162=== added file 'tests/plugins/AccountsService/UscServer.cpp'
163--- tests/plugins/AccountsService/UscServer.cpp 1970-01-01 00:00:00 +0000
164+++ tests/plugins/AccountsService/UscServer.cpp 2016-02-17 13:47:43 +0000
165@@ -0,0 +1,28 @@
166+/*
167+ * Copyright 2016 Canonical Ltd.
168+ *
169+ * This program is free software: you can redistribute it and/or modify it
170+ * under the terms of the GNU General Public License version 3, as published
171+ * by the Free Software Foundation.
172+ *
173+ * This program is distributed in the hope that it will be useful, but
174+ * WITHOUT ANY WARRANTY; without even the implied warranties of
175+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
176+ * PURPOSE. See the GNU General Public License for more details.
177+ *
178+ * You should have received a copy of the GNU General Public License
179+ * version 3 along with this program. If not, see
180+ * <http://www.gnu.org/licenses/>
181+ */
182+
183+#include "UscServer.h"
184+
185+UscServer::UscServer(QObject *parent)
186+ : QObject(parent)
187+{
188+}
189+
190+void UscServer::setMousePrimaryButton(int button)
191+{
192+ Q_EMIT setMousePrimaryButtonCalled(button);
193+}
194
195=== added file 'tests/plugins/AccountsService/UscServer.h'
196--- tests/plugins/AccountsService/UscServer.h 1970-01-01 00:00:00 +0000
197+++ tests/plugins/AccountsService/UscServer.h 2016-02-17 13:47:43 +0000
198@@ -0,0 +1,39 @@
199+/*
200+ * Copyright 2016 Canonical Ltd.
201+ *
202+ * This program is free software: you can redistribute it and/or modify it
203+ * under the terms of the GNU General Public License version 3, as published
204+ * by the Free Software Foundation.
205+ *
206+ * This program is distributed in the hope that it will be useful, but
207+ * WITHOUT ANY WARRANTY; without even the implied warranties of
208+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
209+ * PURPOSE. See the GNU General Public License for more details.
210+ *
211+ * You should have received a copy of the GNU General Public License
212+ * version 3 along with this program. If not, see
213+ * <http://www.gnu.org/licenses/>
214+ */
215+
216+#ifndef UNITY_USCSERVER_H
217+#define UNITY_USCSERVER_H
218+
219+#include <QDBusContext>
220+#include <QObject>
221+
222+class UscServer: public QObject, protected QDBusContext
223+{
224+ Q_OBJECT
225+
226+public:
227+ explicit UscServer(QObject *parent = nullptr);
228+
229+public Q_SLOTS:
230+ void setMousePrimaryButton(int button);
231+
232+Q_SIGNALS:
233+ // mock only.
234+ void setMousePrimaryButtonCalled(int button);
235+};
236+
237+#endif
238
239=== modified file 'tests/plugins/AccountsService/client.cpp'
240--- tests/plugins/AccountsService/client.cpp 2016-02-17 13:47:43 +0000
241+++ tests/plugins/AccountsService/client.cpp 2016-02-17 13:47:43 +0000
242@@ -47,9 +47,19 @@
243 : QObject(parent)
244 , m_userInterface(nullptr)
245 , m_spy(this, &AccountsServiceTest::propertiesChanged)
246+ , m_mousePrimaryButtonSpy(this, &AccountsServiceTest::setMousePrimaryButtonCalled)
247 {
248 qDBusRegisterMetaType<StringMap>();
249 qDBusRegisterMetaType<StringMapList>();
250+
251+ m_uscInputInterface = new QDBusInterface("com.canonical.Unity.Input",
252+ "/com/canonical/Unity/Input",
253+ "com.canonical.Unity.Input",
254+ QDBusConnection::sessionBus(),
255+ this);
256+
257+ QObject::connect(m_uscInputInterface, SIGNAL(setMousePrimaryButtonCalled(int)),
258+ this, SIGNAL(setMousePrimaryButtonCalled(int)));
259 }
260
261 private Q_SLOTS:
262@@ -78,6 +88,7 @@
263
264 delete m_userInterface;
265 m_spy.clear();
266+ m_mousePrimaryButtonSpy.clear();
267 }
268
269 void testInvalids()
270@@ -244,12 +255,56 @@
271 QTRY_COMPARE(session.keymaps(), result);
272 }
273
274+ void testProxyOnStartup()
275+ {
276+ AccountsService session(this, QTest::currentTestFunction());
277+
278+ QTRY_COMPARE(m_mousePrimaryButtonSpy.count(), 1);
279+ QList<QVariant> arguments = m_mousePrimaryButtonSpy.takeFirst();
280+ QCOMPARE(arguments.at(0).toInt(), 1);
281+ }
282+
283+ void testProxyOnChange()
284+ {
285+ AccountsService session(this, QTest::currentTestFunction());
286+ QTRY_COMPARE(m_mousePrimaryButtonSpy.count(), 1);
287+ m_mousePrimaryButtonSpy.clear();
288+
289+ ASSERT_DBUS_CALL(m_userInterface->asyncCall("Set",
290+ "com.ubuntu.AccountsService.Input",
291+ "MousePrimaryButton",
292+ dbusVariant("left")));
293+
294+ QTRY_COMPARE(m_mousePrimaryButtonSpy.count(), 1);
295+ QList<QVariant> arguments = m_mousePrimaryButtonSpy.takeFirst();
296+ QCOMPARE(arguments.at(0).toInt(), 0);
297+ }
298+
299+ void testInvalidPrimaryButton()
300+ {
301+ AccountsService session(this, QTest::currentTestFunction());
302+ QTRY_COMPARE(m_mousePrimaryButtonSpy.count(), 1);
303+ m_mousePrimaryButtonSpy.clear();
304+
305+ ASSERT_DBUS_CALL(m_userInterface->asyncCall("Set",
306+ "com.ubuntu.AccountsService.Input",
307+ "MousePrimaryButton",
308+ dbusVariant("NOPE")));
309+
310+ QTRY_COMPARE(m_mousePrimaryButtonSpy.count(), 1);
311+ QList<QVariant> arguments = m_mousePrimaryButtonSpy.takeFirst();
312+ QCOMPARE(arguments.at(0).toInt(), 0);
313+ }
314+
315 Q_SIGNALS:
316 void propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalid);
317+ void setMousePrimaryButtonCalled(int button);
318
319 private:
320+ QDBusInterface* m_uscInputInterface;
321 QDBusInterface* m_userInterface;
322 QSignalSpy m_spy;
323+ QSignalSpy m_mousePrimaryButtonSpy;
324 };
325
326 QTEST_MAIN(AccountsServiceTest)
327
328=== modified file 'tests/plugins/AccountsService/interfaces.xml'
329--- tests/plugins/AccountsService/interfaces.xml 2016-02-17 13:47:43 +0000
330+++ tests/plugins/AccountsService/interfaces.xml 2016-02-17 13:47:43 +0000
331@@ -44,4 +44,14 @@
332 <signal name="Changed" />
333 </interface>
334 <interface name="com.canonical.unity.AccountsService.Private" />
335+
336+ <interface name="com.canonical.Unity.Input">
337+ <method name="setMousePrimaryButton">
338+ <arg name="button" type="i" direction="in" />
339+ </method>
340+ <!-- Just for testing -->
341+ <signal name="setMousePrimaryButtonCalled">
342+ <arg name="button" type="i" direction="out" />
343+ </signal>
344+ </interface>
345 </node>
346
347=== modified file 'tests/plugins/AccountsService/server.cpp'
348--- tests/plugins/AccountsService/server.cpp 2016-02-17 13:47:43 +0000
349+++ tests/plugins/AccountsService/server.cpp 2016-02-17 13:47:43 +0000
350@@ -24,6 +24,8 @@
351 #include "SecurityPrivacyAdaptor.h"
352 #include "LocationAdaptor.h"
353 #include "AccountsPrivateAdaptor.h"
354+#include "UscInputAdaptor.h"
355+#include "UscServer.h"
356 #include <QCoreApplication>
357
358 int main(int argc, char *argv[])
359@@ -36,8 +38,16 @@
360 new SecurityPrivacyAdaptor(accounts);
361 new LocationAdaptor(accounts);
362 new AccountsPrivateAdaptor(accounts);
363+
364+ auto usc = new UscServer(&a);
365+ new UscInputAdaptor(usc);
366+
367 // We use the session bus for testing. The real plugin uses the system bus
368 auto connection = QDBusConnection::sessionBus();
369+ if (!connection.registerObject("/com/canonical/Unity/Input", usc))
370+ return 1;
371+ if (!connection.registerService("com.canonical.Unity.Input"))
372+ return 1;
373 if (!connection.registerObject("/org/freedesktop/Accounts", accounts))
374 return 1;
375 if (!connection.registerService("org.freedesktop.Accounts"))

Subscribers

People subscribed via source and target branches