diff options
Diffstat (limited to 'tests/auto/quick/qquickwindow/tst_qquickwindow.cpp')
-rw-r--r-- | tests/auto/quick/qquickwindow/tst_qquickwindow.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp index 300ca392f9..dd00154935 100644 --- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp +++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp @@ -370,6 +370,8 @@ private slots: void pointerEventTypeAndPointCount(); + void grabContentItemToImage(); + private: QTouchDevice *touchDevice; QTouchDevice *touchDeviceWithVelocity; @@ -2554,6 +2556,23 @@ void tst_qquickwindow::pointerEventTypeAndPointCount() QVERIFY(!pte.touchPointById(0)); } +void tst_qquickwindow::grabContentItemToImage() +{ + QQmlEngine engine; + QQmlComponent component(&engine); + component.loadUrl(testFileUrl("grabContentItemToImage.qml")); + + QObject *created = component.create(); + QScopedPointer<QObject> cleanup(created); + QVERIFY(created); + + QQuickWindow *window = qobject_cast<QQuickWindow *>(created); + QVERIFY(QTest::qWaitForWindowActive(window)); + + QMetaObject::invokeMethod(window, "grabContentItemToImage"); + QTRY_COMPARE(created->property("success").toInt(), 1); +} + QTEST_MAIN(tst_qquickwindow) #include "tst_qquickwindow.moc" |