NDI discovery
This commit is contained in:
@@ -83,6 +83,25 @@ void TestConfigEndpointUsesCallback()
|
||||
ExpectEquals(response.body, "{\"diskLoaded\":true}", "config endpoint returns callback JSON");
|
||||
}
|
||||
|
||||
void TestNdiSourcesEndpointUsesCallback()
|
||||
{
|
||||
using namespace RenderCadenceCompositor;
|
||||
|
||||
HttpControlServer server;
|
||||
HttpControlServerCallbacks callbacks;
|
||||
callbacks.getNdiSourcesJson = []() { return std::string("{\"ok\":true,\"sources\":[{\"name\":\"DESKTOP (Camera)\"}]}"); };
|
||||
server.SetCallbacksForTest(callbacks);
|
||||
|
||||
HttpControlServer::HttpRequest request;
|
||||
request.method = "GET";
|
||||
request.path = "/api/ndi/sources";
|
||||
|
||||
const HttpControlServer::HttpResponse response = server.RouteRequestForTest(request);
|
||||
ExpectEquals(response.status, "200 OK", "NDI sources endpoint succeeds");
|
||||
ExpectEquals(response.contentType, "application/json", "NDI sources endpoint is JSON");
|
||||
Expect(response.body.find("DESKTOP (Camera)") != std::string::npos, "NDI sources endpoint returns callback JSON");
|
||||
}
|
||||
|
||||
void TestWebSocketAcceptKey()
|
||||
{
|
||||
using namespace RenderCadenceCompositor;
|
||||
@@ -242,6 +261,7 @@ int main()
|
||||
TestParsesHttpRequest();
|
||||
TestStateEndpointUsesCallback();
|
||||
TestConfigEndpointUsesCallback();
|
||||
TestNdiSourcesEndpointUsesCallback();
|
||||
TestWebSocketAcceptKey();
|
||||
TestRootServesUiIndex();
|
||||
TestKnownPostEndpointReturnsActionError();
|
||||
|
||||
Reference in New Issue
Block a user