Commit 9d9bbef3 authored by David Edmundson's avatar David Edmundson Committed by Vlad Zahorodnii
Browse files

Wait for lockscreen to actually be started before running lock tests

Firstly we weren't waiting for a signal at all, we are relying on events
being processed externally which is wrong.

Secondly ScreenLocker::KSldApp::self()->lockState() is tri-state;
unlocked, acquiring, locked. This gets compressed to a boolean where
acquiring and locked are the same.

If we run the tests whilst we're still acquiring the lock screen we can
call unlocked before we've finished locking. The greeter might then be
shown afterwards triggering a re-lock. It's a confused state.


(cherry picked from commit c36ecacf)
parent e0a035c1
Pipeline #178764 failed with stage
in 1 minute and 13 seconds
......@@ -108,7 +108,7 @@ Q_SIGNALS:
QSignalSpy lockStateChangedSpy(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::lockStateChanged); \
QVERIFY(lockStateChangedSpy.isValid()); \
ScreenLocker::KSldApp::self()->lock(ScreenLocker::EstablishLock::Immediate); \
QCOMPARE(lockStateChangedSpy.count(), 1); \
QTRY_COMPARE(ScreenLocker::KSldApp::self()->lockState(), ScreenLocker::KSldApp::Locked); \
QVERIFY(waylandServer()->isScreenLocked()); \
} while (false)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment