Skip to content

Commit

Permalink
Update test to validate Debugger domain persistence (#43446)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #43446

## Context

We are migrating to the new Hermes `CDPAgent` and `CDPDebugAPI` APIs in the modern CDP server (previously `HermesCDPHandler`).

## This diff

Following D54712525, add a test case that validates `"Debugger.enable"` is persisted between reloads. This has been actioned by creating a further test group, `ModernHermesVariants`, and scoping the existing `ResolveBreakpointAfterReload` to this, with the removed second `"Debugger.enable"` message.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D54808212

fbshipit-source-id: 0775beb85a0907cca4dccbc77ec461d9515ab078
  • Loading branch information
huntie authored and facebook-github-bot committed Mar 13, 2024
1 parent 5d711f8 commit 4f10f30
Showing 1 changed file with 15 additions and 5 deletions.
Expand Up @@ -179,6 +179,8 @@ using AllHermesVariants = Types<
JsiIntegrationTestHermesEngineAdapter,
JsiIntegrationTestHermesWithCDPAgentEngineAdapter>;

using ModernHermesVariants =
Types<JsiIntegrationTestHermesWithCDPAgentEngineAdapter>;
using LegacyHermesVariants = Types<JsiIntegrationTestHermesEngineAdapter>;

TYPED_TEST_SUITE(JsiIntegrationPortableTest, AllEngines);
Expand All @@ -192,7 +194,12 @@ using JsiIntegrationHermesLegacyTest =
JsiIntegrationPortableTest<EngineAdapter>;
TYPED_TEST_SUITE(JsiIntegrationHermesLegacyTest, LegacyHermesVariants);

#pragma region JsiIntegrationPortableTest
template <typename EngineAdapter>
using JsiIntegrationHermesModernTest =
JsiIntegrationPortableTest<EngineAdapter>;
TYPED_TEST_SUITE(JsiIntegrationHermesModernTest, ModernHermesVariants);

#pragma region AllEngines

TYPED_TEST(JsiIntegrationPortableTest, ConnectWithoutCrashing) {
this->connect();
Expand Down Expand Up @@ -472,8 +479,8 @@ TYPED_TEST(JsiIntegrationPortableTest, ExceptionDuringAddBindingIsIgnored) {
EXPECT_TRUE(this->eval("globalThis.foo === 42").getBool());
}

#pragma endregion
#pragma region JsiIntegrationHermesTest
#pragma endregion // AllEngines
#pragma region AllHermesVariants

TYPED_TEST(JsiIntegrationHermesTest, EvaluateExpression) {
this->connect();
Expand Down Expand Up @@ -559,7 +566,10 @@ TYPED_TEST(JsiIntegrationHermesTest, EvaluateExpressionInExecutionContext) {
std::to_string(executionContextId)));
}

TYPED_TEST(JsiIntegrationHermesTest, ResolveBreakpointAfterReload) {
#pragma endregion // AllHermesVariants
#pragma region ModernHermesVariants

TYPED_TEST(JsiIntegrationHermesModernTest, ResolveBreakpointAfterReload) {
this->connect();

InSequence s;
Expand Down Expand Up @@ -610,6 +620,6 @@ TYPED_TEST(JsiIntegrationHermesTest, ResolveBreakpointAfterReload) {
scriptInfo->value()["params"]["scriptId"]);
}

#pragma endregion
#pragma endregion // ModernHermesVariants

} // namespace facebook::react::jsinspector_modern

0 comments on commit 4f10f30

Please sign in to comment.