Skip to content

Commit d205318

Browse files
motiz88facebook-github-bot
authored andcommitted
Add basic test for NetworkReporter and CDP Network domain
Summary: 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. Differential Revision: D83746505
1 parent 3e438fb commit d205318

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)