summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoni Jäntti <joni.jantti@qt.io>2017-07-11 09:19:36 +0300
committerJoni Jäntti <joni.jantti@qt.io>2017-08-15 10:00:42 +0000
commitbdc8cda5a5423f88e3109c12a9c438c5db670009 (patch)
treebe12d47c6bfbe367faa4ceea4e5c06e37330fad1 /tests
parent116e79c0788674380eab8bca84b22200d7b7e22a (diff)
tst_qfocusevent activateWindow for Win 10
This workaround was created to make tst_qfocusevent test pass on Windows 10 x64 Creators Update. Task-number: QTBUG-61467 Change-Id: I63eb149ae850174fb5de99761a6001e000a151a2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit b091472f44546446b82efe7c9e69de570deeda8d)
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/other/qfocusevent/tst_qfocusevent.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
index 7cb6e67cbb..c7955ffed2 100644
--- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
+++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
@@ -41,6 +41,7 @@
#include <qevent.h>
#include <qlineedit.h>
#include <QBoxLayout>
+#include <QSysInfo>
QT_FORWARD_DECLARE_CLASS(QWidget)
@@ -353,6 +354,14 @@ void tst_QFocusEvent::checkReason_ActiveWindow()
QTRY_VERIFY(childFocusWidgetOne->focusOutEventRecieved);
QVERIFY(childFocusWidgetOne->focusOutEventLostFocus);
+#if defined(Q_OS_WIN)
+ if (QSysInfo::kernelVersion() == "10.0.15063") {
+ // Activate window of testFocusWidget, focus in that window goes to childFocusWidgetOne
+ QWARN("Windows 10 Creators Update (10.0.15063) requires explicit activateWindow()");
+ testFocusWidget->activateWindow();
+ }
+#endif
+
QVERIFY( !childFocusWidgetOne->focusInEventRecieved );
QVERIFY( childFocusWidgetOne->focusOutEventRecieved );
QCOMPARE( childFocusWidgetOne->focusOutEventReason, (int)Qt::ActiveWindowFocusReason);