Bug 1476689 - [2.2] Add basic runtime telemetry test. r=jchen

This commit is contained in:
Eugen Sawin 2018-07-18 18:47:38 +02:00
parent 9db162a5e5
commit 6e519bf333

View File

@ -4,6 +4,7 @@
package org.mozilla.geckoview.test
import org.mozilla.gecko.util.GeckoBundle
import org.mozilla.geckoview.GeckoResult
import org.mozilla.geckoview.GeckoSession
import org.mozilla.geckoview.GeckoSessionSettings
@ -95,6 +96,23 @@ class NavigationDelegateTest : BaseSessionTest() {
containsString(mobileSubStr))
}
@Test fun telemetry() {
sessionRule.session.loadTestPath(HELLO_HTML_PATH)
sessionRule.waitForPageStop()
val telemetry = sessionRule.runtime.telemetry
val result = sessionRule.waitForResult(telemetry.getSnapshots(true))
assertThat("Histograms should not be null",
result?.get("histograms"), notNullValue())
assertThat("Keyed histograms should not be null",
result?.get("keyedHistograms"), notNullValue())
assertThat("Scalars should not be null",
result?.get("scalars"), notNullValue())
assertThat("Keyed scalars should not be null",
result?.get("keyedScalars"), notNullValue())
}
@Test fun load() {
sessionRule.session.loadTestPath(HELLO_HTML_PATH)
sessionRule.waitForPageStop()