mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 07:46:01 +00:00
Preserve scrub cancellation callbacks and initialize test snapshots
This commit is contained in:
2 files changed
+3
-1
No files matched your search
@@ -265,8 +265,8 @@ object SessionArtifacts {
|
|||||||
internal fun scrubAndMark(
|
internal fun scrubAndMark(
|
||||||
dir: File,
|
dir: File,
|
||||||
stopWhenSessionStarts: Boolean = false,
|
stopWhenSessionStarts: Boolean = false,
|
||||||
sessionStarted: () -> Boolean = { SessionState.running },
|
|
||||||
beforeReplace: (File) -> Unit = {},
|
beforeReplace: (File) -> Unit = {},
|
||||||
|
sessionStarted: () -> Boolean = { SessionState.running },
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val shouldStop = { stopWhenSessionStarts && sessionStarted() }
|
val shouldStop = { stopWhenSessionStarts && sessionStarted() }
|
||||||
val record = scrubTree(Record(dir), shouldStop, beforeReplace)
|
val record = scrubTree(Record(dir), shouldStop, beforeReplace)
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ class GameEnvironmentStoreTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test fun logPreferenceUpdatesUseThePublisherLock() {
|
@Test fun logPreferenceUpdatesUseThePublisherLock() {
|
||||||
|
GameEnvironmentStore.publish(context)
|
||||||
val entered = CountDownLatch(1)
|
val entered = CountDownLatch(1)
|
||||||
val finished = CountDownLatch(1)
|
val finished = CountDownLatch(1)
|
||||||
lateinit var thread: Thread
|
lateinit var thread: Thread
|
||||||
@@ -127,6 +128,7 @@ class GameEnvironmentStoreTest {
|
|||||||
@Test fun gameDebugLogsWaitForARetainedSessionFolder() {
|
@Test fun gameDebugLogsWaitForARetainedSessionFolder() {
|
||||||
assertNull(SessionPaths.current())
|
assertNull(SessionPaths.current())
|
||||||
assertTrue(SessionPaths.currentSessionLogsRetained(context))
|
assertTrue(SessionPaths.currentSessionLogsRetained(context))
|
||||||
|
GameEnvironmentStore.publish(context)
|
||||||
SessionPrefs.setLogsEnabled(context, false)
|
SessionPrefs.setLogsEnabled(context, false)
|
||||||
val cacheSession = SessionPaths.beginOrCurrent(context, "game-debug-logs")
|
val cacheSession = SessionPaths.beginOrCurrent(context, "game-debug-logs")
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in new issue
Block a user