diff options
Diffstat (limited to 'tests/auto/declarative/qmldom/tst_qmldom.cpp')
-rw-r--r-- | tests/auto/declarative/qmldom/tst_qmldom.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/auto/declarative/qmldom/tst_qmldom.cpp b/tests/auto/declarative/qmldom/tst_qmldom.cpp index 8df1829..ca8929d 100644 --- a/tests/auto/declarative/qmldom/tst_qmldom.cpp +++ b/tests/auto/declarative/qmldom/tst_qmldom.cpp @@ -95,10 +95,19 @@ void tst_qmldom::loadComposite() QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); QmlDomDocument document; - QVERIFY(document.load(&engine, file.readAll())); + QVERIFY(document.load(&engine, file.readAll(), QUrl::fromLocalFile(file.fileName()))); QVERIFY(document.errors().isEmpty()); - // TODO: How should sub components be represented? + QmlDomObject rootItem = document.rootObject(); + QVERIFY(rootItem.isValid()); + QCOMPARE(rootItem.objectType(), QByteArray("MyComponent")); + QCOMPARE(rootItem.properties().size(), 2); + + QmlDomProperty widthProperty = rootItem.property("width"); + QVERIFY(widthProperty.value().isLiteral()); + + QmlDomProperty heightProperty = rootItem.property("height"); + QVERIFY(heightProperty.value().isLiteral()); } void tst_qmldom::testValueSource() |