Source code
Revision control
Copy as Markdown
Other Tools
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
from marionette_harness import BaseMarionetteTestRunner
from telemetry_harness.testcase import TelemetryTestCase
class TelemetryTestRunner(BaseMarionetteTestRunner):
"""TestRunner for the telemetry-tests-client suite."""
def __init__(self, **kwargs):
"""Set test variables and preferences specific to Firefox client
telemetry.
"""
# Select the appropriate GeckoInstance
kwargs["app"] = "fxdesktop"
prefs = kwargs.pop("prefs", {})
prefs["fission.autostart"] = True
if kwargs["disable_fission"]:
prefs["fission.autostart"] = False
# Set Firefox Client Telemetry specific preferences
prefs.update(
{
# Clear the region detection url to
# * avoid net access in tests
"browser.region.network.url": "",
"browser.cache.disk.smart_size.enabled": False,
"toolkit.telemetry.server": "{}/pings".format(SERVER_URL),
"telemetry.fog.test.localhost_port": -1,
"toolkit.telemetry.initDelay": 1,
"toolkit.telemetry.minSubsessionLength": 0,
"datareporting.healthreport.uploadEnabled": True,
"datareporting.policy.dataSubmissionEnabled": True,
"datareporting.policy.dataSubmissionPolicyBypassNotification": True,
"toolkit.telemetry.log.level": "Trace",
"toolkit.telemetry.log.dump": True,
"toolkit.telemetry.send.overrideOfficialCheck": True,
"toolkit.telemetry.testing.disableFuzzingDelay": True,
# Disable Normandy to avoid extra subsessions due to Experiment
"app.normandy.enabled": False,
# This should also disable Nimbus.
"app.shield.optoutstudies.enabled": False,
# disabling the addon resulting in extra subsessions
"screenshots.browser.component.enabled": False,
}
)
super(TelemetryTestRunner, self).__init__(prefs=prefs, **kwargs)
self.testvars["server_root"] = kwargs["server_root"]
self.testvars["server_url"] = SERVER_URL
self.test_handlers = [TelemetryTestCase]