diff --git a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileBenchmark.kt b/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileBenchmark.kt index fddd7f7e..b4cc4b10 100644 --- a/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileBenchmark.kt +++ b/benchmark/src/main/kotlin/dev/msfjarvis/claw/benchmark/BaselineProfileBenchmark.kt @@ -6,12 +6,22 @@ import androidx.benchmark.macro.StartupMode import androidx.benchmark.macro.StartupTimingMetric import androidx.benchmark.macro.junit4.MacrobenchmarkRule import androidx.test.filters.LargeTest +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.uiautomator.UiDevice +import org.junit.Before import org.junit.Rule import org.junit.Test @LargeTest class BaselineProfileBenchmark { @get:Rule val benchmarkRule = MacrobenchmarkRule() + private lateinit var device: UiDevice + + @Before + fun setUp() { + val instrumentation = InstrumentationRegistry.getInstrumentation() + device = UiDevice.getInstance(instrumentation) + } @Test fun startupNoCompilation() { @@ -30,9 +40,6 @@ class BaselineProfileBenchmark { iterations = 10, startupMode = StartupMode.COLD, compilationMode = compilationMode - ) { - pressHome() - startActivityAndWait() - } + ) { tapNavigationDestinations(device) } } }