NDI discovery
All checks were successful
CI / React UI Build (push) Successful in 11s
CI / Native Windows Build And Tests (push) Successful in 2m10s
CI / Windows Release Package (push) Has been skipped

This commit is contained in:
Aiden
2026-05-30 20:03:01 +10:00
parent 8ffc011ca0
commit 2b995ac058
21 changed files with 493 additions and 56 deletions

View File

@@ -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();