From 2aa5f68b7b6327f0f33b06fedd6f57aafe896689 Mon Sep 17 00:00:00 2001 From: XiangRongLin <41164160+XiangRongLin@users.noreply.github.com> Date: Tue, 6 Jul 2021 16:13:16 +0200 Subject: [PATCH] Add comment explaining usage Schedulers.trampoline in detail --- .../org/schabi/newpipe/testUtil/TrampolineSchedulerRule.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/androidTest/java/org/schabi/newpipe/testUtil/TrampolineSchedulerRule.kt b/app/src/androidTest/java/org/schabi/newpipe/testUtil/TrampolineSchedulerRule.kt index 1f8ded812..8a12d2439 100644 --- a/app/src/androidTest/java/org/schabi/newpipe/testUtil/TrampolineSchedulerRule.kt +++ b/app/src/androidTest/java/org/schabi/newpipe/testUtil/TrampolineSchedulerRule.kt @@ -8,7 +8,10 @@ import org.junit.runner.Description import org.junit.runners.model.Statement /** - * Always run on [Schedulers.trampoline] + * Always run on [Schedulers.trampoline]. + * This executes the task in the current thread in FIFO manner. + * This ensures that tasks are run quickly inside the tests + * and not scheduled away to another thread for later execution */ class TrampolineSchedulerRule : TestRule {