[fenix] For https://github.com/mozilla-mobile/fenix/issues/18175 - Add telemetry for cookies option in custom ETP.

pull/600/head
Mugurell 2 years ago committed by mergify[bot]
parent 733dce16d6
commit 38d0eb7a9a

@ -1840,6 +1840,32 @@ preferences:
tags:
- TrackingProtection
- Settings
etp_custom_cookies_selection:
type: string
description: |
The option user has selected in the "Custom" mode of the
Enhanced Tracking Protection settings.
Possible values:
- total-protection for “Isolate cross-site cookies”
- social for “Cross-site and social media trackers”
- unvisited for “Cookies from unvisited sites”
- third-party for “All third-party cookies..”
- all for “All cookies..”
send_in_pings:
- metrics
bugs:
- https://github.com/mozilla-mobile/fenix/issues/18175
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/26449#issuecomment-1225765591
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
expires: 119
metadata:
tags:
- TrackingProtection
- Settings
bookmarks_suggestion:
type: boolean
description: |

@ -758,6 +758,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
else -> ""
}
)
etpCustomCookiesSelection.set(settings.blockCookiesSelectionInCustomTrackingProtection)
val accessibilitySelection = mutableListOf<String>()

@ -203,4 +203,17 @@ class FenixApplicationTest {
assertEquals(contextId, TopSites.contextId.testGetValue()!!.toString())
assertEquals(contextId, settings.contileContextId)
}
@Test
fun `GIVEN the current etp mode is custom WHEN tracking the etp metric THEN track also the cookies option`() {
val settings: Settings = mockk(relaxed = true) {
every { shouldUseTrackingProtection } returns true
every { useCustomTrackingProtection } returns true
every { blockCookiesSelectionInCustomTrackingProtection } returns "Test"
}
application.setStartupMetrics(browserStore, settings, browsersCache, mozillaProductDetector)
assertEquals("Test", Preferences.etpCustomCookiesSelection.testGetValue())
}
}

Loading…
Cancel
Save