mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-15 18:12:54 +00:00
Bug 1861173 - Correctly increment shopping CFR counter
Using `.inc()` was wrong due to it returning the incremented value and not incrementing the already existing one. This patch aims to fix that, therefore showing the CFR correctly for max 3 times.
This commit is contained in:
parent
87d4f27bd3
commit
5ee95765f2
@ -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
|
||||
) {
|
||||
|
@ -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<Settings> {
|
||||
every { reviewQualityCheckCfrDisplayTimeInMillis } returns System.currentTimeMillis()
|
||||
every { reviewQualityCheckCFRClosedCounter } returns 3
|
||||
every { reviewQualityCheckCFRClosedCounter = 4 } just Runs
|
||||
every { shouldShowReviewQualityCheckCFR } returns true
|
||||
every { shouldShowReviewQualityCheckCFR = any() } just Runs
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user