mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-15 18:12:54 +00:00
[fenix] For https://github.com/mozilla-mobile/fenix/issues/24210: Remove wrapper from opened synced tab event.
This commit is contained in:
parent
b33c9f2a70
commit
40e36bb228
@ -126,8 +126,6 @@ sealed class Event {
|
|||||||
|
|
||||||
object TabSettingsOpened : Event()
|
object TabSettingsOpened : Event()
|
||||||
|
|
||||||
object SyncedTabOpened : Event()
|
|
||||||
|
|
||||||
object HaveOpenTabs : Event()
|
object HaveOpenTabs : Event()
|
||||||
object HaveNoOpenTabs : Event()
|
object HaveNoOpenTabs : Event()
|
||||||
|
|
||||||
|
@ -368,10 +368,6 @@ private val Event.wrapper: EventWrapper<*>?
|
|||||||
{ ProgressiveWebApp.installTap.record(it) }
|
{ ProgressiveWebApp.installTap.record(it) }
|
||||||
)
|
)
|
||||||
|
|
||||||
is Event.SyncedTabOpened -> EventWrapper<NoExtraKeys>(
|
|
||||||
{ Events.syncedTabOpened.record(it) }
|
|
||||||
)
|
|
||||||
|
|
||||||
is Event.TabSettingsOpened -> EventWrapper<NoExtraKeys>(
|
is Event.TabSettingsOpened -> EventWrapper<NoExtraKeys>(
|
||||||
{ Tabs.settingOpened.record(it) }
|
{ Tabs.settingOpened.record(it) }
|
||||||
)
|
)
|
||||||
|
@ -25,7 +25,6 @@ import org.mozilla.fenix.collections.CollectionsDialog
|
|||||||
import org.mozilla.fenix.collections.show
|
import org.mozilla.fenix.collections.show
|
||||||
import org.mozilla.fenix.components.TabCollectionStorage
|
import org.mozilla.fenix.components.TabCollectionStorage
|
||||||
import org.mozilla.fenix.components.bookmarks.BookmarksUseCase
|
import org.mozilla.fenix.components.bookmarks.BookmarksUseCase
|
||||||
import org.mozilla.fenix.components.metrics.Event
|
|
||||||
import org.mozilla.fenix.components.metrics.MetricController
|
import org.mozilla.fenix.components.metrics.MetricController
|
||||||
import org.mozilla.fenix.home.HomeFragment
|
import org.mozilla.fenix.home.HomeFragment
|
||||||
import org.mozilla.fenix.tabstray.ext.getTabSessionState
|
import org.mozilla.fenix.tabstray.ext.getTabSessionState
|
||||||
@ -250,7 +249,7 @@ class DefaultNavigationInteractor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onSyncedTabClicked(tab: SyncTab) {
|
override fun onSyncedTabClicked(tab: SyncTab) {
|
||||||
metrics.track(Event.SyncedTabOpened)
|
Events.syncedTabOpened.record(NoExtras())
|
||||||
|
|
||||||
dismissTabTray()
|
dismissTabTray()
|
||||||
activity.openToBrowserAndLoad(
|
activity.openToBrowserAndLoad(
|
||||||
|
@ -14,7 +14,6 @@ import io.mockk.mockkStatic
|
|||||||
import io.mockk.spyk
|
import io.mockk.spyk
|
||||||
import io.mockk.unmockkStatic
|
import io.mockk.unmockkStatic
|
||||||
import io.mockk.verify
|
import io.mockk.verify
|
||||||
import io.mockk.verifyOrder
|
|
||||||
import kotlinx.coroutines.test.runBlockingTest
|
import kotlinx.coroutines.test.runBlockingTest
|
||||||
import mozilla.components.browser.state.selector.findTab
|
import mozilla.components.browser.state.selector.findTab
|
||||||
import mozilla.components.browser.state.selector.getNormalOrPrivateTabs
|
import mozilla.components.browser.state.selector.getNormalOrPrivateTabs
|
||||||
@ -43,7 +42,6 @@ import org.mozilla.fenix.collections.CollectionsDialog
|
|||||||
import org.mozilla.fenix.collections.show
|
import org.mozilla.fenix.collections.show
|
||||||
import org.mozilla.fenix.components.TabCollectionStorage
|
import org.mozilla.fenix.components.TabCollectionStorage
|
||||||
import org.mozilla.fenix.components.bookmarks.BookmarksUseCase
|
import org.mozilla.fenix.components.bookmarks.BookmarksUseCase
|
||||||
import org.mozilla.fenix.components.metrics.Event
|
|
||||||
import org.mozilla.fenix.components.metrics.MetricController
|
import org.mozilla.fenix.components.metrics.MetricController
|
||||||
import org.mozilla.fenix.helpers.FenixRobolectricTestRunner
|
import org.mozilla.fenix.helpers.FenixRobolectricTestRunner
|
||||||
import mozilla.components.browser.state.state.createTab as createStateTab
|
import mozilla.components.browser.state.state.createTab as createStateTab
|
||||||
@ -228,6 +226,7 @@ class NavigationInteractorTest {
|
|||||||
fun `onSyncedTabsClicked sets metrics and opens browser`() {
|
fun `onSyncedTabsClicked sets metrics and opens browser`() {
|
||||||
val tab = mockk<SyncTab>()
|
val tab = mockk<SyncTab>()
|
||||||
val entry = mockk<TabEntry>()
|
val entry = mockk<TabEntry>()
|
||||||
|
assertFalse(Events.syncedTabOpened.testHasValue())
|
||||||
|
|
||||||
every { tab.active() }.answers { entry }
|
every { tab.active() }.answers { entry }
|
||||||
every { entry.url }.answers { "https://mozilla.org" }
|
every { entry.url }.answers { "https://mozilla.org" }
|
||||||
@ -240,9 +239,9 @@ class NavigationInteractorTest {
|
|||||||
).onSyncedTabClicked(tab)
|
).onSyncedTabClicked(tab)
|
||||||
|
|
||||||
assertTrue(dismissTabTrayInvoked)
|
assertTrue(dismissTabTrayInvoked)
|
||||||
verifyOrder {
|
assertTrue(Events.syncedTabOpened.testHasValue())
|
||||||
metrics.track(Event.SyncedTabOpened)
|
|
||||||
|
|
||||||
|
verify {
|
||||||
activity.openToBrowserAndLoad(
|
activity.openToBrowserAndLoad(
|
||||||
searchTermOrURL = "https://mozilla.org",
|
searchTermOrURL = "https://mozilla.org",
|
||||||
newTab = true,
|
newTab = true,
|
||||||
|
Loading…
Reference in New Issue
Block a user