diff --git a/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarController.kt b/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarController.kt index adf8f140d7..0c0487df65 100644 --- a/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarController.kt +++ b/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarController.kt @@ -237,7 +237,7 @@ class DefaultBrowserToolbarController( * As described in: https://bugzilla.mozilla.org/show_bug.cgi?id=1861173#c0 */ private fun updateShoppingCfrSettings() = with(activity.settings()) { - reviewQualityCheckCFRClosedCounter.inc() + reviewQualityCheckCFRClosedCounter++ if (reviewQualityCheckCfrDisplayTimeInMillis != 0L && reviewQualityCheckCFRClosedCounter >= MAX_DISPLAY_NUMBER_SHOPPING_CFR ) { diff --git a/app/src/test/java/org/mozilla/fenix/components/toolbar/DefaultBrowserToolbarControllerTest.kt b/app/src/test/java/org/mozilla/fenix/components/toolbar/DefaultBrowserToolbarControllerTest.kt index e8bf7dc82d..f144feb4d9 100644 --- a/app/src/test/java/org/mozilla/fenix/components/toolbar/DefaultBrowserToolbarControllerTest.kt +++ b/app/src/test/java/org/mozilla/fenix/components/toolbar/DefaultBrowserToolbarControllerTest.kt @@ -402,6 +402,7 @@ class DefaultBrowserToolbarControllerTest { every { reviewQualityCheckCfrDisplayTimeInMillis } returns System.currentTimeMillis() every { reviewQualityCheckCfrDisplayTimeInMillis = any() } just Runs every { reviewQualityCheckCFRClosedCounter } returns 1 + every { reviewQualityCheckCFRClosedCounter = 2 } just Runs every { shouldShowReviewQualityCheckCFR } returns true } every { activity.settings() } returns mockSettings @@ -419,6 +420,7 @@ class DefaultBrowserToolbarControllerTest { every { reviewQualityCheckCfrDisplayTimeInMillis } returns System.currentTimeMillis() every { reviewQualityCheckCfrDisplayTimeInMillis = any() } just Runs every { reviewQualityCheckCFRClosedCounter } returns 2 + every { reviewQualityCheckCFRClosedCounter = 3 } just Runs every { shouldShowReviewQualityCheckCFR } returns true } every { activity.settings() } returns mockSettings @@ -435,6 +437,7 @@ class DefaultBrowserToolbarControllerTest { val mockSettings = mockk { every { reviewQualityCheckCfrDisplayTimeInMillis } returns System.currentTimeMillis() every { reviewQualityCheckCFRClosedCounter } returns 3 + every { reviewQualityCheckCFRClosedCounter = 4 } just Runs every { shouldShowReviewQualityCheckCFR } returns true every { shouldShowReviewQualityCheckCFR = any() } just Runs }