Commit 251c259b authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.autoTest: adds testComponentLoadingTabWidget

parent 6e388a39
...@@ -3343,6 +3343,35 @@ void TestCore::testSubComponentManager() ...@@ -3343,6 +3343,35 @@ void TestCore::testSubComponentManager()
QVERIFY(myButtonMetaInfo.property("border.width", true).isValid()); QVERIFY(myButtonMetaInfo.property("border.width", true).isValid());
} }
void TestCore::testComponentLoadingTabWidget()
{
QSKIP("TODO: fails", SkipAll);
QString fileName = QString(QTCREATORDIR) + "/tests/auto/qml/qmldesigner/data/fx/tabs.qml";
QFile file(fileName);
QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text));
QPlainTextEdit textEdit;
textEdit.setPlainText(file.readAll());
NotIndentingTextEditModifier modifier(&textEdit);
QScopedPointer<Model> model(Model::create("Qt/Item"));
model->setFileUrl(QUrl::fromLocalFile(fileName));
QScopedPointer<SubComponentManager> subComponentManager(new SubComponentManager(model->metaInfo(), 0));
subComponentManager->update(QUrl::fromLocalFile(fileName), modifier.text().toUtf8());
QScopedPointer<TestRewriterView> testRewriterView(new TestRewriterView());
testRewriterView->setTextModifier(&modifier);
model->attachView(testRewriterView.data());
QVERIFY(testRewriterView->errors().isEmpty());
QVERIFY(testRewriterView->rootModelNode().isValid());
ModelNode rootModelNode = testRewriterView->rootModelNode();
QCOMPARE(rootModelNode.type(), QLatin1String("TabWidget"));
}
void TestCore::testAnchorsAndRewriting() void TestCore::testAnchorsAndRewriting()
{ {
const QString qmlString("import Qt 4.7\n" const QString qmlString("import Qt 4.7\n"
......
...@@ -164,6 +164,7 @@ private slots: ...@@ -164,6 +164,7 @@ private slots:
void testCopyModelRewriter1(); void testCopyModelRewriter1();
void testCopyModelRewriter2(); void testCopyModelRewriter2();
void testSubComponentManager(); void testSubComponentManager();
void testComponentLoadingTabWidget();
void testAnchorsAndRewriting(); void testAnchorsAndRewriting();
void testAnchorsAndRewritingCenter(); void testAnchorsAndRewritingCenter();
......
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