mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
53d94c3abe
commit
46e86dca87
+8
-4
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user