Commit 5c6316e8 authored by Roger Yang's avatar Roger Yang Committed by Jonathan Almeida
Browse files

No issue: Add null as valid code

parent 04b4421b
......@@ -20,7 +20,7 @@ private val validCodeSet = setOf(
"firefox-b-lg", "firefox-b-huawei-h1611", "firefox-b-is-oem1", "firefox-b-oem1",
"firefox-b-oem2", "firefox-b-tinno", "firefox-b-pn-wt", "firefox-b-pn-wt-us", "ubuntu",
"ffab", "ffcm", "ffhp", "ffip", "ffit", "ffnt", "ffocus", "ffos", "ffsb", "fpas", "fpsa",
"ftas", "ftsa", "newext", "1000969a"
"ftas", "ftsa", "newext", "1000969a", null
)
/**
......@@ -48,7 +48,7 @@ internal fun getTrackKey(
// For Bug 1751920
if (!validCodeSet.contains(code)) {
code = null
code = "other"
}
// Glean doesn't allow code starting with a figure
......
......@@ -128,7 +128,7 @@ class InContentTelemetryTest {
}
@Test
fun `GIVEN a Bing search WHEN trackPartnerUrlTypeMetric is called THEN emit an appropriate IN_CONTENT_SEARCH fact`() {
fun `GIVEN an invalid Bing search WHEN trackPartnerUrlTypeMetric is called THEN emit an appropriate IN_CONTENT_SEARCH fact`() {
val url = "https://www.bing.com/search?q=aaa&pc=MOZMBA"
val facts = mutableListOf<Fact>()
Facts.registerProcessor(object : FactProcessor {
......@@ -143,7 +143,7 @@ class InContentTelemetryTest {
assertEquals(Component.FEATURE_SEARCH, facts[0].component)
assertEquals(Action.INTERACTION, facts[0].action)
assertEquals(InContentTelemetry.IN_CONTENT_SEARCH, facts[0].item)
assertEquals("bing.in-content.sap.none", facts[0].value)
assertEquals("bing.in-content.sap.other", facts[0].value)
}
@Test
......@@ -166,7 +166,7 @@ class InContentTelemetryTest {
}
@Test
fun `GIVEN a invalid Google sap-follow-on WHEN trackPartnerUrlTypeMetric is called THEN emit an appropriate IN_CONTENT_SEARCH fact`() {
fun `GIVEN an invalid Google sap-follow-on WHEN trackPartnerUrlTypeMetric is called THEN emit an appropriate IN_CONTENT_SEARCH fact`() {
val url = "https://www.google.com/search?q=aaa&client=firefox-b-mTesting&oq=random"
val facts = mutableListOf<Fact>()
Facts.registerProcessor(object : FactProcessor {
......@@ -181,7 +181,7 @@ class InContentTelemetryTest {
assertEquals(Component.FEATURE_SEARCH, facts[0].component)
assertEquals(Action.INTERACTION, facts[0].action)
assertEquals(InContentTelemetry.IN_CONTENT_SEARCH, facts[0].item)
assertEquals("google.in-content.sap-follow-on.none", facts[0].value)
assertEquals("google.in-content.sap-follow-on.other", facts[0].value)
}
@Test
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment