Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
android-components
Commits
5c6316e8
Commit
5c6316e8
authored
Jan 26, 2022
by
Roger Yang
Committed by
Jonathan Almeida
Jan 26, 2022
Browse files
No issue: Add null as valid code
parent
04b4421b
Changes
2
Hide whitespace changes
Inline
Side-by-side
components/feature/search/src/main/java/mozilla/components/feature/search/telemetry/Utils.kt
View file @
5c6316e8
...
...
@@ -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
...
...
components/feature/search/src/test/java/mozilla/components/feature/search/telemetry/incontent/InContentTelemetryTest.kt
View file @
5c6316e8
...
...
@@ -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
a
n
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
a
n
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment