summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/test/browser/browser_newtab_glean.js
blob: 7d40868f2c32a7000d754bea32e849d484e294ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

requestLongerTimeout(10);

const TELEMETRY_PREF =
  "browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar";

add_task(async function test_newtab_handoff_performance_telemetry() {
  await SpecialPowers.pushPrefEnv({
    set: [[TELEMETRY_PREF, true]],
  });

  Services.fog.testResetFOG();
  let TelemetryFeed =
    AboutNewTab.activityStream.store.feeds.get("feeds.telemetry");
  TelemetryFeed.init(); // INIT action doesn't happen by default.

  Assert.equal(true, Glean.newtabHandoffPreference.enabled.testGetValue());

  await SpecialPowers.pushPrefEnv({
    set: [[TELEMETRY_PREF, false]],
  });
  Assert.equal(false, Glean.newtabHandoffPreference.enabled.testGetValue());
  await SpecialPowers.popPrefEnv();
});