commit | 718dc301684d588a9e8b7b1082f20b4c96949d2a | [log] [tgz] |
---|---|---|
author | Treehugger Robot <[email protected]> | Mon Apr 11 22:06:52 2022 +0000 |
committer | Automerger Merge Worker <[email protected]> | Mon Apr 11 22:06:52 2022 +0000 |
tree | 15132df5f583841ed1d5616f000b4b896260e262 | |
parent | 22be8b474e8a9401611d901eff3ae5557fcfb2ba [diff] | |
parent | 811bf69245383a400b64f9f69c7c3836bef09a91 [diff] |
Merge "Test for onPlaced on InnerPlaceable" into androidx-main am: 811bf69245 Original change: https://android-review.googlesource.com/c/platform/frameworks/support/+/2055135 Change-Id: Ie997329638718df8895f760701001c1b073d9651 Signed-off-by: Automerger Merge Worker <[email protected]>
diff --git a/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/LayoutCoordinatesHelperTest.kt b/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/LayoutCoordinatesHelperTest.kt index 45010ba..de12ba2 100644 --- a/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/LayoutCoordinatesHelperTest.kt +++ b/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/LayoutCoordinatesHelperTest.kt
@@ -232,6 +232,17 @@ } } + @Test + fun onBoxPlaced_failing() { + var coordinates: LayoutCoordinates? = null + rule.setContent { + Box(Modifier.onPlaced { coordinates = it }) + } + rule.runOnIdle { + assertThat(coordinates).isNotNull() + } + } + private fun LayoutCoordinates.placementInParent() = parentCoordinates!!.localPositionOf(this, Offset.Zero).round() }