File tree Expand file tree Collapse file tree 4 files changed +7
-9
lines changed
features/dd-sdk-android-rum/src
main/kotlin/com/datadog/android/rum/internal
test/kotlin/com/datadog/android/rum/internal Expand file tree Collapse file tree 4 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -387,6 +387,7 @@ internal class RumFeature(
387
387
*/
388
388
internal fun enableJankStatsTracking (activity : Activity ) {
389
389
try {
390
+ @Suppress(" UnsafeThirdPartyFunctionCall" )
390
391
jankStatsActivityLifecycleListener?.onActivityStarted(activity)
391
392
} catch (@Suppress(" TooGenericExceptionCaught" ) e: Exception ) {
392
393
sdkCore.internalLogger.log(
Original file line number Diff line number Diff line change @@ -646,13 +646,9 @@ internal class DatadogRumMonitor(
646
646
}
647
647
648
648
override fun enableJankStatsTracking (activity : Activity ) {
649
- val rumFeatureScope = sdkCore.getFeature(Feature .RUM_FEATURE_NAME )
649
+ sdkCore.getFeature(Feature .RUM_FEATURE_NAME )
650
650
?.unwrap<RumFeature >()
651
- if (rumFeatureScope == null ) {
652
- return
653
- }
654
-
655
- rumFeatureScope.enableJankStatsTracking(activity)
651
+ ?.enableJankStatsTracking(activity)
656
652
}
657
653
658
654
// endregion
Original file line number Diff line number Diff line change @@ -545,13 +545,14 @@ internal class RumFeatureTest {
545
545
fakeConfiguration,
546
546
lateCrashReporterFactory = { mockLateCrashReporter }
547
547
)
548
- testedFeature.jankStatsActivityLifecycleListener = mock()
548
+ val mockJankStatsActivityLifecycleListener = mock<JankStatsActivityLifecycleListener >()
549
+ testedFeature.jankStatsActivityLifecycleListener = mockJankStatsActivityLifecycleListener
549
550
550
551
// When
551
552
testedFeature.enableJankStatsTracking(activity)
552
553
553
554
// Then
554
- verify(testedFeature.jankStatsActivityLifecycleListener) !! .onActivityStarted(activity)
555
+ verify(mockJankStatsActivityLifecycleListener) .onActivityStarted(activity)
555
556
}
556
557
557
558
@Test
Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ internal class JankStatsActivityLifecycleListenerTest {
134
134
testedJankListener.onActivityStarted(mockActivity)
135
135
136
136
// Then
137
- assertThat(testedJankListener.activeActivities[mockWindow]?.size).isEqualTo (1 )
137
+ assertThat(testedJankListener.activeActivities[mockWindow]).hasSize (1 )
138
138
}
139
139
140
140
@Test
You can’t perform that action at this time.
0 commit comments