KWin
Loading...
Searching...
No Matches
Classes | Namespaces | Macros
lockscreen.cpp File Reference
#include "kwin_wayland_test.h"
#include "compositor.h"
#include "core/output.h"
#include "core/renderbackend.h"
#include "effect/effecthandler.h"
#include "pointer_input.h"
#include "screenedge.h"
#include "wayland/keyboard.h"
#include "wayland/seat.h"
#include "wayland_server.h"
#include "window.h"
#include "workspace.h"
#include <KWayland/Client/compositor.h>
#include <KWayland/Client/connection_thread.h>
#include <KWayland/Client/keyboard.h>
#include <KWayland/Client/pointer.h>
#include <KWayland/Client/registry.h>
#include <KWayland/Client/seat.h>
#include <KWayland/Client/shm_pool.h>
#include <KWayland/Client/surface.h>
#include <KWayland/Client/touch.h>
#include <KScreenLocker/KsldApp>
#include <KGlobalAccel>
#include <QAction>
#include <QSignalSpy>
#include <linux/input.h>
#include "lockscreen.moc"

Go to the source code of this file.

Classes

class  KWin::LockScreenTest
 
class  KWin::HelperEffect
 
class  KWin::TestObject
 

Namespaces

namespace  KWin
 

Macros

#define LOCK
 
#define UNLOCK
 
#define MOTION(target)   Test::pointerMotion(target, timestamp++)
 
#define PRESS   Test::pointerButtonPressed(BTN_LEFT, timestamp++)
 
#define RELEASE   Test::pointerButtonReleased(BTN_LEFT, timestamp++)
 
#define KEYPRESS(key)   Test::keyboardKeyPressed(key, timestamp++)
 
#define KEYRELEASE(key)   Test::keyboardKeyReleased(key, timestamp++)
 
#define VERIFY(statement)
 
#define COMPARE(actual, expected)
 
#define PERFORM(expectedCount)
 
#define PERFORM(expectedCount)
 

Macro Definition Documentation

◆ COMPARE

#define COMPARE ( actual,
expected )
Value:
if (!QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__)) \
return {nullptr, nullptr};

◆ KEYPRESS

#define KEYPRESS ( key)    Test::keyboardKeyPressed(key, timestamp++)

Definition at line 133 of file lockscreen.cpp.

◆ KEYRELEASE

#define KEYRELEASE ( key)    Test::keyboardKeyReleased(key, timestamp++)

Definition at line 135 of file lockscreen.cpp.

◆ LOCK

#define LOCK
Value:
do { \
QVERIFY(!waylandServer()->isScreenLocked()); \
QSignalSpy lockStateChangedSpy(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::lockStateChanged); \
ScreenLocker::KSldApp::self()->lock(ScreenLocker::EstablishLock::Immediate); \
QTRY_COMPARE(ScreenLocker::KSldApp::self()->lockState(), ScreenLocker::KSldApp::Locked); \
QVERIFY(waylandServer()->isScreenLocked()); \
} while (false)

Definition at line 107 of file lockscreen.cpp.

◆ MOTION

#define MOTION ( target)    Test::pointerMotion(target, timestamp++)

Definition at line 127 of file lockscreen.cpp.

◆ PERFORM [1/2]

#define PERFORM ( expectedCount)
Value:
do { \
Test::keyboardKeyPressed(KEY_LEFTMETA, timestamp++); \
PRESS; \
QCoreApplication::instance()->processEvents(); \
QCOMPARE(actionSpy.count(), expectedCount); \
Test::keyboardKeyReleased(KEY_LEFTMETA, timestamp++); \
QCoreApplication::instance()->processEvents(); \
QCOMPARE(actionSpy.count(), expectedCount); \
} while (false)
#define PRESS
#define RELEASE

◆ PERFORM [2/2]

#define PERFORM ( expectedCount)
Value:
do { \
Test::keyboardKeyPressed(KEY_LEFTMETA, timestamp++); \
if (direction == Qt::Vertical) \
Test::pointerAxisVertical(sign * 5.0, timestamp++); \
else \
Test::pointerAxisHorizontal(sign * 5.0, timestamp++); \
QCoreApplication::instance()->processEvents(); \
QCOMPARE(actionSpy.count(), expectedCount); \
Test::keyboardKeyReleased(KEY_LEFTMETA, timestamp++); \
QCoreApplication::instance()->processEvents(); \
QCOMPARE(actionSpy.count(), expectedCount); \
} while (false)

◆ PRESS

#define PRESS   Test::pointerButtonPressed(BTN_LEFT, timestamp++)

Definition at line 129 of file lockscreen.cpp.

◆ RELEASE

#define RELEASE   Test::pointerButtonReleased(BTN_LEFT, timestamp++)

Definition at line 131 of file lockscreen.cpp.

◆ UNLOCK

#define UNLOCK
Value:
do { \
QSignalSpy lockStateChangedSpy(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::lockStateChanged); \
unlock(); \
if (lockStateChangedSpy.count() != 1) { \
QVERIFY(lockStateChangedSpy.wait()); \
} \
QCOMPARE(lockStateChangedSpy.count(), 1); \
QVERIFY(!waylandServer()->isScreenLocked()); \
} while (false)

Definition at line 116 of file lockscreen.cpp.

◆ VERIFY

#define VERIFY ( statement)
Value:
if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__)) \
return {nullptr, nullptr};