mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
fix(gpu): skip system Vulkan pruning when the runtime pack is absent (#2316)
fix: skip pruning system Vulkan runtimes when the runtime pack is not installed
This commit is contained in:
1 parent
bf95a40e3e
commit
92a7124589
2 files changed
+27
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package com.droiddeck.launcher.gpu
|
||||
|
||||
import android.content.Context
|
||||
import java.io.File
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [28], manifest = Config.NONE)
|
||||
class SystemVulkanPruneAbsentRuntimeTest {
|
||||
@Test fun pruningWithoutTheRuntimeDoesNotThrowAndLeavesFilesAlone() {
|
||||
val context: Context = RuntimeEnvironment.getApplication()
|
||||
val base = File(context.filesDir, "system_vulkan").apply { mkdirs() }
|
||||
val stage = File(base, ".stage-" + java.util.UUID.randomUUID()).apply { mkdir() }
|
||||
val version = File(base, "a".repeat(64)).apply { mkdir() }
|
||||
|
||||
SystemVulkanDriver.pruneUnused(context, true)
|
||||
|
||||
assertTrue(stage.exists())
|
||||
assertTrue(version.exists())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user