Skip to content

Add unit test for TextLayoutManager desired width optimization (#59202) - #59202

Closed
Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:export-D125868474
Closed

Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:export-D125868474

Conversation

@Abbondanzo

@Abbondanzo Abbondanzo commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Add a Robolectric test that verifies Layout.getDesiredWidth is only called when necessary during text layout.

The test confirms the optimization that avoids expensive width measurements for EXACTLY mode and for AT_MOST mode when boring text doesn't fit. It uses mockStatic to intercept calls to Layout.getDesiredWidth and verifies the correct number of invocations across different measure modes.

Changelog: [Internal]

Reviewed By: andrewdacenko

Differential Revision: D125868474

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 19, 2026
@meta-codesync

meta-codesync Bot commented Oct 19, 2026

Copy link
Copy Markdown

@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D125868474.

…#59202)

Summary:

Add a Robolectric test that verifies `Layout.getDesiredWidth` is only called when necessary during text layout.

The test confirms the optimization that avoids expensive width measurements for `EXACTLY` mode and for `AT_MOST` mode when boring text doesn't fit. It uses `mockStatic` to intercept calls to `Layout.getDesiredWidth` and verifies the correct number of invocations across different measure modes.

Changelog: [Internal]

Reviewed By: andrewdacenko

Differential Revision: D125868474
@meta-codesync meta-codesync Bot changed the title Add unit test for TextLayoutManager desired width optimization Add unit test for TextLayoutManager desired width optimization (#59202) Oct 22, 2026
@Abbondanzo
Abbondanzo force-pushed the export-D125868474 branch 2 times, most recently from 0c25c1e to f37c6d1 Compare October 22, 2026 16:48
@github-actions

Copy link
Copy Markdown

Visual regression

No visual differences at f37c6d151c60.

android: no baseline for this environment

ios: no capture

@meta-codesync meta-codesync Bot closed this in 57cc022 Oct 22, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Oct 22, 2026
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @Abbondanzo in 57cc022

When will my fix make it into a release? | How to file a pick request?

@meta-codesync

meta-codesync Bot commented Oct 22, 2026

Copy link
Copy Markdown

This pull request has been merged in 57cc022.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants