fix(benchmark): adjust for API changes

This commit is contained in:
Harsh Shandilya 2023-06-08 07:03:28 +00:00 committed by GitHub
parent 3eeb947914
commit 6e1858a55e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,6 @@
*/ */
package dev.msfjarvis.claw.benchmark package dev.msfjarvis.claw.benchmark
import androidx.benchmark.macro.ExperimentalStableBaselineProfilesApi
import androidx.benchmark.macro.junit4.BaselineProfileRule import androidx.benchmark.macro.junit4.BaselineProfileRule
import androidx.test.platform.app.InstrumentationRegistry import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice import androidx.test.uiautomator.UiDevice
@ -14,7 +13,6 @@ import org.junit.Before
import org.junit.Rule import org.junit.Rule
import org.junit.Test import org.junit.Test
@OptIn(ExperimentalStableBaselineProfilesApi::class)
class BaselineProfileGenerator { class BaselineProfileGenerator {
@get:Rule val baselineProfileRule = BaselineProfileRule() @get:Rule val baselineProfileRule = BaselineProfileRule()
private lateinit var device: UiDevice private lateinit var device: UiDevice
@ -27,9 +25,8 @@ class BaselineProfileGenerator {
@Test @Test
fun generateBaselineProfile() = fun generateBaselineProfile() =
baselineProfileRule.collectStableBaselineProfile( baselineProfileRule.collectBaselineProfile(
packageName = PACKAGE_NAME, packageName = PACKAGE_NAME,
stableIterations = 2,
maxIterations = 8, maxIterations = 8,
) { ) {
startActivityAndWait() startActivityAndWait()