Revision 4325433...

Go back to digest for 11th May 2014

Other in KDE Base

Martin Gräßlin committed changes in [plasma-workspace] /screenlocker:

[screenlocker] Add a unit test for KSldApp

The unit test so far only tests establishGrab. This is a little bit
tricky as we need a different X Client which grabs pointer or keyboard
to make establishGrab fail. For that two small helper applications are
included which do nothing else than connecting to X and the one grabbing
keyboard the other grabbing pointer.

The applications are started from the test to get the keyboard/pointer
grabbed which results in ::establishGrab to return false.

What this test is not yet able to test is handling the sleep between two
grab attemps.

As the test is using doUnlock() from KSldApp, the implementation is
changed to use xcb for ungrab pointer/keyboard. With XLib the test would
have needed an XSync which would have required to either add the XLib
call to the test or doUnlock or implement the sync using xcb.

REVIEW: 117995

File Changes

Added 3 files
  • /screenlocker/autotests
  •   ksmserver/keyboardgrabber.cpp
  •   ksmserver/ksldtest.cpp
  •   ksmserver/pointergrabber.cpp
Modified 3 files
  • /screenlocker
  •   ksmserver/ksldapp.cpp
  •   ksmserver/ksldapp.h
  •   ksmserver/autotests/CMakeLists.txt
6 files changed in total