Stabilize flaky scrollerSmoothScroll test case
This test failed when checking for a pre-condition of the tested scenario, so skip the test if that condition isn't met, as the test won't test anything. Amends b1fdcc8c0fefe0660302494618032342b623e199. Pick-to: 6.2 6.1 5.15 Task-number: QTBUG-64543 Change-Id: I135cd5b45efcae111305b9be338eb5429d3b97d5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
parent
8a034c62b6
commit
2933e67f45
@ -3081,9 +3081,11 @@ void tst_QAbstractItemView::scrollerSmoothScroll()
|
||||
QListWidgetItem *pressItem = view.item(23);
|
||||
QPoint dragPosition = view.visualRect(view.indexFromItem(pressItem)).center();
|
||||
// the mouse press changes the current item temporarily, but the press is delayed
|
||||
// by the gesture machinery
|
||||
// by the gesture machinery. this is not what we are testing here, so skip the test
|
||||
// if this fails within a reasonable amount of time.
|
||||
QTest::mousePress(view.viewport(), Qt::LeftButton, Qt::NoModifier, dragPosition);
|
||||
QTRY_COMPARE(view.currentItem(), pressItem);
|
||||
if (!(QTest::qWaitFor([&]{ return view.currentItem() == pressItem; })))
|
||||
QSKIP("Current item didn't change on press, skipping test");
|
||||
|
||||
// QAIV will reset the current item when the scroller changes state to Dragging
|
||||
for (int y = 0; y < QApplication::startDragDistance() * 2; ++y) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user