IconItemTest: Fix loadPixmap and loadImage tests
It only works on CI because data/test_image.png size is the same as implicitSize of IconItem (KIconLoader::Dialog). Differential Revision: https://phabricator.kde.org/D4702
This commit is contained in:
parent
c4b01b0155
commit
148ff6311b
@ -154,6 +154,7 @@ void IconItemTest::loadPixmap()
|
|||||||
QScopedPointer<QQuickItem> item(createIconItem());
|
QScopedPointer<QQuickItem> item(createIconItem());
|
||||||
QPixmap sourcePixmap(QFINDTESTDATA("data/test_image.png"));
|
QPixmap sourcePixmap(QFINDTESTDATA("data/test_image.png"));
|
||||||
|
|
||||||
|
item->setSize(sourcePixmap.size());
|
||||||
item->setProperty("source", sourcePixmap);
|
item->setProperty("source", sourcePixmap);
|
||||||
QVERIFY(item->property("valid").toBool());
|
QVERIFY(item->property("valid").toBool());
|
||||||
|
|
||||||
@ -168,6 +169,7 @@ void IconItemTest::loadImage()
|
|||||||
QScopedPointer<QQuickItem> item(createIconItem());
|
QScopedPointer<QQuickItem> item(createIconItem());
|
||||||
QImage sourceImage(QFINDTESTDATA("data/test_image.png"));
|
QImage sourceImage(QFINDTESTDATA("data/test_image.png"));
|
||||||
|
|
||||||
|
item->setSize(sourceImage.size());
|
||||||
item->setProperty("source", sourceImage);
|
item->setProperty("source", sourceImage);
|
||||||
QVERIFY(item->property("valid").toBool());
|
QVERIFY(item->property("valid").toBool());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user