|
|
@ -148,6 +148,9 @@ class FenixApplicationTest {
|
|
|
|
assertTrue(settings.contileContextId.isEmpty())
|
|
|
|
assertTrue(settings.contileContextId.isEmpty())
|
|
|
|
assertNull(TopSites.contextId.testGetValue())
|
|
|
|
assertNull(TopSites.contextId.testGetValue())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertTrue(settings.sharedPrefsUUID.isEmpty())
|
|
|
|
|
|
|
|
assertNull(Metrics.sharedPrefsUuid.testGetValue())
|
|
|
|
|
|
|
|
|
|
|
|
application.setStartupMetrics(browserStore, settings, browsersCache, mozillaProductDetector)
|
|
|
|
application.setStartupMetrics(browserStore, settings, browsersCache, mozillaProductDetector)
|
|
|
|
|
|
|
|
|
|
|
|
// Verify that browser defaults metrics are set.
|
|
|
|
// Verify that browser defaults metrics are set.
|
|
|
@ -192,6 +195,14 @@ class FenixApplicationTest {
|
|
|
|
assertNotNull(TopSites.contextId.testGetValue())
|
|
|
|
assertNotNull(TopSites.contextId.testGetValue())
|
|
|
|
assertEquals(contextId, settings.contileContextId)
|
|
|
|
assertEquals(contextId, settings.contileContextId)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Verify that setStartupMetrics() creates `the Metrics.sharedPrefsUuid`
|
|
|
|
|
|
|
|
// Glean metric and that it stores the value in shared preferences at
|
|
|
|
|
|
|
|
// settings.sharedPrefsUUID. Subsequent calls load the UUID value from
|
|
|
|
|
|
|
|
// shared preferences rather than generating a new one.
|
|
|
|
|
|
|
|
val sharedPrefsUUIDMetricValue = Metrics.sharedPrefsUuid.testGetValue()!!.toString()
|
|
|
|
|
|
|
|
assertNotNull(Metrics.sharedPrefsUuid.testGetValue())
|
|
|
|
|
|
|
|
assertEquals(sharedPrefsUUIDMetricValue, settings.sharedPrefsUUID)
|
|
|
|
|
|
|
|
|
|
|
|
// Verify that search engine defaults are NOT set. This test does
|
|
|
|
// Verify that search engine defaults are NOT set. This test does
|
|
|
|
// not mock most of the objects telemetry is collected from.
|
|
|
|
// not mock most of the objects telemetry is collected from.
|
|
|
|
assertNull(SearchDefaultEngine.code.testGetValue())
|
|
|
|
assertNull(SearchDefaultEngine.code.testGetValue())
|
|
|
@ -202,6 +213,9 @@ class FenixApplicationTest {
|
|
|
|
|
|
|
|
|
|
|
|
assertEquals(contextId, TopSites.contextId.testGetValue()!!.toString())
|
|
|
|
assertEquals(contextId, TopSites.contextId.testGetValue()!!.toString())
|
|
|
|
assertEquals(contextId, settings.contileContextId)
|
|
|
|
assertEquals(contextId, settings.contileContextId)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertEquals(sharedPrefsUUIDMetricValue, Metrics.sharedPrefsUuid.testGetValue()!!.toString())
|
|
|
|
|
|
|
|
assertEquals(sharedPrefsUUIDMetricValue, settings.sharedPrefsUUID)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|