Commit c36ecacf 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.
parent af18335a
Pipeline #178645 passed with stage
in 12 minutes and 28 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