Merge "Fix testDensityChangeInvalidatesDrawWithCache" into androidx-main
diff --git a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/draw/DrawModifierTest.kt b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/draw/DrawModifierTest.kt
index f58c9ee..7aa5b1a 100644
--- a/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/draw/DrawModifierTest.kt
+++ b/compose/ui/ui/src/androidInstrumentedTest/kotlin/androidx/compose/ui/draw/DrawModifierTest.kt
@@ -292,8 +292,10 @@
                             modifier =
                                 Modifier.drawWithCache {
                                     resolvedDensity = Density(density, fontScale)
-                                    drawLatch.countDown()
-                                    onDrawBehind { drawDensity = Density(density, fontScale) }
+                                    onDrawBehind {
+                                        drawDensity = Density(density, fontScale)
+                                        drawLatch.countDown()
+                                    }
                                 },
                             text = "Change Layout Direction"
                         )