Destroy RecentsDependencies in tests that initialise it.

This prevents unaccounted for destructions which can lead to a leak in tests after these.

Bug: 395214062
Flag: com.android.launcher3.enable_refactor_task_thumbnail
Test: TaplStartLauncherViaGestureTests.testStressPressHome
Change-Id: I5cf9214ea9344f7e9d79b61e87269fd6e2c05753
This commit is contained in:
Uwais Ashraf
2025-02-12 08:46:39 +00:00
parent 743786b66c
commit d7007ef6e8
2 changed files with 12 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ import com.android.systemui.shared.recents.model.Task.TaskKey
import com.google.common.truth.Truth.assertThat
import dagger.BindsInstance
import dagger.Component
import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -78,6 +79,11 @@ class TaskViewItemInfoTest {
RecentsDependencies.initialize(context)
}
@After
fun tearDown() {
RecentsDependencies.destroy()
}
@Test
fun singleTask() {
val taskContainers = listOf(createTaskContainer(createTask(1)))