Skip to content

Commit 4223285

Browse files
cortinicofacebook-github-bot
authored andcommitted
Fix broken LayoutableShadowNodeTest after Modal fix. (#52130)
Summary: Pull Request resolved: #52130 After D73948178, Modals now need to access JNI to get the dimension of the screen to properly position the modal on first rendering. Before my change, the Modal was positioned in 0,0 (which is the default behavior for CXX). I'm suppressing this test for Android, as it will keep on running with the previous behavior for CXX. Changelog: [Internal] [Changed] - Reviewed By: javache Differential Revision: D76979787 fbshipit-source-id: 78675712f97baee29036f943b2a8bcd23047e4ed
1 parent 55b87a5 commit 4223285

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/react-native/ReactCommon/react/renderer/core/tests/LayoutableShadowNodeTest.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,10 @@ TEST(LayoutableShadowNodeTest, relativeLayoutMetricsOnClonedNode) {
915915
* │ └──────────────────────┘│
916916
* └─────────────────────────┘
917917
*/
918+
// We're not running this on Android as ModalHostViewShadowNode
919+
// need to go through JNI to resolve the initial screen size
920+
// in order to position the modal.
921+
#ifndef ANDROID
918922
TEST(
919923
LayoutableShadowNodeTest,
920924
relativeLayoutMetricsOnNodesCrossingRootKindNode) {
@@ -951,6 +955,7 @@ TEST(
951955
EXPECT_EQ(relativeLayoutMetrics.frame.origin.x, 10);
952956
EXPECT_EQ(relativeLayoutMetrics.frame.origin.y, 10);
953957
}
958+
#endif
954959

955960
TEST(LayoutableShadowNodeTest, includeViewportOffset) {
956961
auto builder = simpleComponentBuilder();

0 commit comments

Comments
 (0)