You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/BitmapCachesManager.kt
+8-4
Original file line number
Diff line number
Diff line change
@@ -51,15 +51,19 @@ internal class BitmapCachesManager(
Copy file name to clipboardexpand all lines: features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/BitmapPool.kt
+2-2
Original file line number
Diff line number
Diff line change
@@ -91,8 +91,8 @@ internal class BitmapPool(
91
91
}
92
92
93
93
@Synchronized
94
-
overridefunget(element:String): Bitmap? {
95
-
val bitmapsWithReqDimensions = bitmapsBySize[element] ?:returnnull
94
+
overridefunget(key:String): Bitmap? {
95
+
val bitmapsWithReqDimensions = bitmapsBySize[key] ?:returnnull
96
96
97
97
// find the first unused bitmap, mark it as used and return it
Copy file name to clipboardexpand all lines: features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/Cache.kt
Copy file name to clipboardexpand all lines: features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/ResourceResolver.kt
+6-2
Original file line number
Diff line number
Diff line change
@@ -233,7 +233,8 @@ internal class ResourceResolver(
Copy file name to clipboardexpand all lines: features/dd-sdk-android-session-replay/src/main/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/ResourcesLRUCache.kt
Copy file name to clipboardexpand all lines: features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/BitmapCachesManagerTest.kt
Copy file name to clipboardexpand all lines: features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/ResourceResolverTest.kt
Copy file name to clipboardexpand all lines: features/dd-sdk-android-session-replay/src/test/kotlin/com/datadog/android/sessionreplay/internal/recorder/resources/ResourcesLRUCacheTest.kt
+12-24
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,9 @@ internal class ResourcesLRUCacheTest {
47
47
@Mock
48
48
lateinitvar mockInvocationUtils:InvocationUtils
49
49
50
+
@StringForgery
51
+
lateinitvar fakeResourceKey:String
52
+
50
53
val argumentCaptor = argumentCaptor<String>()
51
54
52
55
@BeforeEach
@@ -61,7 +64,7 @@ internal class ResourcesLRUCacheTest {
61
64
@Test
62
65
fun`M return null W get() { item not in cache }`() {
63
66
// When
64
-
val cacheItem = testedCache.get(mockDrawable)
67
+
val cacheItem = testedCache.get(fakeResourceKey)
65
68
66
69
// Then
67
70
assertThat(cacheItem).isNull()
@@ -73,57 +76,47 @@ internal class ResourcesLRUCacheTest {
73
76
) {
74
77
// Given
75
78
val fakeResourceIdByteArray = fakeResourceId.toByteArray(Charsets.UTF_8)
0 commit comments