diff -r 5dc02b23752f -r 3e2da88830cd tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp --- a/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp Tue Jul 06 15:10:48 2010 +0300 +++ b/tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp Wed Aug 18 10:37:55 2010 +0300 @@ -48,6 +48,11 @@ #include #include "../../../shared/util.h" +#ifdef Q_OS_SYMBIAN +// In Symbian OS test data is located in applications private dir +#define SRCDIR "." +#endif + class tst_QDeclarativePositioners : public QObject { Q_OBJECT @@ -70,6 +75,7 @@ void test_repeater(); void test_flow(); void test_flow_resize(); + void test_flow_implicit_resize(); void test_conflictinganchors(); private: QDeclarativeView *createView(const QString &filename); @@ -650,6 +656,28 @@ delete canvas; } +void tst_QDeclarativePositioners::test_flow_implicit_resize() +{ + QDeclarativeView *canvas = createView(SRCDIR "/data/flow-testimplicitsize.qml"); + QVERIFY(canvas->rootObject() != 0); + + QDeclarativeFlow *flow = canvas->rootObject()->findChild("flow"); + QVERIFY(flow != 0); + + QCOMPARE(flow->width(), 100.0); + QCOMPARE(flow->height(), 120.0); + + canvas->rootObject()->setProperty("leftToRight", true); + QCOMPARE(flow->width(), 220.0); + QCOMPARE(flow->height(), 50.0); + + canvas->rootObject()->setProperty("leftToRight", false); + QCOMPARE(flow->width(), 100.0); + QCOMPARE(flow->height(), 120.0); + + delete canvas; +} + QString warningMessage; void interceptWarnings(QtMsgType type, const char *msg)