summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/mockcompositor.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-03-07 10:40:31 +0100
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-03-07 11:04:45 +0100
commit609b8a18d0fb10cbee4a71a68ccee25a29fb071b (patch)
tree7af33214a2074881e55d8d014ff517f5f157bd8a /tests/auto/client/mockcompositor.cpp
parentefccc708d4578ff231bba2fba38bbb861dabcbe1 (diff)
Added testing of key events to client auto test.
This requires passing on the native key code as well when calling into QWindowSystemInterface from QWaylandInputDevice. Change-Id: Iea1f98dcc9e050bb42cc48927da17aa54085a5e8 Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Diffstat (limited to 'tests/auto/client/mockcompositor.cpp')
-rw-r--r--tests/auto/client/mockcompositor.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/client/mockcompositor.cpp b/tests/auto/client/mockcompositor.cpp
index 39bd6e3e7..c751bccb2 100644
--- a/tests/auto/client/mockcompositor.cpp
+++ b/tests/auto/client/mockcompositor.cpp
@@ -114,6 +114,20 @@ void MockCompositor::sendMouseRelease(const QSharedPointer<MockSurface> &surface
processCommand(command);
}
+void MockCompositor::sendKeyPress(const QSharedPointer<MockSurface> &surface, uint code)
+{
+ Command command = makeCommand(Impl::Compositor::sendKeyPress, m_compositor);
+ command.parameters << QVariant::fromValue(surface) << code;
+ processCommand(command);
+}
+
+void MockCompositor::sendKeyRelease(const QSharedPointer<MockSurface> &surface, uint code)
+{
+ Command command = makeCommand(Impl::Compositor::sendKeyRelease, m_compositor);
+ command.parameters << QVariant::fromValue(surface) << code;
+ processCommand(command);
+}
+
QSharedPointer<MockSurface> MockCompositor::surface()
{
QSharedPointer<MockSurface> result;