Commit 3c5b64a7 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

Tests.QmlDesigner: adding basic test for Qt Quick 2.0



Change-Id: Id98be8ec130eb5adfcbd490600369e8353f168b8
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent 4757cfa9
......@@ -4019,6 +4019,28 @@ void tst_TestCore::testMetaInfoListProperties()
QApplication::processEvents();
}
void tst_TestCore::testQtQuick20Basic()
{
QPlainTextEdit textEdit;
textEdit.setPlainText("\nimport QtQuick 2.0\n\nItem {\n}\n");
NotIndentingTextEditModifier modifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item"));
QVERIFY(model.data());
TestRewriterView *testRewriterView = new TestRewriterView(model.data());
testRewriterView->setTextModifier(&modifier);
model->attachView(testRewriterView);
QVERIFY(testRewriterView->errors().isEmpty());
ModelNode rootModelNode(testRewriterView->rootModelNode());
QVERIFY(rootModelNode.isValid());
QCOMPARE(rootModelNode.metaInfo().majorVersion(), 2);
QCOMPARE(rootModelNode.metaInfo().minorVersion(), 0);
QCOMPARE(rootModelNode.majorQtQuickVersion(), 2);
QCOMPARE(rootModelNode.majorVersion(), 2);
}
void tst_TestCore::testStatesRewriter()
{
QPlainTextEdit textEdit;
......
......@@ -63,6 +63,7 @@ private slots:
void testMetaInfoProperties();
void testMetaInfoDotProperties();
void testMetaInfoListProperties();
void testQtQuick20Basic();
//
// unit tests Model, ModelNode, NodeProperty, AbstractView
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment