Update tests to support new didOpen delegate fn

Summary:
Changelog: [General][Fixed] Update tests to support new `didOpen` delegate fn

Add support for the new `didOpen` delegate function in tests.

To follow up separately: the borked tear down sequence when these two tests are ran together (they pass when ran individually)

```
buck2 test @//fbobjc/mode/buck2/ios-tests fbsource//xplat/js/react-native-github/packages/react-native/ReactCommon/jsinspector-modern:testsAppleMac -- ReactInstanceIntegrationTest RuntimeTargetDebuggerSessionObserverTest
```

Reviewed By: hoxyq

Differential Revision: D68632974

fbshipit-source-id: 59da6d9e2d09f2c7e219c1902dd6f9b8ddfee9dc
This commit is contained in:
Edmond Chui
2025-01-27 05:53:15 -08:00
committed by Facebook GitHub Bot
parent 53d94c3abe
commit 46e86dca87
@@ -16,7 +16,6 @@
#include <jsinspector-modern/InspectorInterfaces.h>
#include <jsinspector-modern/InspectorPackagerConnection.h>
#include <functional>
#include <memory>
#include "FollyDynamicMatchers.h"
@@ -42,10 +41,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 {