Update tests to support new didOpen delegate fn (#50006)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50006

Changelog: [Internal]

Reviewed By: robhogan, huntie

Differential Revision: D71111802

fbshipit-source-id: 733a601007125b6aed4411ba95a41845823a26da
This commit is contained in:
Vitali Zaidman
2025-03-13 04:22:14 -07:00
committed by Facebook GitHub Bot
parent 313d7d79d4
commit b226049a4a
@@ -16,7 +16,6 @@
#include <jsinspector-modern/InspectorInterfaces.h>
#include <jsinspector-modern/InspectorPackagerConnection.h>
#include <functional>
#include <memory>
#include "FollyDynamicMatchers.h"
@@ -41,10 +40,15 @@ class InspectorPackagerConnectionTestBase : public testing::Test {
"my-device",
"my-app",
packagerConnectionDelegates_.make_unique(asyncExecutor_)}) {
auto makeSocket = webSockets_.lazily_make_unique<
const std::string&,
std::weak_ptr<IWebSocketDelegate>>();
ON_CALL(*packagerConnectionDelegate(), connectWebSocket(_, _))
.WillByDefault(webSockets_.lazily_make_unique<
const std::string&,
std::weak_ptr<IWebSocketDelegate>>());
.WillByDefault([makeSocket](auto&&... args) {
auto socket = makeSocket(std::forward<decltype(args)>(args)...);
socket->getDelegate().didOpen();
return std::move(socket);
});
}
void TearDown() override {