Skip to content
Snippets Groups Projects
Commit ed9bda9e authored by Chris H-C's avatar Chris H-C
Browse files

Bug 1704184 - Send a FOG "baseline" ping with reason "active" at init r=janerik

parent 39a88c2c
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,10 @@ pub(crate) struct InitUserActivityObserver {
#[allow(non_snake_case)]
impl UserActivityObserver {
pub(crate) unsafe fn begin_observing() -> Result<(), nsresult> {
// First and foremost, even if we can't get the ObserverService,
// init always means client activity.
glean::handle_client_active();
let activity_obs = Self::allocate(InitUserActivityObserver {
last_edge: RwLock::new(Instant::now()),
was_active: AtomicBool::new(false),
......
......@@ -11,6 +11,12 @@ class TestClientActivity(FOGTestCase):
def test_user_activity(self):
# First test that restarting the browser sends a "active" ping
ping0 = self.wait_for_ping(
self.restart_browser, FOG_BASELINE_PING, ping_server=self.fog_ping_server
)
self.assertEqual("active", ping0["payload"]["ping_info"]["reason"])
with self.marionette.using_context(self.marionette.CONTEXT_CHROME):
zero_prefs_script = """\
Services.prefs.setIntPref("telemetry.fog.test.inactivity_limit", 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment