From 91a84e9e66110aa2544e3c72482f36d48a18a15c Mon Sep 17 00:00:00 2001 From: DevmateUtgenCppGeneralFBOrg Bot Date: Mon, 24 Aug 2026 03:50:58 -0700 Subject: [PATCH] xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.cpp Reviewed By: cortinico Differential Revision: D117160198 --- .../test/JReactHostInspectorTargetTest.cpp | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 packages/react-native/ReactAndroid/src/main/jni/react/runtime/jni/test/JReactHostInspectorTargetTest.cpp diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/runtime/jni/test/JReactHostInspectorTargetTest.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/runtime/jni/test/JReactHostInspectorTargetTest.cpp new file mode 100644 index 000000000000..fd293ced3fa6 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/jni/react/runtime/jni/test/JReactHostInspectorTargetTest.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include + +#include + +#include + +namespace facebook::react { +namespace { + +TEST( + JReactHostInspectorTargetTest, + testTracingStartedRejectsUnsupportedTracingMode) { + TracingDelegate tracingDelegate; + constexpr auto kUnsupportedTracingMode = + static_cast(-1); + + EXPECT_THROW( + tracingDelegate.onTracingStarted( + kUnsupportedTracingMode, /*screenshotsCategoryEnabled=*/true), + std::logic_error); +} + +} // namespace +} // namespace facebook::react