From: Charles Yin Date: Wed, 18 Apr 2012 11:01:57 +0000 (+1000) Subject: Clean up qmltest code X-Git-Tag: 071012131707~601 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=458eb3cce93162dced2649e44c59f27bb088f07c;p=profile%2Fivi%2Fqtdeclarative.git Clean up qmltest code 1. Remove qmlviewer related code from TestCase.qml 2. util.wrapper is no longer used Change-Id: I17d9198a7871762da07a790700d69504b8226c48 Reviewed-by: Michael Brasser --- diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml index 371bba9..41e1686 100644 --- a/src/imports/testlib/TestCase.qml +++ b/src/imports/testlib/TestCase.qml @@ -66,10 +66,7 @@ Item { // other test failed which this one depends on). property bool optional: false - // Property that is set to true when the main window is shown. - // We need to set the property value in an odd way to handle - // both qmlviewer and the QtQuickTest module test wrapper. - property bool windowShown: util.wrapper ? qtest.windowShown : false + property bool windowShown: qtest.windowShown // Internal private state. Identifiers prefixed with qtest are reserved. property bool qtest_prevWhen: true @@ -688,15 +685,6 @@ Item { } } - // The test framework will set util.windowShown when the - // window is actually shown. If we are running with qmlviewer, - // then this won't happen. So we use a timer instead. - Timer { - id: qtest_windowShowTimer - interval: 100 - repeat: false - onTriggered: { windowShown = true } - } Component.onCompleted: { qtest.hasTestCase = true; @@ -724,9 +712,6 @@ Item { if (optional) TestLogger.log_optional_test(qtest_testId) qtest_prevWhen = when - var isQmlViewer = util.wrapper ? false : true - if (isQmlViewer) - qtest_windowShowTimer.running = true if (when && !completed && !running) qtest_run() } diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp index 18039e7..459d34f 100644 --- a/src/imports/testlib/main.cpp +++ b/src/imports/testlib/main.cpp @@ -62,7 +62,6 @@ class QuickTestUtil : public QObject { Q_OBJECT Q_PROPERTY(bool printAvailableFunctions READ printAvailableFunctions NOTIFY printAvailableFunctionsChanged) - Q_PROPERTY(bool wrapper READ wrapper NOTIFY wrapperChanged) Q_PROPERTY(int dragThreshold READ dragThreshold NOTIFY dragThresholdChanged) public: QuickTestUtil(QObject *parent = 0) @@ -75,15 +74,10 @@ public: { return QTest::printAvailableFunctions; } - bool wrapper() const - { - return true; - } int dragThreshold() const { return qApp->styleHints()->startDragDistance(); } Q_SIGNALS: void printAvailableFunctionsChanged(); - void wrapperChanged(); void dragThresholdChanged(); public Q_SLOTS: @@ -91,7 +85,6 @@ public Q_SLOTS: QQmlV8Handle typeName(const QVariant& v) const { QString name(v.typeName()); - //qDebug() << "type:" << name << " string value:" << v.toString() << " value:" << v; if (v.canConvert()) { QQmlType *type = 0; const QMetaObject *mo = v.value()->metaObject();