tst_QFocusEvent: Add qWaitForWindowActive() to checkReason_focusWidget()

checkReason_ActiveWindow() started failing on Windows when run together with
other tests, but still passed on its own.

The offending tests was checkReason_focusWidget(), which showed a window but did
not wait for it to be active.

After adding this wait the whole test executable passes on Windows as well.

Amends fd87c8da82.

Change-Id: I384bc45176fcd7bf6f491a4f39b46464ba45693b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Kari Oikarinen 2018-04-12 11:38:42 +03:00
parent 67aa365d41
commit b7d810a7cc

View File

@ -304,6 +304,7 @@ void tst_QFocusEvent::checkReason_focusWidget()
frame1.setLayout(&leftLayout);
frame2.setLayout(&rightLayout);
window1.show();
QVERIFY(QTest::qWaitForWindowActive(&window1));
edit1.setFocus();
QTRY_VERIFY(edit1.hasFocus());