2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-15 18:12:54 +00:00
With the Fennec -> Fenix migration complete there is no other Mozilla
application that would serve as a custom account provider hence the automatic
signin would not be possible.
Make this more obvious by commenting out the code that would trigger an
onboarding banner for it but keep the code in the app for when https://github.com/mozilla-mobile/fenix/issues/15694 would add
to Fenix the ability to serve as a custom account provider.
This commit is contained in:
Mugurell 2020-11-04 17:23:19 +02:00 committed by GitHub
parent 0a8d8cfbf0
commit f3d5862668
2 changed files with 17 additions and 19 deletions

View File

@ -59,12 +59,10 @@ class CurrentMode(
if (account != null) { if (account != null) {
Mode.Onboarding(OnboardingState.SignedIn) Mode.Onboarding(OnboardingState.SignedIn)
} else { } else {
val availableAccounts = accountManager.shareableAccounts(context) Mode.Onboarding(OnboardingState.SignedOutNoAutoSignIn)
if (availableAccounts.isEmpty()) { // The following other state is effectively disabled - #6521
Mode.Onboarding(OnboardingState.SignedOutNoAutoSignIn) // Code still exists in app for when it will be used again - #15694
} else { // Mode.Onboarding(OnboardingState.SignedOutCanAutoSignIn(accountManager.shareableAccounts(context)[0]))
Mode.Onboarding(OnboardingState.SignedOutCanAutoSignIn(availableAccounts[0]))
}
} }
} }

View File

@ -10,7 +10,6 @@ import io.mockk.mockk
import io.mockk.spyk import io.mockk.spyk
import io.mockk.verify import io.mockk.verify
import mozilla.components.service.fxa.manager.FxaAccountManager import mozilla.components.service.fxa.manager.FxaAccountManager
import mozilla.components.service.fxa.sharing.ShareableAccount
import org.junit.Assert.assertEquals import org.junit.Assert.assertEquals
import org.junit.Before import org.junit.Before
import org.junit.Test import org.junit.Test
@ -79,18 +78,19 @@ class ModeTest {
assertEquals(Mode.Onboarding(OnboardingState.SignedOutNoAutoSignIn), currentMode.getCurrentMode()) assertEquals(Mode.Onboarding(OnboardingState.SignedOutNoAutoSignIn), currentMode.getCurrentMode())
} }
@Test // Temporarily disabled. See #6521
fun `get current onboarding mode when can auto sign in`() { // @Test
val shareableAccount: ShareableAccount = mockk() // fun `get current onboarding mode when can auto sign in`() {
every { onboarding.userHasBeenOnboarded() } returns false // val shareableAccount: ShareableAccount = mockk()
every { accountManager.authenticatedAccount() } returns null // every { onboarding.userHasBeenOnboarded() } returns false
every { accountManager.shareableAccounts(context) } returns listOf(shareableAccount) // every { accountManager.authenticatedAccount() } returns null
// every { accountManager.shareableAccounts(context) } returns listOf(shareableAccount)
assertEquals( //
Mode.Onboarding(OnboardingState.SignedOutCanAutoSignIn(shareableAccount)), // assertEquals(
currentMode.getCurrentMode() // Mode.Onboarding(OnboardingState.SignedOutCanAutoSignIn(shareableAccount)),
) // currentMode.getCurrentMode()
} // )
// }
@Test @Test
fun `emit mode change`() { fun `emit mode change`() {