From b439f06941007483ee14aeeb4fb09ac8148c8038 Mon Sep 17 00:00:00 2001 From: Axel Spoerl Date: Wed, 5 Oct 2022 09:10:16 +0200 Subject: Remove focusProxyAndInputMethods from tst_QWidget focusProxyAndInputMethods tests focus acquisition and inheritance with a toplevel widget, acting as a focus proxy for a child. X11 window managers are set to be bypassed, programmatic focus is set with QApplicationPrivate::setActiveWindow(). The test is flaky on Linux/XCB, and therefore blacklisted on most Linuxes. This patch removes focusProxyAndInputMethods, considering that - focus proxying is tested in tst_QWidget::focusProxy() - window activation and focus inheritance are tested in tst_QWindow::isActive() Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I510fd935399d9ad0b6cd76f1bd5db0811e0702f6 Reviewed-by: Richard Moe Gustavsen --- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 29 ----------------------- 1 file changed, 29 deletions(-) (limited to 'tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp') diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 914adc02c2..2d8e267730 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -368,7 +368,6 @@ private slots: void openModal_taskQTBUG_5804(); void focusProxy(); - void focusProxyAndInputMethods(); void imEnabledNotImplemented(); #ifdef QT_BUILD_INTERNAL @@ -10956,34 +10955,6 @@ void tst_QWidget::focusProxy() QCOMPARE(container2->focusOutCount, 1); } -void tst_QWidget::focusProxyAndInputMethods() -{ - if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) - QSKIP("Window activation is not supported."); - QScopedPointer toplevel(new QWidget(nullptr, Qt::X11BypassWindowManagerHint)); - toplevel->setWindowTitle(QLatin1String(QTest::currentTestFunction())); - toplevel->resize(200, 200); - toplevel->setAttribute(Qt::WA_InputMethodEnabled, true); - - QWidget *child = new QWidget(toplevel.data()); - child->setFocusProxy(toplevel.data()); - child->setAttribute(Qt::WA_InputMethodEnabled, true); - - toplevel->setFocusPolicy(Qt::WheelFocus); - child->setFocusPolicy(Qt::WheelFocus); - - QVERIFY(!child->hasFocus()); - QVERIFY(!toplevel->hasFocus()); - - toplevel->show(); - QVERIFY(QTest::qWaitForWindowExposed(toplevel.data())); - QApplicationPrivate::setActiveWindow(toplevel.data()); - QVERIFY(QTest::qWaitForWindowActive(toplevel.data())); - QVERIFY(toplevel->hasFocus()); - QVERIFY(child->hasFocus()); - QCOMPARE(qApp->focusObject(), toplevel.data()); -} - void tst_QWidget::imEnabledNotImplemented() { // Check that a plain widget doesn't report that it supports IM. Only -- cgit v1.2.3