Skip to content

A fully functional Android app built entirely with Kotlin and Jetpack Compose

Wait for full display in startup benchmarks

Tomáš Mlynarič5d3f3759b1cb
diff --git a/benchmark/src/main/java/com/google/samples/apps/nowinandroid/startup/StartupBenchmark.kt b/benchmark/src/main/java/com/google/samples/apps/nowinandroid/startup/StartupBenchmark.kt
index b33acacc7..777b8d80e 100644
--- a/benchmark/src/main/java/com/google/samples/apps/nowinandroid/startup/StartupBenchmark.kt
+++ b/benchmark/src/main/java/com/google/samples/apps/nowinandroid/startup/StartupBenchmark.kt
@@ -27,6 +27,7 @@ import androidx.benchmark.macro.StartupTimingMetric
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
import com.google.samples.apps.nowinandroid.PACKAGE_NAME
+import com.google.samples.apps.nowinandroid.foryou.forYouWaitForContent
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -85,5 +86,7 @@ abstract class AbstractStartupBenchmark(private val startupMode: StartupMode) {
}
) {
startActivityAndWait()
+ // Waits until the content is ready to capture Time To Full Display
+ forYouWaitForContent()
}
}