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