From d79eb9b3e824b2d61ae4412889d0f8a0eb8e688c Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 10:57:33 +1000 Subject: set html property --- tests/auto/declarative/qfxwebview/data/sethtml.qml | 5 +++++ tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 tests/auto/declarative/qfxwebview/data/sethtml.qml diff --git a/tests/auto/declarative/qfxwebview/data/sethtml.qml b/tests/auto/declarative/qfxwebview/data/sethtml.qml new file mode 100644 index 0000000..063b5a8 --- /dev/null +++ b/tests/auto/declarative/qfxwebview/data/sethtml.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +WebView { + html: "

This is a string set on the WebView" +} diff --git a/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp b/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp index 9ca6312..a8a0854 100644 --- a/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp +++ b/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp @@ -55,7 +55,8 @@ public: tst_qfxwebview() {} private slots: - void testBasicProperties(); + void basicProperties(); + void setHtml(); void cleanupTestCase(); @@ -102,7 +103,7 @@ void tst_qfxwebview::checkNoErrors(const QmlComponent& component) QVERIFY(!component.isError()); } -void tst_qfxwebview::testBasicProperties() +void tst_qfxwebview::basicProperties() { QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/basic.qml")); checkNoErrors(component); @@ -138,6 +139,15 @@ void tst_qfxwebview::testBasicProperties() QVERIFY(!wv->stopAction()->isEnabled()); } +void tst_qfxwebview::setHtml() +{ + QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/sethtml.qml")); + checkNoErrors(component); + QmlGraphicsWebView *wv = qobject_cast(component.create()); + QVERIFY(wv != 0); + QCOMPARE(wv->html(),QString("

This is a string set on the WebView

")); +} + QTEST_MAIN(tst_qfxwebview) #include "tst_qfxwebview.moc" -- cgit v0.12