[autotest] Adjust LockScreenTest to fix that KSldApp goes to Locked state
So far KSldApp was always either in state AcquiringLock or Unlocked during the tests. Due to a fix in WaylandServer it now can also enter the Locked state. But this is timing related and also depends on whether the greeter works at all. E.g. on build.kde.org the greeter fails to start, so it never enters the Locked state. The adjusted test now considers that the state might have changed to Locked and expects one additional signal to be emitted.
This commit is contained in:
parent
9e54cb5a1f
commit
5200a484ce
1 changed files with 7 additions and 3 deletions
|
@ -111,12 +111,16 @@ Q_SIGNALS:
|
|||
QVERIFY(waylandServer()->isScreenLocked());
|
||||
|
||||
#define UNLOCK \
|
||||
QCOMPARE(lockStateChangedSpy.count(), 1); \
|
||||
int expectedLockCount = 1; \
|
||||
if (ScreenLocker::KSldApp::self()->lockState() == ScreenLocker::KSldApp::Locked) { \
|
||||
expectedLockCount = 2; \
|
||||
} \
|
||||
QCOMPARE(lockStateChangedSpy.count(), expectedLockCount); \
|
||||
unlock(); \
|
||||
if (lockStateChangedSpy.count() < 2) { \
|
||||
if (lockStateChangedSpy.count() < expectedLockCount + 1) { \
|
||||
QVERIFY(lockStateChangedSpy.wait()); \
|
||||
} \
|
||||
QCOMPARE(lockStateChangedSpy.count(), 2); \
|
||||
QCOMPARE(lockStateChangedSpy.count(), expectedLockCount + 1); \
|
||||
QVERIFY(!waylandServer()->isScreenLocked());
|
||||
|
||||
#define MOTION(target) \
|
||||
|
|
Loading…
Reference in a new issue