Skip to content

Commit 41ebd25

Browse files
test(android): Update API 35 headless app start expectation
Make the ApplicationStartInfo headless test install the listener that now gates headless end-time resolution, matching the standalone path. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent be261f6 commit 41ebd25

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sentry-android-core/src/test/java/io/sentry/android/core/performance/AppStartMetricsTestApi35.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class AppStartMetricsTestApi35 {
112112
}
113113

114114
@Test
115-
fun `known ApplicationStartInfo type without listener still handles headless app start`() {
115+
fun `known ApplicationStartInfo type with listener handles headless app start`() {
116116
val mockStartInfo = mock<ApplicationStartInfo>()
117117
whenever(mockStartInfo.startupState).thenReturn(ApplicationStartInfo.STARTUP_STATE_STARTED)
118118
whenever(mockStartInfo.startType).thenReturn(ApplicationStartInfo.START_TYPE_WARM)
@@ -121,6 +121,7 @@ class AppStartMetricsTestApi35 {
121121
val metrics = AppStartMetrics.getInstance()
122122
metrics.appStartTimeSpan.setStartedAt(100)
123123
metrics.setClassLoadedUptimeMs(200)
124+
metrics.setHeadlessAppStartListener {}
124125

125126
val app = ApplicationProvider.getApplicationContext<Application>()
126127
metrics.registerLifecycleCallbacks(app)

0 commit comments

Comments
 (0)