mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
conference: fix sinks creation test
The sinks only should be created when there is a video device available. If no video device is available, no sinks should be created. Change-Id: Iec35288bf9966eb664470b2f8c1e5738f6909893
This commit is contained in:
@ -24,6 +24,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "manager.h"
|
||||
#include "client/videomanager.h"
|
||||
#include "jamidht/connectionmanager.h"
|
||||
#include "jamidht/jamiaccount.h"
|
||||
#include "../../test_runner.h"
|
||||
@ -465,19 +466,33 @@ ConferenceTest::testCreateParticipantsSinks()
|
||||
|
||||
startConference();
|
||||
|
||||
auto infos = DRing::getConferenceInfos(aliceId, confId);
|
||||
auto expectedNumberOfParticipants = 3;
|
||||
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, 5s, [&] {
|
||||
bool sinksStatus = true;
|
||||
for (auto& info : infos) {
|
||||
if (info["uri"] == bobUri) {
|
||||
sinksStatus &= (Manager::instance().getSinkClient(info["sinkId"]) != nullptr);
|
||||
} else if (info["uri"] == carlaUri) {
|
||||
sinksStatus &= (Manager::instance().getSinkClient(info["sinkId"]) != nullptr);
|
||||
// Check participants number
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, 30s, [&]{ return pInfos_.size() == expectedNumberOfParticipants; }));
|
||||
|
||||
if (not jami::getVideoDeviceMonitor().getDeviceList().empty()) {
|
||||
JAMI_INFO() << "Check sinks if video device available.";
|
||||
for (auto& info : pInfos_) {
|
||||
auto uri = string_remove_suffix(info["uri"], '@');
|
||||
if (uri == bobUri) {
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, 5s, [&]{ return Manager::instance().getSinkClient(info["sinkId"]) != nullptr; }));
|
||||
} else if (uri == carlaUri) {
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, 5s, [&]{ return Manager::instance().getSinkClient(info["sinkId"]) != nullptr; }));
|
||||
}
|
||||
}
|
||||
return sinksStatus;
|
||||
}));
|
||||
} else {
|
||||
JAMI_INFO() << "Check sinks if no video device available.";
|
||||
for (auto& info : pInfos_) {
|
||||
auto uri = string_remove_suffix(info["uri"], '@');
|
||||
if (uri == bobUri) {
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, 5s, [&]{ return Manager::instance().getSinkClient(info["sinkId"]) == nullptr; }));
|
||||
} else if (uri == carlaUri) {
|
||||
CPPUNIT_ASSERT(cv.wait_for(lk, 5s, [&]{ return Manager::instance().getSinkClient(info["sinkId"]) == nullptr; }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
hangupConference();
|
||||
|
||||
|
Reference in New Issue
Block a user