aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 2d3c8f7ca7..dbf0086a3e 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -304,6 +304,7 @@ private slots:
void qmlCreation();
void clearColor();
+ void grab_data();
void grab();
void multipleWindows();
@@ -929,15 +930,28 @@ void tst_qquickwindow::clearColor()
QCOMPARE(window->color(), QColor(Qt::blue));
}
+void tst_qquickwindow::grab_data()
+{
+ QTest::addColumn<bool>("visible");
+ QTest::newRow("visible") << true;
+ QTest::newRow("invisible") << false;
+}
+
void tst_qquickwindow::grab()
{
+ QFETCH(bool, visible);
+
QQuickWindow window;
window.setColor(Qt::red);
window.resize(250, 250);
- window.show();
- QVERIFY(QTest::qWaitForWindowExposed(&window));
+ if (visible) {
+ window.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
+ } else {
+ window.create();
+ }
QImage content = window.grabWindow();
QCOMPARE(content.width(), window.width());