Skip to content

Commit

Permalink
change reset logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniokrait committed Sep 30, 2023
1 parent 69d3235 commit fcfd005
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ import com.airbnb.lottie.LottieTask
import org.junit.rules.TestWatcher
import org.junit.runner.Description
import java.util.concurrent.Executor
import java.util.concurrent.Executors

class LottieTestRule : TestWatcher() {
private lateinit var evacuatedExecutor: Executor

override fun starting(description: Description) {
evacuatedExecutor = LottieTask.EXECUTOR
LottieTask.EXECUTOR = Executor(Runnable::run)
}

override fun finished(description: Description) {
LottieTask.EXECUTOR = evacuatedExecutor
LottieTask.EXECUTOR = Executors.newCachedThreadPool()
}
}

0 comments on commit fcfd005

Please sign in to comment.