diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2010-02-16 20:09:09 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-02-16 20:09:09 (GMT) |
commit | 757779ae3d27c260214f88411de81e1c32a688b5 (patch) | |
tree | ab4954cf68ec794342b2f22730de87f858ed3ce2 /tests | |
parent | 1e7b737596db7be0a221aa44d1a329d3fdb5d6e3 (diff) | |
parent | 95d3bd3fc993d7c8c1fe92960c617a3392d87f66 (diff) | |
download | Qt-757779ae3d27c260214f88411de81e1c32a688b5.zip Qt-757779ae3d27c260214f88411de81e1c32a688b5.tar.gz Qt-757779ae3d27c260214f88411de81e1c32a688b5.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qdbusconnection/tst_qdbusconnection.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/qdbusconnection/tst_qdbusconnection.cpp index 5e2f3a9..96209b1 100644 --- a/tests/auto/qdbusconnection/tst_qdbusconnection.cpp +++ b/tests/auto/qdbusconnection/tst_qdbusconnection.cpp @@ -80,6 +80,8 @@ class tst_QDBusConnection: public QObject int signalsReceived; public slots: void oneSlot() { ++signalsReceived; } + void exitLoop() { ++signalsReceived; QTestEventLoop::instance().exitLoop(); } + void secondCallWithCallback(); private slots: void noConnection(); @@ -102,6 +104,7 @@ private slots: void multipleInterfacesInQObject(); void slotsWithLessParameters(); + void nestedCallWithCallback(); public: QString serviceName() const { return "com.trolltech.Qt.Autotests.QDBusConnection"; } @@ -618,6 +621,32 @@ void tst_QDBusConnection::slotsWithLessParameters() QCOMPARE(signalsReceived, 1); } +void tst_QDBusConnection::secondCallWithCallback() +{ + qDebug("Hello"); + QDBusConnection con = QDBusConnection::sessionBus(); + QDBusMessage msg = QDBusMessage::createMethodCall(con.baseService(), "/test", QString(), + "test0"); + con.callWithCallback(msg, this, SLOT(exitLoop()), SLOT(secondCallWithCallback())); +} + +void tst_QDBusConnection::nestedCallWithCallback() +{ + TestObject testObject; + QDBusConnection connection = QDBusConnection::sessionBus(); + QVERIFY(connection.registerObject("/test", &testObject, + QDBusConnection::ExportAllContents)); + + QDBusMessage msg = QDBusMessage::createMethodCall(connection.baseService(), "/test", QString(), + "ThisFunctionDoesntExist"); + signalsReceived = 0; + + connection.callWithCallback(msg, this, SLOT(exitLoop()), SLOT(secondCallWithCallback()), 10); + QTestEventLoop::instance().enterLoop(15); + QVERIFY(!QTestEventLoop::instance().timeout()); + QCOMPARE(signalsReceived, 1); +} + QString MyObject::path; QTEST_MAIN(tst_QDBusConnection) |