@@ -23,7 +23,7 @@ import com.duckduckgo.app.browser.senseofprotection.SenseOfProtectionExperiment
23
23
import com.duckduckgo.app.global.model.PrivacyShield.MALICIOUS
24
24
import com.duckduckgo.app.global.model.PrivacyShield.PROTECTED
25
25
import com.duckduckgo.app.global.model.PrivacyShield.UNPROTECTED
26
- import com.duckduckgo.common.ui.experiments.visual.store.VisualDesignExperimentDataStore
26
+ import com.duckduckgo.common.ui.experiments.visual.store.ExperimentalThemingDataStore
27
27
import com.duckduckgo.common.ui.store.AppTheme
28
28
import kotlinx.coroutines.flow.MutableStateFlow
29
29
import kotlinx.coroutines.test.runTest
@@ -36,13 +36,13 @@ import org.mockito.kotlin.whenever
36
36
class LottiePrivacyShieldAnimationHelperTest {
37
37
38
38
private val senseOfProtectionExperiment: SenseOfProtectionExperiment = mock()
39
- private val visualDesignExperimentDataStore : VisualDesignExperimentDataStore = mock()
39
+ private val experimentalThemingDataStore : ExperimentalThemingDataStore = mock()
40
40
private val enabledVisualExperimentStateFlow = MutableStateFlow (true )
41
41
private val disabledVisualExperimentStateFlow = MutableStateFlow (false )
42
42
43
43
@Before
44
44
fun setup () {
45
- whenever(visualDesignExperimentDataStore.isExperimentEnabled ).thenReturn(
45
+ whenever(experimentalThemingDataStore.isSingleOmnibarEnabled ).thenReturn(
46
46
disabledVisualExperimentStateFlow,
47
47
)
48
48
}
@@ -54,7 +54,7 @@ class LottiePrivacyShieldAnimationHelperTest {
54
54
val holder: LottieAnimationView = mock()
55
55
val appTheme: AppTheme = mock()
56
56
whenever(appTheme.isLightModeEnabled()).thenReturn(true )
57
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
57
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
58
58
59
59
testee.setAnimationView(holder, PROTECTED )
60
60
@@ -68,7 +68,7 @@ class LottiePrivacyShieldAnimationHelperTest {
68
68
val holder: LottieAnimationView = mock()
69
69
val appTheme: AppTheme = mock()
70
70
whenever(appTheme.isLightModeEnabled()).thenReturn(false )
71
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
71
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
72
72
73
73
testee.setAnimationView(holder, PROTECTED )
74
74
@@ -82,7 +82,7 @@ class LottiePrivacyShieldAnimationHelperTest {
82
82
val holder: LottieAnimationView = mock()
83
83
val appTheme: AppTheme = mock()
84
84
whenever(appTheme.isLightModeEnabled()).thenReturn(true )
85
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
85
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
86
86
87
87
testee.setAnimationView(holder, UNPROTECTED )
88
88
@@ -97,7 +97,7 @@ class LottiePrivacyShieldAnimationHelperTest {
97
97
val holder: LottieAnimationView = mock()
98
98
val appTheme: AppTheme = mock()
99
99
whenever(appTheme.isLightModeEnabled()).thenReturn(false )
100
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
100
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
101
101
102
102
testee.setAnimationView(holder, UNPROTECTED )
103
103
@@ -112,7 +112,7 @@ class LottiePrivacyShieldAnimationHelperTest {
112
112
val holder: LottieAnimationView = mock()
113
113
val appTheme: AppTheme = mock()
114
114
whenever(appTheme.isLightModeEnabled()).thenReturn(true )
115
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
115
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
116
116
117
117
testee.setAnimationView(holder, MALICIOUS )
118
118
@@ -127,7 +127,7 @@ class LottiePrivacyShieldAnimationHelperTest {
127
127
val holder: LottieAnimationView = mock()
128
128
val appTheme: AppTheme = mock()
129
129
whenever(appTheme.isLightModeEnabled()).thenReturn(false )
130
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
130
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
131
131
132
132
testee.setAnimationView(holder, MALICIOUS )
133
133
@@ -144,7 +144,7 @@ class LottiePrivacyShieldAnimationHelperTest {
144
144
val appTheme: AppTheme = mock()
145
145
whenever(appTheme.isLightModeEnabled()).thenReturn(true )
146
146
147
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
147
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
148
148
149
149
testee.setAnimationView(holder, PROTECTED )
150
150
@@ -160,7 +160,7 @@ class LottiePrivacyShieldAnimationHelperTest {
160
160
val appTheme: AppTheme = mock()
161
161
whenever(appTheme.isLightModeEnabled()).thenReturn(true )
162
162
163
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
163
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
164
164
165
165
testee.setAnimationView(holder, UNPROTECTED )
166
166
@@ -176,7 +176,7 @@ class LottiePrivacyShieldAnimationHelperTest {
176
176
val appTheme: AppTheme = mock()
177
177
whenever(appTheme.isLightModeEnabled()).thenReturn(false )
178
178
179
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
179
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
180
180
181
181
testee.setAnimationView(holder, PROTECTED )
182
182
@@ -192,7 +192,7 @@ class LottiePrivacyShieldAnimationHelperTest {
192
192
val appTheme: AppTheme = mock()
193
193
whenever(appTheme.isLightModeEnabled()).thenReturn(false )
194
194
195
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
195
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
196
196
197
197
testee.setAnimationView(holder, UNPROTECTED )
198
198
@@ -209,7 +209,7 @@ class LottiePrivacyShieldAnimationHelperTest {
209
209
val appTheme: AppTheme = mock()
210
210
whenever(appTheme.isLightModeEnabled()).thenReturn(true )
211
211
212
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
212
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
213
213
214
214
testee.setAnimationView(holder, PROTECTED )
215
215
@@ -218,36 +218,36 @@ class LottiePrivacyShieldAnimationHelperTest {
218
218
219
219
@SuppressLint(" DenyListedApi" )
220
220
@Test
221
- fun whenLightModeAndProtectedAndSelfEnabledAndShouldShowNewVisualDesignShieldThenUseExperimentAssets () = runTest {
221
+ fun whenLightModeAndProtectedAndNewSignleOmnibarDesignEnabledShowCheckmarkAssets () = runTest {
222
222
whenever(senseOfProtectionExperiment.shouldShowNewPrivacyShield()).thenReturn(false )
223
- whenever(visualDesignExperimentDataStore.isExperimentEnabled ).thenReturn(
223
+ whenever(experimentalThemingDataStore.isSingleOmnibarEnabled ).thenReturn(
224
224
enabledVisualExperimentStateFlow,
225
225
)
226
226
227
227
val holder: LottieAnimationView = mock()
228
228
val appTheme: AppTheme = mock()
229
229
whenever(appTheme.isLightModeEnabled()).thenReturn(true )
230
230
231
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
231
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
232
232
233
233
testee.setAnimationView(holder, PROTECTED )
234
234
235
- verify(holder).setAnimation(R .raw.protected_shield_visual_updates )
235
+ verify(holder).setAnimation(R .raw.protected_shield_new_design )
236
236
}
237
237
238
238
@SuppressLint(" DenyListedApi" )
239
239
@Test
240
- fun whenLightModeAndUnprotectedAndSelfEnabledAndShouldShowNewVisualDesignShieldThenUseExperimentAssets () = runTest {
240
+ fun whenLightModeAndUnprotectedAndNewSignleOmnibarDesignEnabledThenUseExperimentAssets () = runTest {
241
241
whenever(senseOfProtectionExperiment.shouldShowNewPrivacyShield()).thenReturn(false )
242
- whenever(visualDesignExperimentDataStore.isExperimentEnabled ).thenReturn(
242
+ whenever(experimentalThemingDataStore.isSingleOmnibarEnabled ).thenReturn(
243
243
enabledVisualExperimentStateFlow,
244
244
)
245
245
246
246
val holder: LottieAnimationView = mock()
247
247
val appTheme: AppTheme = mock()
248
248
whenever(appTheme.isLightModeEnabled()).thenReturn(true )
249
249
250
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
250
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
251
251
252
252
testee.setAnimationView(holder, UNPROTECTED )
253
253
@@ -256,59 +256,39 @@ class LottiePrivacyShieldAnimationHelperTest {
256
256
257
257
@SuppressLint(" DenyListedApi" )
258
258
@Test
259
- fun whenDarkModeAndProtectedAndSelfEnabledAndShouldShowNewVisualDesignShieldThenUseExperimentAssets () = runTest {
259
+ fun whenDarkModeAndProtectedAndNewSignleOmnibarDesignEnabledShowCheckmarkAssets () = runTest {
260
260
whenever(senseOfProtectionExperiment.shouldShowNewPrivacyShield()).thenReturn(false )
261
- whenever(visualDesignExperimentDataStore.isExperimentEnabled ).thenReturn(
261
+ whenever(experimentalThemingDataStore.isSingleOmnibarEnabled ).thenReturn(
262
262
enabledVisualExperimentStateFlow,
263
263
)
264
264
265
265
val holder: LottieAnimationView = mock()
266
266
val appTheme: AppTheme = mock()
267
267
whenever(appTheme.isLightModeEnabled()).thenReturn(false )
268
268
269
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
269
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
270
270
271
271
testee.setAnimationView(holder, PROTECTED )
272
272
273
- verify(holder).setAnimation(R .raw.dark_protected_shield_visual_updates )
273
+ verify(holder).setAnimation(R .raw.dark_protected_shield_new_design )
274
274
}
275
275
276
276
@SuppressLint(" DenyListedApi" )
277
277
@Test
278
- fun whenDarkModeAndUnprotectedAndSelfEnabledAndShouldShowNewVisualDesignShieldThenUseExperimentAssets () = runTest {
278
+ fun whenDarkModeAndUnprotectedAndNewSignleOmnibarDesignEnabledThenUseExperimentAssets () = runTest {
279
279
whenever(senseOfProtectionExperiment.shouldShowNewPrivacyShield()).thenReturn(false )
280
- whenever(visualDesignExperimentDataStore.isExperimentEnabled ).thenReturn(
280
+ whenever(experimentalThemingDataStore.isSingleOmnibarEnabled ).thenReturn(
281
281
enabledVisualExperimentStateFlow,
282
282
)
283
283
284
284
val holder: LottieAnimationView = mock()
285
285
val appTheme: AppTheme = mock()
286
286
whenever(appTheme.isLightModeEnabled()).thenReturn(false )
287
287
288
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore )
288
+ val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, experimentalThemingDataStore )
289
289
290
290
testee.setAnimationView(holder, UNPROTECTED )
291
291
292
292
verify(holder).setAnimation(R .raw.dark_unprotected_shield_visual_updates)
293
293
}
294
-
295
- @SuppressLint(" DenyListedApi" )
296
- @Test
297
- fun whenLightModeAndProtectedAndSelfEnabledAndShouldShowNotNewVisualDesignShieldThenUseNonExperimentAssets () = runTest {
298
- whenever(senseOfProtectionExperiment.shouldShowNewPrivacyShield()).thenReturn(false )
299
- whenever(senseOfProtectionExperiment.isUserEnrolledInAVariantAndExperimentEnabled()).thenReturn(false )
300
- whenever(visualDesignExperimentDataStore.isExperimentEnabled).thenReturn(
301
- disabledVisualExperimentStateFlow,
302
- )
303
-
304
- val holder: LottieAnimationView = mock()
305
- val appTheme: AppTheme = mock()
306
- whenever(appTheme.isLightModeEnabled()).thenReturn(true )
307
-
308
- val testee = LottiePrivacyShieldAnimationHelper (appTheme, senseOfProtectionExperiment, visualDesignExperimentDataStore)
309
-
310
- testee.setAnimationView(holder, PROTECTED )
311
-
312
- verify(holder).setAnimation(R .raw.protected_shield)
313
- }
314
294
}
0 commit comments