summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-09-18 20:58:48 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-10-01 11:38:56 (GMT)
commit5a91a3ef54c00a6d4d960725f2ff84b5e0c43cab (patch)
treede73910e121edc91f6eec2a9af863b7be8d352e3 /Swift/Controllers/Chat/UnitTest
parent5166d2def025a4fb1e3c4a723d90dc82669b36ee (diff)
downloadswift-5a91a3ef54c00a6d4d960725f2ff84b5e0c43cab.zip
swift-5a91a3ef54c00a6d4d960725f2ff84b5e0c43cab.tar.bz2
Use caps for enabling chat state notifications.
Resolves: #93
Diffstat (limited to 'Swift/Controllers/Chat/UnitTest')
-rw-r--r--Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp b/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp
index a17575c..e770e88 100644
--- a/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp
+++ b/Swift/Controllers/Chat/UnitTest/ChatsManagerTest.cpp
@@ -14,6 +14,8 @@
#include "Swift/Controllers/UIInterfaces/ChatWindowFactory.h"
#include "Swift/Controllers/UIInterfaces/ChatListWindowFactory.h"
#include "Swiften/Client/Client.h"
+#include "Swiften/Disco/EntityCapsManager.h"
+#include "Swiften/Disco/CapsProvider.h"
#include "Swift/Controllers/Chat/ChatController.h"
#include "Swift/Controllers/XMPPEvents/EventController.h"
#include "Swift/Controllers/Chat/MUCController.h"
@@ -35,6 +37,10 @@
using namespace Swift;
+class DummyCapsProvider : public CapsProvider {
+ DiscoInfo::ref getCaps(const String&) const {return DiscoInfo::ref(new DiscoInfo());}
+};
+
class ChatsManagerTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(ChatsManagerTest);
@@ -57,6 +63,7 @@ public:
stanzaChannel_ = new DummyStanzaChannel();
iqChannel_ = new DummyIQChannel();
iqRouter_ = new IQRouter(iqChannel_);
+ capsProvider_ = new DummyCapsProvider();
eventController_ = new EventController();
chatWindowFactory_ = mocks_->InterfaceMock<ChatWindowFactory>();
xmppRoster_ = new XMPPRoster();
@@ -66,9 +73,10 @@ public:
serverDiscoInfo_ = boost::shared_ptr<DiscoInfo>(new DiscoInfo());
presenceSender_ = new PresenceSender(stanzaChannel_);
uiEventStream_ = new UIEventStream();
+ entityCapsManager_ = new EntityCapsManager(capsProvider_, stanzaChannel_);
chatListWindowFactory_ = mocks_->InterfaceMock<ChatListWindowFactory>();
mocks_->ExpectCall(chatListWindowFactory_, ChatListWindowFactory::createWindow).With(uiEventStream_).Return(NULL);
- manager_ = new ChatsManager(jid_, stanzaChannel_, iqRouter_, eventController_, chatWindowFactory_, nickResolver_, presenceOracle_, serverDiscoInfo_, presenceSender_, uiEventStream_, chatListWindowFactory_, true, NULL, mucRegistry_);
+ manager_ = new ChatsManager(jid_, stanzaChannel_, iqRouter_, eventController_, chatWindowFactory_, nickResolver_, presenceOracle_, serverDiscoInfo_, presenceSender_, uiEventStream_, chatListWindowFactory_, true, NULL, mucRegistry_, entityCapsManager_);
avatarManager_ = new NullAvatarManager();
manager_->setAvatarManager(avatarManager_);
@@ -89,6 +97,8 @@ public:
delete iqRouter_;
delete uiEventStream_;
delete xmppRoster_;
+ delete entityCapsManager_;
+ delete capsProvider_;
}
void testFirstOpenWindowIncoming() {
@@ -319,6 +329,8 @@ private:
UIEventStream* uiEventStream_;
ChatListWindowFactory* chatListWindowFactory_;
MUCRegistry* mucRegistry_;
+ EntityCapsManager* entityCapsManager_;
+ CapsProvider* capsProvider_;
};
CPPUNIT_TEST_SUITE_REGISTRATION(ChatsManagerTest);