Commit 38520f41 authored by MozLando's avatar MozLando
Browse files

Merge #5526



5526: Closes #5524: Intermittent failure in WebExtensionSupportTest r=Amejia481 a=csadilek

This is another example where we need our new `waitUntilIdle` as a method we're calling dispatches an action that we can't join on in the test. So, we have to wait until the store processed the action. Looked over the other tests in this class as well. This should be the only place that's needed right now.

Co-authored-by: default avatarChristian Sadilek <christian.sadilek@gmail.com>
parents 2b563f8f c9a2acb2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ dependencies {
    implementation Dependencies.kotlin_coroutines

    testImplementation project(':support-test')
    testImplementation project(':support-test-libstate')

    testImplementation Dependencies.androidx_test_core
    testImplementation Dependencies.androidx_test_junit
+3 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import mozilla.components.support.test.any
import mozilla.components.support.test.argumentCaptor
import mozilla.components.support.test.eq
import mozilla.components.support.test.ext.joinBlocking
import mozilla.components.support.test.libstate.ext.waitUntilIdle
import mozilla.components.support.test.mock
import mozilla.components.support.test.whenever
import org.junit.After
@@ -375,6 +376,8 @@ class WebExtensionSupportTest {
        verify(store, times(6)).dispatch(actionCaptor.capture())
        assertEquals(popupSessionId, (actionCaptor.value as TabListAction.SelectTabAction).tabId)

        store.waitUntilIdle()

        // Toggling again should close tab
        delegateCaptor.value.onToggleBrowserActionPopup(ext, engineSession, browserAction)
        actionCaptor = argumentCaptor()