Commit 102f9154 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

Tests.QmlDesigner: adding testBasicStatesQtQuick20



Testing basic states for Qt Quick 2.0.

Change-Id: I86b4dbaffa3ec340eb175a1cd687eef465d87efe
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 3c42ca41
......@@ -4149,6 +4149,32 @@ void tst_TestCore::testQtQuick20Basic()
QCOMPARE(rootModelNode.majorVersion(), 2);
}
void tst_TestCore::testQtQuick20BasicRectangle()
{
QPlainTextEdit textEdit;
textEdit.setPlainText("\nimport QtQuick 2.0\nRectangle {\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);
QTest::qSleep(1000);
QApplication::processEvents();
QVERIFY(testRewriterView->errors().isEmpty());
ModelNode rootModelNode(testRewriterView->rootModelNode());
QVERIFY(rootModelNode.isValid());
QCOMPARE(rootModelNode.type(), QString("QtQuick.Rectangle"));
QCOMPARE(rootModelNode.metaInfo().majorVersion(), 2);
QCOMPARE(rootModelNode.metaInfo().minorVersion(), 0);
QCOMPARE(rootModelNode.majorQtQuickVersion(), 2);
QCOMPARE(rootModelNode.majorVersion(), 2);
}
void tst_TestCore::testStatesRewriter()
{
QPlainTextEdit textEdit;
......
......@@ -168,6 +168,7 @@ private slots:
// integration tests
//
void testBasicStates();
void testBasicStatesQtQuick20();
void testStates();
void testStatesBaseState();
void testStatesRewriter();
......
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