Remove tst_QWidget::immediateRepaintAfterShow().

It tested whether a paint event was received when calling QWidget::repaint()
right after QWidget::show() without waiting for the window to be exposed.

This caused a QEvent::UpdateRequest to be sent, which ended up in
QWidgetBackingStore::sync() which returns after checking
QWidgetBackingStore::discardSyncRequest(), since Qt::WA_Mapped is not set
on the non-exposed widget.

The test passed on Windows since it contains one call to
QCoreApplication::processEvents() which causes the the initial WM_PAINT
message to be processed in QWindowsWindow::handleWmPaint() which calls
QWindowSystemInterface::flushWindowSystemEvents() and causes Qt::WA_Mapped
to be set. This seems counter to the intention of the test.

Remove the test since it won't pass anymore in Qt 5 unless Qt::WA_Mapped is set.

Task-number: QTBUG-26424
Task-number: QTBUG-38327
Task-number: QTBUG-39842
Change-Id: Iede026d52825dcf1f2e9014a316d26d260309214
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Friedemann Kleint 2016-06-01 11:07:22 +02:00
parent cf19b06f22
commit 23bed9f820

View File

@ -378,7 +378,6 @@ private slots:
void setMaskInResizeEvent();
void moveInResizeEvent();
void immediateRepaintAfterShow();
void immediateRepaintAfterInvalidateBuffer();
void effectiveWinId();
@ -8145,25 +8144,6 @@ void tst_QWidget::moveInResizeEvent()
QTRY_COMPARE(testWidget.geometry(), expectedGeometry);
}
void tst_QWidget::immediateRepaintAfterShow()
{
if (m_platform == QStringLiteral("xcb"))
QSKIP("QTBUG-26424");
if (m_platform != QStringLiteral("xcb") && m_platform != QStringLiteral("windows"))
QSKIP("We don't support immediate repaint right after show on other platforms.");
UpdateWidget widget;
centerOnScreen(&widget);
widget.show();
qApp->processEvents();
// On X11 in particular, we are now waiting for a MapNotify event before
// syncing the backing store. However, if someone request a repaint()
// we must repaint immediately regardless of the current state.
widget.numPaintEvents = 0;
widget.repaint();
QCOMPARE(widget.numPaintEvents, 1);
}
void tst_QWidget::immediateRepaintAfterInvalidateBuffer()
{
if (m_platform != QStringLiteral("xcb") && m_platform != QStringLiteral("windows"))