diff options
author | Dario Freddi <dario.freddi@collabora.com> | 2012-02-23 18:10:21 +0100 |
---|---|---|
committer | Dario Freddi <dario.freddi@collabora.com> | 2012-03-13 14:32:22 +0100 |
commit | 739c8ecb2d690dbe192af77c875a6d4c458d6b78 (patch) | |
tree | b9d318abc74c4f36eaa46a52f120865700878324 /tests | |
parent | 06154be16ea79ea6bbb1c206f408eae98d76dc2d (diff) |
captcha-authentication: Also check the signal has been emitted correctly
Diffstat (limited to 'tests')
-rw-r--r-- | tests/dbus/captcha-authentication.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/dbus/captcha-authentication.cpp b/tests/dbus/captcha-authentication.cpp index 98d2a056..3fac07e4 100644 --- a/tests/dbus/captcha-authentication.cpp +++ b/tests/dbus/captcha-authentication.cpp @@ -126,6 +126,8 @@ void TestCaptchaAuthentication::testCaptchaSuccessful() { createCaptchaChannel(); + QSignalSpy spy(mCaptcha.data(), SIGNAL(statusChanged(Tp::CaptchaStatus))); + PendingCaptchas *pendingCaptchas = mCaptcha->requestCaptchas(QStringList() << QLatin1String("image/png")); QVERIFY(connect(pendingCaptchas, SIGNAL(finished(Tp::PendingOperation *)), @@ -148,12 +150,14 @@ void TestCaptchaAuthentication::testCaptchaSuccessful() SLOT(expectSuccessfulCall(Tp::PendingOperation *)))); QCOMPARE(mLoop->exec(), 0); + QCOMPARE(spy.size(), 2); QCOMPARE(mCaptcha->status(), CaptchaStatusSucceeded); } void TestCaptchaAuthentication::testCaptchaRetry() { createCaptchaChannel(true); + QSignalSpy spy(mCaptcha.data(), SIGNAL(statusChanged(Tp::CaptchaStatus))); PendingCaptchas *pendingCaptchas = mCaptcha->requestCaptchas(QStringList() << QLatin1String("image/png")); QVERIFY(connect(pendingCaptchas, @@ -191,6 +195,9 @@ void TestCaptchaAuthentication::testCaptchaRetry() QCOMPARE(mLoop->exec(), 0); QCOMPARE(mCaptcha->status(), CaptchaStatusSucceeded); + + // Check signals now + QCOMPARE(spy.size(), 5); } void TestCaptchaAuthentication::testCaptchaCancel() |