Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch up to androidx.benchmark API changes #1203

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading