From 7ca7190199a9b5ce980b73f4cf3a3c15ac65f3d0 Mon Sep 17 00:00:00 2001 From: Grigory Kruglov Date: Tue, 8 Mar 2022 16:47:20 -0800 Subject: [PATCH] Bump Android-Components version to 100.0.20220309001717 --- .../fenix/components/AccountAbnormalities.kt | 1 - .../fenix/components/AccountAbnormalitiesTest.kt | 16 ++++++---------- buildSrc/src/main/java/AndroidComponents.kt | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/components/AccountAbnormalities.kt b/app/src/main/java/org/mozilla/fenix/components/AccountAbnormalities.kt index 6cacc0b1a1..e1c83fb58b 100644 --- a/app/src/main/java/org/mozilla/fenix/components/AccountAbnormalities.kt +++ b/app/src/main/java/org/mozilla/fenix/components/AccountAbnormalities.kt @@ -14,7 +14,6 @@ import mozilla.components.concept.sync.AccountObserver import mozilla.components.concept.sync.AuthType import mozilla.components.concept.sync.OAuthAccount import mozilla.components.lib.crash.CrashReporter -import mozilla.components.service.fxa.manager.FxaAccountManager import mozilla.components.support.base.log.logger.Logger import org.mozilla.fenix.perf.StrictModeManager import kotlin.coroutines.CoroutineContext diff --git a/app/src/test/java/org/mozilla/fenix/components/AccountAbnormalitiesTest.kt b/app/src/test/java/org/mozilla/fenix/components/AccountAbnormalitiesTest.kt index 444bc7f736..fd4cf9223e 100644 --- a/app/src/test/java/org/mozilla/fenix/components/AccountAbnormalitiesTest.kt +++ b/app/src/test/java/org/mozilla/fenix/components/AccountAbnormalitiesTest.kt @@ -53,10 +53,9 @@ class AccountAbnormalitiesTest { @Test fun `LogoutWithoutAuth detected`() = runBlocking { val crashReporter: CrashReporter = mockk(relaxed = true) - val accountManager: FxaAccountManager = mockk(relaxed = true) val accountAbnormalities = newAccountAbnormalities(crashReporter, this.coroutineContext) - accountAbnormalities.accountManagerStarted(accountManager) + accountAbnormalities.onReady(mockk(relaxed = true)) // Logout action must be preceded by auth. accountAbnormalities.userRequestedLogout() @@ -66,10 +65,9 @@ class AccountAbnormalitiesTest { @Test fun `OverlappingFxaLogoutRequest detected`() = runBlocking { val crashReporter: CrashReporter = mockk(relaxed = true) - val accountManager: FxaAccountManager = mockk(relaxed = true) val accountAbnormalities = newAccountAbnormalities(crashReporter, this.coroutineContext) - accountAbnormalities.accountManagerStarted(accountManager) + accountAbnormalities.onReady(mockk(relaxed = true)) accountAbnormalities.onAuthenticated(mockk(), mockk()) // So far, so good. A regular logout request while being authenticated. @@ -84,10 +82,9 @@ class AccountAbnormalitiesTest { @Test fun `callback logout abnormalities detected`() = runBlocking { val crashReporter: CrashReporter = mockk(relaxed = true) - val accountManager: FxaAccountManager = mockk(relaxed = true) val accountAbnormalities = newAccountAbnormalities(crashReporter, this.coroutineContext) - accountAbnormalities.accountManagerStarted(accountManager) + accountAbnormalities.onReady(mockk(relaxed = true)) // User didn't request this logout. accountAbnormalities.onLoggedOut() @@ -100,7 +97,7 @@ class AccountAbnormalitiesTest { val accountManager: FxaAccountManager = mockk(relaxed = true) val accountAbnormalities = newAccountAbnormalities(crashReporter, this.coroutineContext) - accountAbnormalities.accountManagerStarted(accountManager) + accountAbnormalities.onReady(null) accountAbnormalities.onAuthenticated(mockk(), mockk()) verify { crashReporter wasNot Called } @@ -110,7 +107,7 @@ class AccountAbnormalitiesTest { val accountAbnormalities2 = newAccountAbnormalities(crashReporter, this.coroutineContext) // mock accountManager doesn't have an account, but we expect it to have one since we // were authenticated before our "restart". - accountAbnormalities2.accountManagerStarted(accountManager) + accountAbnormalities2.onReady(null) assertCaughtException(crashReporter) } @@ -118,10 +115,9 @@ class AccountAbnormalitiesTest { @Test fun `logout happy case`() = runBlocking { val crashReporter: CrashReporter = mockk() - val accountManager: FxaAccountManager = mockk(relaxed = true) val accountAbnormalities = newAccountAbnormalities(crashReporter, coroutineContext) - accountAbnormalities.accountManagerStarted(accountManager) + accountAbnormalities.onReady(mockk(relaxed = true)) // We saw an auth event, then user requested a logout. accountAbnormalities.onAuthenticated(mockk(), mockk()) diff --git a/buildSrc/src/main/java/AndroidComponents.kt b/buildSrc/src/main/java/AndroidComponents.kt index 6fc723647b..2428505078 100644 --- a/buildSrc/src/main/java/AndroidComponents.kt +++ b/buildSrc/src/main/java/AndroidComponents.kt @@ -3,5 +3,5 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ object AndroidComponents { - const val VERSION = "100.0.20220308160838" + const val VERSION = "100.0.20220309001717" }