|
|
@ -15,6 +15,7 @@ import org.junit.Test
|
|
|
|
import org.mozilla.fenix.ext.components
|
|
|
|
import org.mozilla.fenix.ext.components
|
|
|
|
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
|
|
|
import org.mozilla.fenix.helpers.AndroidAssetDispatcher
|
|
|
|
import org.mozilla.fenix.helpers.HomeActivityTestRule
|
|
|
|
import org.mozilla.fenix.helpers.HomeActivityTestRule
|
|
|
|
|
|
|
|
import org.mozilla.fenix.helpers.RetryTestRule
|
|
|
|
import org.mozilla.fenix.helpers.TestAssetHelper
|
|
|
|
import org.mozilla.fenix.helpers.TestAssetHelper
|
|
|
|
import org.mozilla.fenix.ui.robots.browserScreen
|
|
|
|
import org.mozilla.fenix.ui.robots.browserScreen
|
|
|
|
import org.mozilla.fenix.ui.robots.homeScreen
|
|
|
|
import org.mozilla.fenix.ui.robots.homeScreen
|
|
|
@ -37,6 +38,10 @@ class MediaNotificationTest {
|
|
|
|
val activityTestRule = HomeActivityTestRule()
|
|
|
|
val activityTestRule = HomeActivityTestRule()
|
|
|
|
private lateinit var browserStore: BrowserStore
|
|
|
|
private lateinit var browserStore: BrowserStore
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Rule
|
|
|
|
|
|
|
|
@JvmField
|
|
|
|
|
|
|
|
val retryTestRule = RetryTestRule(3)
|
|
|
|
|
|
|
|
|
|
|
|
@Before
|
|
|
|
@Before
|
|
|
|
fun setUp() {
|
|
|
|
fun setUp() {
|
|
|
|
// Initializing this as part of class construction, below the rule would throw a NPE
|
|
|
|
// Initializing this as part of class construction, below the rule would throw a NPE
|
|
|
@ -88,15 +93,15 @@ class MediaNotificationTest {
|
|
|
|
mDevice.pressBack()
|
|
|
|
mDevice.pressBack()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Ignore("Failing, see: https://github.com/mozilla-mobile/fenix/issues/23716")
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
fun mediaSystemNotificationInPrivateModeTest() {
|
|
|
|
fun mediaSystemNotificationInPrivateModeTest() {
|
|
|
|
val audioTestPage = TestAssetHelper.getAudioPageAsset(mockWebServer)
|
|
|
|
val audioTestPage = TestAssetHelper.getAudioPageAsset(mockWebServer)
|
|
|
|
|
|
|
|
|
|
|
|
homeScreen { }.togglePrivateBrowsingMode()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
navigationToolbar {
|
|
|
|
navigationToolbar {
|
|
|
|
}.enterURLAndEnterToBrowser(audioTestPage.url) {
|
|
|
|
}.openTabTray {
|
|
|
|
|
|
|
|
}.toggleToPrivateTabs {
|
|
|
|
|
|
|
|
}.openNewTab {
|
|
|
|
|
|
|
|
}.submitQuery(audioTestPage.url.toString()) {
|
|
|
|
mDevice.waitForIdle()
|
|
|
|
mDevice.waitForIdle()
|
|
|
|
clickMediaPlayerPlayButton()
|
|
|
|
clickMediaPlayerPlayButton()
|
|
|
|
assertPlaybackState(browserStore, MediaSession.PlaybackState.PLAYING)
|
|
|
|
assertPlaybackState(browserStore, MediaSession.PlaybackState.PLAYING)
|
|
|
|