IconItemTest: Skip when grabToImage fails

This commit is contained in:
David Rosca 2016-02-29 22:29:51 +01:00
parent 30368e1d45
commit 37fde3974e
2 changed files with 8 additions and 1 deletions

View File

@ -1,2 +1,5 @@
import QtQuick 2.0 import QtQuick 2.0
Item { } Item {
width: 100
height: 100
}

View File

@ -70,6 +70,10 @@ void IconItemTest::initTestCase()
m_view->setSource(QUrl::fromLocalFile(QFINDTESTDATA("data/view.qml"))); m_view->setSource(QUrl::fromLocalFile(QFINDTESTDATA("data/view.qml")));
m_view->show(); m_view->show();
QTest::qWaitForWindowExposed(m_view); QTest::qWaitForWindowExposed(m_view);
if (!m_view->rootObject() || !m_view->rootObject()->grabToImage()) {
QSKIP("Cannot grab item to image.");
}
} }
void IconItemTest::cleanup() void IconItemTest::cleanup()