Skip to content

Commit

Permalink
Bug 1826590, 1794861 - Do not reset Dispatchers.Main.
Browse files Browse the repository at this point in the history
This causes intermittent failures with IllegalStateException: Dispatchers.Main is used concurrently with setting it .
  • Loading branch information
mcarare authored and mergify[bot] committed Jun 12, 2023
1 parent 7ec517e commit 0a45cd5
Showing 1 changed file with 0 additions and 6 deletions.
Expand Up @@ -15,8 +15,6 @@ import android.content.pm.ResolveInfo
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction
import androidx.test.ext.junit.runners.AndroidJUnit4
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.test.resetMain
import mozilla.components.browser.state.action.ContentAction
import mozilla.components.browser.state.action.TabListAction
import mozilla.components.browser.state.selector.findTab
Expand Down Expand Up @@ -473,10 +471,6 @@ class DownloadsFeatureTest {

@Test
fun `showDownloadNotSupportedError shows toast`() {
// We need to create a Toast on the actual main thread (with a Looper) and therefore reset
// the main dispatcher that was set to a TestDispatcher in setUp().
Dispatchers.resetMain()

grantPermissions()

val downloadManager: DownloadManager = mock()
Expand Down

0 comments on commit 0a45cd5

Please sign in to comment.