diff options
author | David Boddie <dboddie@trolltech.com> | 2010-04-26 11:34:16 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2010-04-26 11:34:16 (GMT) |
commit | 7cfb1403dc66e9151edc5a6c9b723444f2584941 (patch) | |
tree | 5884070ffaee8f7b5774dedcce6994437dcb43fe /tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp | |
parent | 4dba5cc0085482dccfbe70d8c157e094296feed1 (diff) | |
parent | 2ee996bb3e8449e9c9d153326a2f55bc07b6b864 (diff) | |
download | Qt-7cfb1403dc66e9151edc5a6c9b723444f2584941.zip Qt-7cfb1403dc66e9151edc5a6c9b723444f2584941.tar.gz Qt-7cfb1403dc66e9151edc5a6c9b723444f2584941.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Conflicts:
tools/assistant/tools/assistant/helpviewer.cpp
tools/assistant/tools/assistant/helpviewer_qwv.cpp
Diffstat (limited to 'tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp index c8fc001..9ebbbaf 100644 --- a/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp +++ b/tests/auto/declarative/qdeclarativedebugservice/tst_qdeclarativedebugservice.cpp @@ -52,21 +52,19 @@ #include <private/qdeclarativedebugclient_p.h> #include <private/qdeclarativedebugservice_p.h> +#include "../../../shared/util.h" #include "../shared/debugutil_p.h" + class tst_QDeclarativeDebugService : public QObject { Q_OBJECT - -public: - tst_QDeclarativeDebugService(QDeclarativeDebugTestData *data) - { - m_conn = data->conn; - } - +private: QDeclarativeDebugConnection *m_conn; private slots: + void initTestCase(); + void name(); void isEnabled(); void enabledChanged(); @@ -76,6 +74,22 @@ private slots: void objectToString(); }; +void tst_QDeclarativeDebugService::initTestCase() +{ + QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Waiting for connection on port 3769..."); + qputenv("QML_DEBUG_SERVER_PORT", "3769"); + new QDeclarativeEngine(this); + + m_conn = new QDeclarativeDebugConnection(this); + m_conn->connectToHost("127.0.0.1", 3769); + + QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established"); + bool ok = m_conn->waitForConnected(); + Q_ASSERT(ok); + + QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient()); +} + void tst_QDeclarativeDebugService::name() { QString name = "tst_QDeclarativeDebugService::name()"; @@ -140,7 +154,7 @@ void tst_QDeclarativeDebugService::idForObject() int idB = QDeclarativeDebugService::idForObject(objB); QVERIFY(idB != idA); QCOMPARE(QDeclarativeDebugService::objectForId(idB), objB); - + delete objA; delete objB; } @@ -170,21 +184,6 @@ void tst_QDeclarativeDebugService::objectToString() delete obj; } - -class tst_QDeclarativeDebugService_Factory : public QDeclarativeTestFactory -{ -public: - QObject *createTest(QDeclarativeDebugTestData *data) { return new tst_QDeclarativeDebugService(data); } -}; - -// This does not use QTEST_MAIN because the test has to be created and run -// in a separate thread. -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - tst_QDeclarativeDebugService_Factory factory; - return QDeclarativeDebugTest::runTests(&factory); -} +QTEST_MAIN(tst_QDeclarativeDebugService) #include "tst_qdeclarativedebugservice.moc" |