summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-10-17 10:19:31 +0200
committerLiang Qi <liang.qi@qt.io>2017-10-17 10:34:24 +0200
commitd0a0a3c0418a0fdd2ed84b2a5f7e6565537715c6 (patch)
treed6aeb4d51caf30ccf23eadb806a09295cbf679cd /tests/auto/gui
parent9f405f98a4247cd263b9c5d35659a4ba89e282de (diff)
parentac35f9c44c0fb3b2f40ae5585c497200b2ba743d (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: examples/network/fortuneclient/client.cpp examples/network/fortuneserver/server.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h src/plugins/platforms/cocoa/qcocoabackingstore.h src/plugins/platforms/cocoa/qcocoaintegration.h src/plugins/platforms/cocoa/qcocoascreen.h src/plugins/platforms/ios/qiosbackingstore.h src/plugins/sqldrivers/oci/qsql_oci.cpp src/widgets/kernel/qwidgetwindow.cpp Change-Id: Ia6dd2c52d4a691b671cf9a2ffca70deccece8f10
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp6
-rw-r--r--tests/auto/gui/kernel/qguitimer/qguitimer.pro2
-rw-r--r--tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp10
-rw-r--r--tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp4
-rw-r--r--tests/auto/gui/kernel/qwindow/BLACKLIST2
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp16
-rw-r--r--tests/auto/gui/qopengl/tst_qopengl.cpp4
-rw-r--r--tests/auto/gui/qvulkan/tst_qvulkan.cpp12
8 files changed, 31 insertions, 25 deletions
diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
index a935258fb8..6ba488aaa7 100644
--- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
+++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
@@ -227,7 +227,7 @@ void tst_QGuiApplication::focusObject()
QOpenGLContext context;
context.create();
context.makeCurrent(&window1);
- QTest::qWaitForWindowExposed(&window1); // Buffer swap only succeeds with exposed window
+ QVERIFY(QTest::qWaitForWindowExposed(&window1)); // Buffer swap only succeeds with exposed window
context.swapBuffers(&window1);
#endif
@@ -392,7 +392,7 @@ void tst_QGuiApplication::changeFocusWindow()
QOpenGLContext context;
context.create();
context.makeCurrent(&window1);
- QTest::qWaitForWindowExposed(&window1); // Buffer swap only succeeds with exposed window
+ QVERIFY(QTest::qWaitForWindowExposed(&window1)); // Buffer swap only succeeds with exposed window
context.swapBuffers(&window1);
#endif
FocusChangeWindow window2;
@@ -406,7 +406,7 @@ void tst_QGuiApplication::changeFocusWindow()
#if defined(Q_OS_QNX) // We either need to create a eglSurface or a create a backing store
// and then post the window in order for screen to show the window
context.makeCurrent(&window2);
- QTest::qWaitForWindowExposed(&window2); // Buffer swap only succeeds with exposed window
+ QVERIFY(QTest::qWaitForWindowExposed(&window2)); // Buffer swap only succeeds with exposed window
context.swapBuffers(&window2);
#endif
QVERIFY(QTest::qWaitForWindowExposed(&window1));
diff --git a/tests/auto/gui/kernel/qguitimer/qguitimer.pro b/tests/auto/gui/kernel/qguitimer/qguitimer.pro
index 8a71e48007..9c58f0e22c 100644
--- a/tests/auto/gui/kernel/qguitimer/qguitimer.pro
+++ b/tests/auto/gui/kernel/qguitimer/qguitimer.pro
@@ -1,4 +1,4 @@
CONFIG += testcase
TARGET = tst_qguitimer
-QT = core gui testlib
+QT = core core-private gui testlib
SOURCES += ../../../corelib/kernel/qtimer/tst_qtimer.cpp
diff --git a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
index 7200d1cc8a..f74ae00bff 100644
--- a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
+++ b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
@@ -62,7 +62,7 @@ void tst_QOpenGLWindow::create()
w.resize(640, 480);
w.show();
- QTest::qWaitForWindowExposed(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
QVERIFY(w.isValid());
}
@@ -111,7 +111,7 @@ void tst_QOpenGLWindow::basic()
w.reset();
w.resize(640, 480);
w.show();
- QTest::qWaitForWindowExposed(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
// Check that the virtuals are invoked.
QCOMPARE(w.initCount, 1);
@@ -170,7 +170,7 @@ void tst_QOpenGLWindow::painter()
PainterWindow w;
w.resize(400, 400);
w.show();
- QTest::qWaitForWindowExposed(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
QCOMPARE(w.img.size(), w.size() * w.devicePixelRatio());
QVERIFY(w.img.pixel(QPoint(5, 5) * w.devicePixelRatio()) == qRgb(0, 0, 255));
@@ -212,7 +212,7 @@ void tst_QOpenGLWindow::partial()
PartialPainterWindow w(u);
w.resize(800, 400);
w.show();
- QTest::qWaitForWindowExposed(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
// Add a couple of small blue rects.
for (int i = 0; i < 10; ++i) {
@@ -285,7 +285,7 @@ void tst_QOpenGLWindow::underOver()
PaintUnderOverWindow w;
w.resize(400, 400);
w.show();
- QTest::qWaitForWindowExposed(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
// under -> paint -> over -> under -> paint -> ... is the only acceptable sequence
QCOMPARE(w.m_state, PaintUnderOverWindow::PaintOver);
diff --git a/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp b/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp
index 7fb79b28ae..ffc440ac2d 100644
--- a/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp
+++ b/tests/auto/gui/kernel/qrasterwindow/tst_qrasterwindow.cpp
@@ -46,7 +46,7 @@ void tst_QRasterWindow::create()
w.resize(640, 480);
w.show();
- QTest::qWaitForWindowExposed(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
}
class PainterWindow : public QRasterWindow
@@ -70,7 +70,7 @@ void tst_QRasterWindow::basic()
w.reset();
w.resize(400, 400);
w.show();
- QTest::qWaitForWindowExposed(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));;
QVERIFY(w.paintCount >= 1);
diff --git a/tests/auto/gui/kernel/qwindow/BLACKLIST b/tests/auto/gui/kernel/qwindow/BLACKLIST
index 9ffcf73d64..3e03d9e236 100644
--- a/tests/auto/gui/kernel/qwindow/BLACKLIST
+++ b/tests/auto/gui/kernel/qwindow/BLACKLIST
@@ -23,3 +23,5 @@ osx
osx-10.11 ci
osx-10.12 ci
+[testInputEvents]
+rhel-7.4
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 24f61e4584..a365d21d36 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -409,13 +409,17 @@ void tst_QWindow::exposeEventOnShrink_QTBUG54040()
QVERIFY(QTest::qWaitForWindowExposed(&window));
- const int initialExposeCount = window.received(QEvent::Expose);
+ int exposeCount = window.received(QEvent::Expose);
window.resize(window.width(), window.height() - 5);
- QTRY_COMPARE(window.received(QEvent::Expose), initialExposeCount + 1);
+ QTRY_VERIFY(window.received(QEvent::Expose) > exposeCount);
+
+ exposeCount = window.received(QEvent::Expose);
window.resize(window.width() - 5, window.height());
- QTRY_COMPARE(window.received(QEvent::Expose), initialExposeCount + 2);
+ QTRY_VERIFY(window.received(QEvent::Expose) > exposeCount);
+
+ exposeCount = window.received(QEvent::Expose);
window.resize(window.width() - 5, window.height() - 5);
- QTRY_COMPARE(window.received(QEvent::Expose), initialExposeCount + 3);
+ QTRY_VERIFY(window.received(QEvent::Expose) > exposeCount);
}
void tst_QWindow::positioning_data()
@@ -486,7 +490,7 @@ void tst_QWindow::positioning()
window.showNormal();
QCoreApplication::processEvents();
- QTest::qWaitForWindowExposed(&window);
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
QMargins originalMargins = window.frameMargins();
@@ -1479,7 +1483,7 @@ void tst_QWindow::activateAndClose()
window.showNormal();
#if defined(Q_OS_QNX) // We either need to create a eglSurface or a create a backing store
// and then post the window in order for screen to show the window
- QTest::qWaitForWindowExposed(&window);
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
QOpenGLContext context;
context.create();
context.makeCurrent(&window);
diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp
index f23eb70a36..5b1af9b6c9 100644
--- a/tests/auto/gui/qopengl/tst_qopengl.cpp
+++ b/tests/auto/gui/qopengl/tst_qopengl.cpp
@@ -1413,7 +1413,7 @@ void tst_QOpenGL::glxContextWrap()
window->setSurfaceType(QWindow::OpenGLSurface);
window->setGeometry(0, 0, 10, 10);
window->show();
- QTest::qWaitForWindowExposed(window);
+ QVERIFY(QTest::qWaitForWindowExposed(window));
QPlatformNativeInterface *nativeIf = QGuiApplicationPrivate::instance()->platformIntegration()->nativeInterface();
QVERIFY(nativeIf);
@@ -1457,7 +1457,7 @@ void tst_QOpenGL::wglContextWrap()
window->setSurfaceType(QWindow::OpenGLSurface);
window->setGeometry(0, 0, 256, 256);
window->show();
- QTest::qWaitForWindowExposed(window.data());
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
QVariant v = ctx->nativeHandle();
QVERIFY(!v.isNull());
diff --git a/tests/auto/gui/qvulkan/tst_qvulkan.cpp b/tests/auto/gui/qvulkan/tst_qvulkan.cpp
index 716d49a2f1..c80c3fed97 100644
--- a/tests/auto/gui/qvulkan/tst_qvulkan.cpp
+++ b/tests/auto/gui/qvulkan/tst_qvulkan.cpp
@@ -116,7 +116,7 @@ void tst_QVulkan::vulkanPlainWindow()
w.setVulkanInstance(&inst);
w.resize(1024, 768);
w.show();
- QTest::qWaitForWindowExposed(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
QCOMPARE(w.vulkanInstance(), &inst);
@@ -182,7 +182,7 @@ void tst_QVulkan::vulkanWindow()
QVERIFY(!w.isValid());
w.resize(1024, 768);
w.show();
- QTest::qWaitForWindowExposed(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
QVERIFY(!w.isValid());
// Now set it. A simple hide - show should be enough to correct, this, no
@@ -194,7 +194,7 @@ void tst_QVulkan::vulkanWindow()
if (pdevs.isEmpty())
QSKIP("No Vulkan physical devices; skip");
w.show();
- QTest::qWaitForWindowExposed(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
QVERIFY(w.isValid());
QCOMPARE(w.vulkanInstance(), &inst);
QVulkanInfoVector<QVulkanExtension> exts = w.supportedDeviceExtensions();
@@ -208,7 +208,7 @@ void tst_QVulkan::vulkanWindow()
// supported lists can be queried before expose too
QVERIFY(w.supportedDeviceExtensions() == exts);
w.show();
- QTest::qWaitForWindowExposed(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
QVERIFY(w.isValid());
QVERIFY(w.flags().testFlag(QVulkanWindow::PersistentResources));
@@ -355,7 +355,7 @@ void tst_QVulkan::vulkanWindowRenderer()
w.setVulkanInstance(&inst);
w.resize(1024, 768);
w.show();
- QTest::qWaitForWindowExposed(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
if (w.availablePhysicalDevices().isEmpty())
QSKIP("No Vulkan physical devices; skip");
@@ -389,7 +389,7 @@ void tst_QVulkan::vulkanWindowGrab()
w.setVulkanInstance(&inst);
w.resize(1024, 768);
w.show();
- QTest::qWaitForWindowExposed(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
if (w.availablePhysicalDevices().isEmpty())
QSKIP("No Vulkan physical devices; skip");