setContent

abstract fun setContent(content: @Composable () -> Unit)

Sets the composable content of the test root and settles the composition so the AWT tree reflects the initial state before returning. May be called only once per test.

This settle depends on mainClock's autoAdvance exactly as awaitIdle does: with it at its default of true this call sends whatever frames the composition needs, but with it false no frame is sent here either, so an effect gated on the first withFrameNanos - a frame-driven animation started from initial composition, for instance - stays parked until the test calls MainTestClock.advanceTimeByFrame or MainTestClock.advanceTimeBy itself.

Parameters

content

composed into root on the event dispatch thread, under this test's lifecycleState.

Throws

if called more than once per test.