Skip to content

Commit 1d447ab

Browse files
authored
Merge pull request #1203 from square/ray/benchmark-api-catchup
Catch up to androidx.benchmark API changes
2 parents cb05327 + 878232a commit 1d447ab

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

benchmarks/dungeon-benchmark/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ android {
2525
}
2626

2727
defaultConfig {
28-
minSdk = 23
28+
minSdk = 28
2929
targetSdk = libsCatalog.version("targetSdk").toInt()
3030

3131
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

benchmarks/dungeon-benchmark/src/main/java/com/squareup/sample/dungeon/benchmark/DungeonGatherBaselineProfile.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.squareup.sample.dungeon.benchmark
22

33
import android.content.Context
4-
import androidx.benchmark.macro.ExperimentalBaselineProfilesApi
54
import androidx.benchmark.macro.junit4.BaselineProfileRule
65
import androidx.test.core.app.ApplicationProvider
76
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -21,7 +20,6 @@ import org.junit.runner.RunWith
2120
* This test actually generates the profiles.
2221
*/
2322
@RunWith(AndroidJUnit4::class)
24-
@OptIn(ExperimentalBaselineProfilesApi::class)
2523
class DungeonGatherBaselineProfile {
2624

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

3836
@Test
3937
fun baselineProfiles() {
40-
baselineProfileRule.collectBaselineProfile(
38+
baselineProfileRule.collect(
4139
packageName = PACKAGE_NAME,
4240
) {
4341
pressHome()
@@ -67,6 +65,6 @@ class DungeonGatherBaselineProfile {
6765
}
6866

6967
const val PACKAGE_NAME: String = "com.squareup.sample.dungeon"
70-
const val UI_TIMEOUT_MS: Long = 2000L
68+
private const val UI_TIMEOUT_MS: Long = 2000L
7169
}
7270
}

benchmarks/performance-poetry/complex-benchmark/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ android {
2525
}
2626

2727
defaultConfig {
28-
minSdk = 26
28+
minSdk = 28
2929
targetSdk = libsCatalog.version("targetSdk").toInt()
3030

3131
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

benchmarks/performance-poetry/complex-benchmark/src/main/java/com/squareup/benchmarks/performance/complex/poetry/benchmark/ComplexPoetryGatherBaseline.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.squareup.benchmarks.performance.complex.poetry.benchmark
22

33
import android.content.Context
4-
import androidx.benchmark.macro.ExperimentalBaselineProfilesApi
54
import androidx.benchmark.macro.junit4.BaselineProfileRule
65
import androidx.test.core.app.ApplicationProvider
76
import androidx.test.platform.app.InstrumentationRegistry
@@ -19,7 +18,6 @@ import kotlin.time.ExperimentalTime
1918
*
2019
* You will need root access to a physical device to gather the baseline profile.
2120
*/
22-
@ExperimentalBaselineProfilesApi
2321
class ComplexPoetryGatherBaseline {
2422
@get:Rule val baselineProfileRule: BaselineProfileRule = BaselineProfileRule()
2523

@@ -33,8 +31,8 @@ class ComplexPoetryGatherBaseline {
3331
}
3432

3533
@Test
36-
@OptIn(ExperimentalTime::class) fun baselineProfiles() {
37-
baselineProfileRule.collectBaselineProfile(
34+
fun baselineProfiles() {
35+
baselineProfileRule.collect(
3836
packageName = PACKAGE_NAME,
3937
) {
4038
pressHome()

0 commit comments

Comments
 (0)