diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-11-03 09:18:46 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-11-03 09:18:46 (GMT) |
commit | e8c547f283cdedfeacb056e672020a2dbe4157ff (patch) | |
tree | 56cda8d5279970435d35f75cce49d82aa338ee54 | |
parent | a36694346164f0865e16003745839279dad7f61e (diff) | |
parent | feeb75edbbe0912f1719cf405be5927da6890d47 (diff) | |
download | Qt-e8c547f283cdedfeacb056e672020a2dbe4157ff.zip Qt-e8c547f283cdedfeacb056e672020a2dbe4157ff.tar.gz Qt-e8c547f283cdedfeacb056e672020a2dbe4157ff.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
-rw-r--r-- | tests/auto/declarative/qmlfontloader/tst_qmlfontloader.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlfontloader/tst_qmlfontloader.cpp b/tests/auto/declarative/qmlfontloader/tst_qmlfontloader.cpp index a65ecf4..464ae5d 100644 --- a/tests/auto/declarative/qmlfontloader/tst_qmlfontloader.cpp +++ b/tests/auto/declarative/qmlfontloader/tst_qmlfontloader.cpp @@ -42,6 +42,7 @@ #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> #include <private/qmlfontloader_p.h> +#include "../../../shared/util.h" class tst_qmlfontloader : public QObject @@ -51,8 +52,10 @@ public: tst_qmlfontloader(); private slots: + void nofont(); void namedfont(); void localfont(); + void webfont(); private slots: @@ -64,6 +67,16 @@ tst_qmlfontloader::tst_qmlfontloader() { } +void tst_qmlfontloader::nofont() +{ + QString componentStr = "import Qt 4.6\nFontLoader { }"; + QmlComponent component(&engine, componentStr.toLatin1(), QUrl("file://")); + QmlFontLoader *fontObject = qobject_cast<QmlFontLoader*>(component.create()); + + QVERIFY(fontObject != 0); + QCOMPARE(fontObject->name(), QString("")); +} + void tst_qmlfontloader::namedfont() { QString componentStr = "import Qt 4.6\nFontLoader { name: \"Helvetica\" }"; @@ -84,6 +97,16 @@ void tst_qmlfontloader::localfont() QCOMPARE(fontObject->name(), QString("Fontin")); } +void tst_qmlfontloader::webfont() +{ + QString componentStr = "import Qt 4.6\nFontLoader { source: \"http://www.princexml.com/fonts/steffmann/Starburst.ttf\" }"; + QmlComponent component(&engine, componentStr.toLatin1(), QUrl("file://")); + QmlFontLoader *fontObject = qobject_cast<QmlFontLoader*>(component.create()); + + QVERIFY(fontObject != 0); + QTRY_COMPARE(fontObject->name(), QString("Starburst")); +} + QTEST_MAIN(tst_qmlfontloader) #include "tst_qmlfontloader.moc" |