mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-19 09:25:34 +00:00
[fenix] For https://github.com/mozilla-mobile/fenix/issues/20195 - Adds tabsTray allowScreenshotsInPrivateMode check (https://github.com/mozilla-mobile/fenix/pull/20203)
* For https://github.com/mozilla-mobile/fenix/issues/20195 - Adds tabsTray allowScreenshotsInPrivateMode check
This commit is contained in:
parent
1880077575
commit
b1d830e323
@ -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()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user