File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
benchmark/src/main/kotlin/com/github/skydoves/benchmark Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 16
16
17
17
package com.github.skydoves.benchmark
18
18
19
- import androidx.benchmark.macro.ExperimentalStableBaselineProfilesApi
19
+ import android.os.Build
20
+ import androidx.annotation.RequiresApi
20
21
import androidx.benchmark.macro.junit4.BaselineProfileRule
21
22
import androidx.test.uiautomator.By
22
23
import androidx.test.uiautomator.BySelector
@@ -30,14 +31,14 @@ import org.junit.Test
30
31
/* *
31
32
* Generates a baseline profile which can be copied to `app/src/main/baseline-prof.txt`.
32
33
*/
34
+ @RequiresApi(Build .VERSION_CODES .P )
33
35
class BaselineProfileGenerator {
34
36
@get:Rule
35
37
val baselineProfileRule = BaselineProfileRule ()
36
38
37
39
@Test
38
- @OptIn(ExperimentalStableBaselineProfilesApi ::class )
39
40
fun startup () =
40
- baselineProfileRule.collectStableBaselineProfile (
41
+ baselineProfileRule.collect (
41
42
packageName = packageName,
42
43
stableIterations = 2 ,
43
44
maxIterations = 8
@@ -50,7 +51,7 @@ class BaselineProfileGenerator {
50
51
device.waitForIdle()
51
52
52
53
// Navigate to the details screen
53
- device.testDiscover() || return @collectStableBaselineProfile
54
+ device.testDiscover() || return @collect
54
55
device.navigateFromMainToDetails()
55
56
device.pressBack()
56
57
}
You can’t perform that action at this time.
0 commit comments