mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 15:17:05 +05:30
benchmark: tap navigation destinations in baseline profile benchmark
This commit is contained in:
parent
8ee2929724
commit
bdb287d42a
1 changed files with 11 additions and 4 deletions
|
@ -6,12 +6,22 @@ import androidx.benchmark.macro.StartupMode
|
||||||
import androidx.benchmark.macro.StartupTimingMetric
|
import androidx.benchmark.macro.StartupTimingMetric
|
||||||
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
|
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
|
||||||
import androidx.test.filters.LargeTest
|
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.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
@LargeTest
|
@LargeTest
|
||||||
class BaselineProfileBenchmark {
|
class BaselineProfileBenchmark {
|
||||||
@get:Rule val benchmarkRule = MacrobenchmarkRule()
|
@get:Rule val benchmarkRule = MacrobenchmarkRule()
|
||||||
|
private lateinit var device: UiDevice
|
||||||
|
|
||||||
|
@Before
|
||||||
|
fun setUp() {
|
||||||
|
val instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||||
|
device = UiDevice.getInstance(instrumentation)
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun startupNoCompilation() {
|
fun startupNoCompilation() {
|
||||||
|
@ -30,9 +40,6 @@ class BaselineProfileBenchmark {
|
||||||
iterations = 10,
|
iterations = 10,
|
||||||
startupMode = StartupMode.COLD,
|
startupMode = StartupMode.COLD,
|
||||||
compilationMode = compilationMode
|
compilationMode = compilationMode
|
||||||
) {
|
) { tapNavigationDestinations(device) }
|
||||||
pressHome()
|
|
||||||
startActivityAndWait()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue