[TextField] Allow 1px tolerance in large label focus animation test
`testTextField_heightDoesNotChange_duringFocusAnimation_withLargeLabelText` verifies that the TextField height remains constant across all ticks of the focus animation when configured with a large label font. During the animation, font metrics and line heights are dynamically interpolated between `displayLarge` and `bodySmall`. On low-density devices (density < 2.0, such as 1.75), sub-pixel layout calculations can round the overall height by 1 physical pixel (e.g. from 174px down to 173px). Because `assertIsEqualTo` defaults to a `0.5.dp` tolerance, and on a 1.75 density screen 1px equals ~0.5714dp (> 0.5dp), the 1-pixel rounding variation exceeds the default threshold and causes the assertion to fail. This change updates the test to accommodate the 1-pixel rounding differences across all display densities. Fix: 552669441 Test: PROJECT_PREFIX=:compose:material3: ./gradlew :compose:material3:material3:connectedAndroidDeviceTest -Pandroid.testInstrumentationRunnerArguments.class=androidx.compose.material3.TextFieldTest#testTextField_heightDoesNotChange_duringFocusAnimation_withLargeLabelText Change-Id: Id425d72fe288ff5b2aa9f305d1318718b7b9c246
D
Darrell Shi committed
a991e487388cf79844951de76b8c61e5e7ce732c
Parent: a7dd9cd