Skip to content

Commit

Permalink
Catch up to androidx.benchmark API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrjr committed Apr 22, 2024
1 parent bc51102 commit 2b359b8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion benchmarks/dungeon-benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ android {
}

defaultConfig {
minSdk = 23
minSdk = 28
targetSdk = libsCatalog.version("targetSdk").toInt()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.squareup.sample.dungeon.benchmark

import android.content.Context
import androidx.benchmark.macro.ExperimentalBaselineProfilesApi
import androidx.benchmark.macro.junit4.BaselineProfileRule
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
Expand All @@ -21,7 +20,6 @@ import org.junit.runner.RunWith
* This test actually generates the profiles.
*/
@RunWith(AndroidJUnit4::class)
@OptIn(ExperimentalBaselineProfilesApi::class)
class DungeonGatherBaselineProfile {

@get:Rule val baselineProfileRule: BaselineProfileRule = BaselineProfileRule()
Expand All @@ -37,7 +35,7 @@ class DungeonGatherBaselineProfile {

@Test
fun baselineProfiles() {
baselineProfileRule.collectBaselineProfile(
baselineProfileRule.collect(
packageName = PACKAGE_NAME,
) {
pressHome()
Expand Down Expand Up @@ -67,6 +65,6 @@ class DungeonGatherBaselineProfile {
}

const val PACKAGE_NAME: String = "com.squareup.sample.dungeon"
const val UI_TIMEOUT_MS: Long = 2000L
private const val UI_TIMEOUT_MS: Long = 2000L
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ android {
}

defaultConfig {
minSdk = 26
minSdk = 28
targetSdk = libsCatalog.version("targetSdk").toInt()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.squareup.benchmarks.performance.complex.poetry.benchmark

import android.content.Context
import androidx.benchmark.macro.ExperimentalBaselineProfilesApi
import androidx.benchmark.macro.junit4.BaselineProfileRule
import androidx.test.core.app.ApplicationProvider
import androidx.test.platform.app.InstrumentationRegistry
Expand All @@ -19,7 +18,6 @@ import kotlin.time.ExperimentalTime
*
* You will need root access to a physical device to gather the baseline profile.
*/
@ExperimentalBaselineProfilesApi
class ComplexPoetryGatherBaseline {
@get:Rule val baselineProfileRule: BaselineProfileRule = BaselineProfileRule()

Expand All @@ -33,8 +31,8 @@ class ComplexPoetryGatherBaseline {
}

@Test
@OptIn(ExperimentalTime::class) fun baselineProfiles() {
baselineProfileRule.collectBaselineProfile(
fun baselineProfiles() {
baselineProfileRule.collect(
packageName = PACKAGE_NAME,
) {
pressHome()
Expand Down

0 comments on commit 2b359b8

Please sign in to comment.