Repository navigation
Add unit test for TextLayoutManager desired width optimization (#59202) - #59202
Closed
Abbondanzo wants to merge 1 commit into
Closed
Abbondanzo wants to merge 1 commit into
Abbondanzo wants to merge 1 commit into
Conversation
|
@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
Abbondanzo
force-pushed
the
export-D125868474
branch
2 times, most recently
from
October 22, 2026 16:48
0c25c1e to
f37c6d1
Compare
Visual regressionNo visual differences at android: no baseline for this environment ios: no capture |
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? |
|
This pull request has been merged in 57cc022. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Add a Robolectric test that verifies
Layout.getDesiredWidthis only called when necessary during text layout.The test confirms the optimization that avoids expensive width measurements for
EXACTLYmode and forAT_MOSTmode when boring text doesn't fit. It usesmockStaticto intercept calls toLayout.getDesiredWidthand verifies the correct number of invocations across different measure modes.Changelog: [Internal]
Reviewed By: andrewdacenko
Differential Revision: D125868474