Stabilize test QMenu::QTBUG_89082_actionTipsHide() on Windows, take 2
Use the QWindow-based overloads of QTest::mouseMove(), which do not move the cursor position. Amendsbb10ba13960392,3f3d5e6716. Task-number: QTBUG-89082 Pick-to: 6.0 6.1 5.15 Change-Id: I2cc62e4d1f24e4baebafd0d76fbf0fbdb6f588c7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
parent
4b15a8ea8f
commit
65c6fbea24
|
|
@ -1376,6 +1376,8 @@ void tst_QMenu::QTBUG_89082_actionTipsHide()
|
|||
QVERIFY(QTest::qWaitForWindowExposed(&widget));
|
||||
menu->popup(widget.geometry().topRight() + QPoint(50, 0));
|
||||
QVERIFY(QTest::qWaitForWindowExposed(menu));
|
||||
auto menuWindow = menu->windowHandle();
|
||||
QVERIFY(menuWindow != nullptr);
|
||||
|
||||
auto actionZero = menu->actions().at(0);
|
||||
auto actionOne = menu->actions().at(1);
|
||||
|
|
@ -1389,12 +1391,12 @@ void tst_QMenu::QTBUG_89082_actionTipsHide()
|
|||
const QRect submenuRect5 = menu->actionGeometry(actionFive);
|
||||
const QPoint submenuPos5(submenuRect5.topLeft() + QPoint(10, 3));
|
||||
|
||||
QTest::mouseMove(menu, submenuPos1);
|
||||
QTest::mouseMove(menu, submenuPos0); //show the tip
|
||||
QTest::mouseMove(menuWindow, submenuPos1);
|
||||
QTest::mouseMove(menuWindow, submenuPos0); //show the tip
|
||||
QTRY_COMPARE_WITH_TIMEOUT(QToolTip::text(), tipFullName, 1000);
|
||||
|
||||
//Move to the fifth action without prompting
|
||||
QTest::mouseMove(menu, submenuPos5);
|
||||
QTest::mouseMove(menuWindow, submenuPos5);
|
||||
//The previous tip was hidden, but now is a new tip to get text, So there should be no content
|
||||
QTRY_COMPARE_WITH_TIMEOUT(QToolTip::text(), QString(), 1000);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue