8000 Cleanup tracker eval optimization A/B test code (#4214) · CodersSampling/DuckDuckGoAndroid@2c65b18 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 2c65b18

Browse files
authored
Cleanup tracker eval optimization A/B test code (duckduckgo#4214)
<!-- Note: This checklist is a reminder of our shared engineering expectations. The items in Bold are required If your PR involves UI changes: 1. Upload screenshots or screencasts that illustrate the changes before / after 2. Add them under the UI changes section (feel free to add more columns if needed) If your PR does not involve UI changes, you can remove the **UI changes** section At a minimum, make sure your changes are tested in API 23 and one of the more recent API levels available. --> Task/Issue URL: https://app.asana.com/0/488551667048375/1206569743632246/f ### Description * Remove code supporting tracker evaluation A/B test. Keep only treatment variant * Expand treatment approach to URLs coming from service workers ### Steps to test this PR _Test dabatase migration_ - Update from previous version, check app doesn't crash _Smoke test_ - Smoke test app, check tracker blocking is working as expected ### UI changes No UI changes
1 parent 7f24875 commit 2c65b18

File tree

57 files changed

+465
-1227
lines changed

Some content is hidden

Large Commits have some content hidden by default F438 . Use the searchbox below for content that may be hidden.

57 files changed

+465
-1227
lines changed

ad-click/ad-click-impl/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ android {
3535
dependencies {
3636
anvil project(path: ':anvil-compiler')
3737
implementation project(path: ':anvil-annotations')
38+
implementation project(path: ':browser-api')
3839
implementation project(path: ':ad-click-api')
3940
implementation project(path: ':di')
4041
implementation project(path: ':common-utils')

ad-click/ad-click-impl/src/main/java/com/duckduckgo/adclick/impl/DuckDuckGoAdClickManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package com.duckduckgo.adclick.impl
1919
import com.duckduckgo.adclick.api.AdClickManager
2020
import com.duckduckgo.adclick.impl.pixels.AdClickPixelName
2121
import com.duckduckgo.adclick.impl.pixels.AdClickPixels
22-
import com.duckduckgo.common.utils.UriString
22+
import com.duckduckgo.app.browser.UriString
2323
import com.duckduckgo.di.scopes.AppScope
2424
import com.squareup.anvil.annotations.ContributesBinding
2525
import dagger.SingleInstanceIn

ad-click/ad-click-impl/src/main/java/com/duckduckgo/adclick/impl/RealAdClickAttribution.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import android.net.Uri
2020
import com.duckduckgo.adclick.api.AdClickFeatureName
2121
import com.duckduckgo.adclick.store.AdClickAttributionLinkFormatEntity
2222
import com.duckduckgo.adclick.store.AdClickAttributionRepository
23-
import com.duckduckgo.common.utils.UriString
23+
import com.duckduckgo.app.browser.UriString
2424
import com.duckduckgo.di.scopes.AppScope
2525
import com.duckduckgo.feature.toggles.api.FeatureToggle
2626
import com.squareup.anvil.annotations.ContributesBinding

app/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ android {
7272
kotlin {
7373
jvmToolchain(17)
7474
}
75+
ksp {
76+
arg("room.generateKotlin", "true")
77+
}
7578
signingConfigs {
7679
release
7780
}

app/src/androidTest/java/com/duckduckgo/app/browser/BrowserWebViewClientTest.kt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ import com.duckduckgo.app.browser.navigation.safeCopyBackForwardList
5353
import com.duckduckgo.app.browser.pageloadpixel.PageLoadedHandler
5454
import com.duckduckgo.app.browser.print.PrintInjector
5555
import com.duckduckgo.app.global.model.Site
56-
import com.duckduckgo.app.pixels.remoteconfig.OptimizeTrackerEvaluationRCWrapper
5756
import com.duckduckgo.app.statistics.pixels.Pixel
5857
import com.duckduckgo.autoconsent.api.Autoconsent
5958
import com.duckduckgo.autofill.api.BrowserAutofill
@@ -120,7 +119,6 @@ class BrowserWebViewClientTest {
120119
private val currentTimeProvider: CurrentTimeProvider = mock()
121120
private val deviceInfo: DeviceInfo = mock()
122121
private val pageLoadedHandler: PageLoadedHandler = mock()
123-
private val optimizeTrackerEvaluationRCWrapper = TestOptimizeTrackerEvaluationRCWrapper()
124122
private val mediaPlayback: MediaPlayback = mock()
125123

126124
@UiThreadTest
@@ -150,7 +148,6 @@ class BrowserWebViewClientTest {
150148
jsPlugins,
151149
currentTimeProvider,
152150
pageLoadedHandler,
153-
optimizeTrackerEvaluationRCWrapper,
154151
mediaPlayback,
155152
)
156153
testee.webViewClientListener = listener
@@ -272,10 +269,9 @@ class BrowserWebViewClientTest {
272269

273270
@UiThreadTest
274271
@Test
275-
fun whenShouldInterceptRequestAndOptimizeEnabledThenShouldInterceptWithUri() {
272+
fun whenShouldInterceptRequestThenShouldInterceptWithUri() {
276273
TestScope().launch {
277274
val webResourceRequest = mock<WebResourceRequest>()
278-
optimizeTrackerEvaluationRCWrapper.value = true
279275
testee.shouldInterceptRequest(webView, webResourceRequest)
280276
verify(requestInterceptor).shouldIntercept(any(), any(), any<Uri>(), any())
281277
}
@@ -909,13 +905,6 @@ class BrowserWebViewClientTest {
909905
override fun clone(): WebHistoryItem = throw NotImplementedError()
910906
}
911907

912-
private class TestOptimizeTrackerEvaluationRCWrapper : OptimizeTrackerEvaluationRCWrapper {
913-
914-
var value = false
915-
override val enabled: Boolean
916-
get() = value
917-
}
918-
919908
companion object {
920909
const val EXAMPLE_URL = "example.com"
921910
}

0 commit comments

Comments
 (0)
0