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 (#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:
committed by
Facebook GitHub Bot
parent
313d7d79d4
commit
b226049a4a
+8
-4
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user