summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/mockcompositor.cpp
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2016-07-29 15:54:08 +0200
committerJohan Helsing <johan.helsing@qt.io>2016-08-01 12:26:15 +0000
commit972d1150ee794eac3920df3e0fc611315ad8daf4 (patch)
tree4764b77251852fee748b97caa8eac2ad267bb86e /tests/auto/client/mockcompositor.cpp
parentd8b4bef3ddff327598027c8f94a61e3d0b61a2dd (diff)
Also test touch in client events test
Following the same pattern as for mouse and keyboard, also test touch events. Change-Id: Ie84aa0ffe0b0f4f66e9f40207c63d94e32f6dbaf Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'tests/auto/client/mockcompositor.cpp')
-rw-r--r--tests/auto/client/mockcompositor.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/client/mockcompositor.cpp b/tests/auto/client/mockcompositor.cpp
index 2f73734f1..682452262 100644
--- a/tests/auto/client/mockcompositor.cpp
+++ b/tests/auto/client/mockcompositor.cpp
@@ -122,6 +122,34 @@ void MockCompositor::sendKeyRelease(const QSharedPointer<MockSurface> &surface,
processCommand(command);
}
+void MockCompositor::sendTouchDown(const QSharedPointer<MockSurface> &surface, const QPoint &position, int id)
+{
+ Command command = makeCommand(Impl::Compositor::sendTouchDown, m_compositor);
+ command.parameters << QVariant::fromValue(surface) << position << id;
+ processCommand(command);
+}
+
+void MockCompositor::sendTouchMotion(const QSharedPointer<MockSurface> &surface, const QPoint &position, int id)
+{
+ Command command = makeCommand(Impl::Compositor::sendTouchMotion, m_compositor);
+ command.parameters << QVariant::fromValue(surface) << position << id;
+ processCommand(command);
+}
+
+void MockCompositor::sendTouchUp(const QSharedPointer<MockSurface> &surface, int id)
+{
+ Command command = makeCommand(Impl::Compositor::sendTouchUp, m_compositor);
+ command.parameters << QVariant::fromValue(surface) << id;
+ processCommand(command);
+}
+
+void MockCompositor::sendTouchFrame(const QSharedPointer<MockSurface> &surface)
+{
+ Command command = makeCommand(Impl::Compositor::sendTouchFrame, m_compositor);
+ command.parameters << QVariant::fromValue(surface);
+ processCommand(command);
+}
+
QSharedPointer<MockSurface> MockCompositor::surface()
{
QSharedPointer<MockSurface> result;
@@ -208,6 +236,7 @@ Compositor::Compositor()
m_seat.reset(new Seat(this, m_display));
m_pointer = m_seat->pointer();
m_keyboard = m_seat->keyboard();
+ m_touch = m_seat->touch();
wl_display_add_global(m_display, &wl_output_interface, this, bindOutput);
wl_display_add_global(m_display, &wl_shell_interface, this, bindShell);