diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2012-03-22 16:47:55 +0000 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-07-17 16:39:35 +0200 |
commit | c9f27f64c853870dc45b09dba7d4a5e2370fd4e1 (patch) | |
tree | 42f5845c16aa10c475ea8be05d3ca011460460a7 /tubes/qa | |
parent | 9bcf81c5645b1fffe6c0253533fe92ee488e60ad (diff) |
tubes: Add preliminary API for sending a file
Crashes if the file transfer fails.
file-transfer-helper.[ch] are, as their license headers state, LGPL
v2.1+. They come from Empathy. I am in the process of refactoring them
so they can live in a future version of telepathy-glib (which is itself
LGPL v2.1+), so their presence here is temporary.
Diffstat (limited to 'tubes/qa')
-rw-r--r-- | tubes/qa/test_manager.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tubes/qa/test_manager.cxx b/tubes/qa/test_manager.cxx index b1ee074d5fb8..ce9a2d0a13db 100644 --- a/tubes/qa/test_manager.cxx +++ b/tubes/qa/test_manager.cxx @@ -59,6 +59,7 @@ public: void testStartBuddySession2(); void testSendPacket(); void testReceivePacket(); + void testSendFile(); void testFlushLoops(); void testDestroyManager1(); void testDestroyManager2(); @@ -81,6 +82,7 @@ public: CPPUNIT_TEST( testStartBuddySession2 ); CPPUNIT_TEST( testSendPacket ); CPPUNIT_TEST( testReceivePacket ); + CPPUNIT_TEST( testSendFile ); CPPUNIT_TEST( testFlushLoops ); CPPUNIT_TEST( testDestroyManager1 ); CPPUNIT_TEST( testDestroyManager2 ); @@ -285,6 +287,25 @@ void TestTeleTubes::testReceivePacket() CPPUNIT_ASSERT( nReceivedPackets == nSentPackets); } +static void TestTeleTubes_FileSent( bool success, void *user_data) +{ + TestTeleTubes *self = reinterpret_cast<TestTeleTubes *>(user_data); + + CPPUNIT_ASSERT( success); + g_main_loop_quit (self->mpMainLoop); +} + +void TestTeleTubes::testSendFile() +{ + TpAccount *pAcc1 = mpManager1->getAccount(maOffererIdentifier); + CPPUNIT_ASSERT( pAcc1 != 0); + /* This has to run after testContactList has run successfully. */ + CPPUNIT_ASSERT( mpAccepterContact != 0); + mpManager1->sendFile( maTestConfigIniURL, + TestTeleTubes_FileSent, this); + spinMainLoop(); +} + void TestTeleTubes::testFlushLoops() { mpManager1->flushLoop(); |