2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00
* For https://github.com/mozilla-mobile/fenix/issues/20195 - Adds tabsTray allowScreenshotsInPrivateMode check
This commit is contained in:
Codrut Topliceanu 2021-06-30 18:37:16 +03:00 committed by GitHub
parent 1880077575
commit b1d830e323
2 changed files with 19 additions and 1 deletions

View File

@ -33,7 +33,8 @@ class SecureTabsTrayBinding(
)
}
.collect { state ->
if (state.selectedPage == Page.PrivateTabs) {
if (state.selectedPage == Page.PrivateTabs &&
!settings.allowScreenshotsInPrivateMode) {
fragment.secure()
} else if (!settings.lastKnownMode.isPrivate) {
fragment.removeSecure()

View File

@ -56,6 +56,23 @@ class SecureTabsTrayBindingTest {
verify { fragment.secure() }
}
@Test
fun `WHEN tab selected page switches to private and allowScreenshotsInPrivateMode true THEN set fragment to un-secure`() {
val tabsTrayStore = TabsTrayStore(TabsTrayState())
val secureTabsTrayBinding = SecureTabsTrayBinding(
store = tabsTrayStore,
settings = settings,
fragment = fragment
)
every { settings.allowScreenshotsInPrivateMode } returns true
secureTabsTrayBinding.start()
tabsTrayStore.dispatch(TabsTrayAction.PageSelected(Page.positionToPage(Page.PrivateTabs.ordinal)))
tabsTrayStore.waitUntilIdle()
verify { fragment.removeSecure() }
}
@Test
fun `GIVEN not in private mode WHEN tab selected page switches to normal tabs from private THEN set fragment to un-secure`() {
every { settings.lastKnownMode.isPrivate } returns false