|
|
@ -16,7 +16,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
package com.google.samples.apps.nowinandroid.baselineprofile
|
|
|
|
package com.google.samples.apps.nowinandroid.baselineprofile
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.benchmark.macro.ExperimentalBaselineProfilesApi
|
|
|
|
|
|
|
|
import androidx.benchmark.macro.junit4.BaselineProfileRule
|
|
|
|
import androidx.benchmark.macro.junit4.BaselineProfileRule
|
|
|
|
import com.google.samples.apps.nowinandroid.PACKAGE_NAME
|
|
|
|
import com.google.samples.apps.nowinandroid.PACKAGE_NAME
|
|
|
|
import com.google.samples.apps.nowinandroid.bookmarks.goToBookmarksScreen
|
|
|
|
import com.google.samples.apps.nowinandroid.bookmarks.goToBookmarksScreen
|
|
|
@ -31,13 +30,12 @@ import org.junit.Test
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Generates a baseline profile which can be copied to `app/src/main/baseline-prof.txt`.
|
|
|
|
* Generates a baseline profile which can be copied to `app/src/main/baseline-prof.txt`.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ExperimentalBaselineProfilesApi
|
|
|
|
|
|
|
|
class BaselineProfileGenerator {
|
|
|
|
class BaselineProfileGenerator {
|
|
|
|
@get:Rule val baselineProfileRule = BaselineProfileRule()
|
|
|
|
@get:Rule val baselineProfileRule = BaselineProfileRule()
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
fun generate() =
|
|
|
|
fun generate() =
|
|
|
|
baselineProfileRule.collectBaselineProfile(PACKAGE_NAME) {
|
|
|
|
baselineProfileRule.collect(PACKAGE_NAME) {
|
|
|
|
// This block defines the app's critical user journey. Here we are interested in
|
|
|
|
// This block defines the app's critical user journey. Here we are interested in
|
|
|
|
// optimizing for app startup. But you can also navigate and scroll
|
|
|
|
// optimizing for app startup. But you can also navigate and scroll
|
|
|
|
// through your most important UI.
|
|
|
|
// through your most important UI.
|
|
|
|