Skip to content

Commit fc60030

Browse files
motiz88meta-codesync[bot]
authored andcommitted
Add basic test for NetworkReporter and CDP Network domain (facebook#54049)
Summary: Pull Request resolved: facebook#54049 Changelog: [Internal] Adds `JsiIntegrationTest`-based tests for the C++ layer responsible for handling the CDP `Network` domain. The tests use `NetworkReporter` to mimic the behaviour of a React Native platform that is generating network events. NOTE: There are **significant problems** with the `NetworkReporter` / `NetworkHandler` singleton design: cross-Host and cross-Instance data pollution/corruption, inability to inspect multiple Hosts at once, inconsistency between the singleton's state and the CDP session's state, etc. The singletons similarly lack any kind of mechanism for test isolation (e.g. methods for clearing state between tests). As we iteratively fix these problems, the tests will require updating (and we'll be able to write stricter tests to cover the fixes). Reviewed By: huntie Differential Revision: D83746505 fbshipit-source-id: 7ee3c68e67f0d29587cbfafa98cf107d27065ffc
1 parent c0e381d commit fc60030

File tree

6 files changed

+481
-13
lines changed

6 files changed

+481
-13
lines changed

packages/react-native/ReactCommon/jsinspector-modern/tests/JsiIntegrationTest.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ class JsiIntegrationPortableTestBase : public ::testing::Test,
4747
protected:
4848
Executor executor_;
4949

50-
JsiIntegrationPortableTestBase()
51-
: inspectorFlagsGuard_{EngineAdapter::getInspectorFlagOverrides()},
52-
engineAdapter_{executor_} {}
50+
JsiIntegrationPortableTestBase(InspectorFlagOverrides overrides = {})
51+
: inspectorFlagsGuard_(overrides), engineAdapter_{executor_} {}
5352

5453
void SetUp() override {
5554
// NOTE: Using SetUp() so we can call virtual methods like

0 commit comments

Comments
 (0)