Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created June 27, 2022 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skydoves/c450fec8148c3dd9f72c1c74e72c34fc to your computer and use it in GitHub Desktop.
Save skydoves/c450fec8148c3dd9f72c1c74e72c34fc to your computer and use it in GitHub Desktop.
baseline_proflies
class BaselineProfileGenerator {
@get:Rule val baselineProfileRule = BaselineProfileRule()
@Test
fun startup() =
baselineProfileRule.collectBaselineProfile(
packageName = "com.google.samples.apps.nowinandroid"
) {
pressHome()
// 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
// through your most important UI.
startActivityAndWait()
device.waitForIdle()
device.run {
findObject(By.text("Interests"))
.click()
waitForIdle()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment