-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6235 from grzesiek2010/COLLECT-6221
Fixed displaying progress indicator while loading layers
- Loading branch information
Showing
6 changed files
with
58 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
androidshared/src/test/java/org/odk/collect/androidshared/async/TrackableWorkerTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.odk.collect.androidshared.async | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import org.hamcrest.CoreMatchers.equalTo | ||
import org.hamcrest.MatcherAssert.assertThat | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.odk.collect.testshared.FakeScheduler | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class TrackableWorkerTest { | ||
private val scheduler = FakeScheduler() | ||
private val trackableWorker = TrackableWorker(scheduler) | ||
|
||
@Test | ||
fun `TrackableWorker counts work in progress`() { | ||
trackableWorker.immediate {} | ||
trackableWorker.immediate {} | ||
|
||
scheduler.runFirstBackground() | ||
scheduler.runFirstForeground() | ||
assertThat(trackableWorker.isWorking.value, equalTo(true)) | ||
|
||
scheduler.runFirstBackground() | ||
scheduler.runFirstForeground() | ||
assertThat(trackableWorker.isWorking.value, equalTo(false)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters