Backed out changeset 4a504fa8d156 (bug 1802207) for causing bc failures CLOSED TREE

This commit is contained in:
Cristian Tuns 2022-11-24 10:46:53 -05:00
parent aad27a0603
commit c0add0d0fb
3 changed files with 14 additions and 12 deletions

View File

@ -1059,9 +1059,6 @@ class TelemetryFeed {
}
Glean.newtab.newtabCategory.set(newtabCategory);
Glean.newtab.homepageCategory.set(homePageCategory);
if (lazy.NimbusFeatures.glean.getVariable("newtabPingEnabled") ?? true) {
GleanPings.newtab.submit("component_init");
}
}
}
@ -1278,6 +1275,12 @@ class TelemetryFeed {
}
setNewtabPrefMetrics();
Glean.pocket.isSignedIn.set(lazy.pktApi.isUserLoggedIn());
if (
this.telemetryEnabled &&
(lazy.NimbusFeatures.glean.getVariable("newtabPingEnabled") ?? true)
) {
GleanPings.newtab.submit("component_init");
}
}
uninit() {

View File

@ -15,8 +15,7 @@ newtab:
The newtab visit ended.
Could be by navigation, being closed, etc.
component_init: |
The newtab component init'd,
and the newtab and homepage settings have been categorized.
The newtab component init'd.
This is mostly to ensure we hear at least once from clients configured to
not show a newtab UI.
include_client_id: true

View File

@ -181,6 +181,13 @@ describe("TelemetryFeed", () => {
assert.calledWithExactly(stub, "unload", instance.handleEvent);
assert.calledWithExactly(stub, "TabPinned", instance.handleEvent);
});
it("should send a 'newtab' ping", () => {
instance._prefs.set(TELEMETRY_PREF, true);
sandbox.spy(GleanPings.newtab, "submit");
instance.init();
assert.calledOnce(GleanPings.newtab.submit);
assert.calledWithExactly(GleanPings.newtab.submit, "component_init");
});
describe("telemetry pref changes from false to true", () => {
beforeEach(() => {
FakePrefs.prototype.prefs = {};
@ -1718,13 +1725,6 @@ describe("TelemetryFeed", () => {
assert.calledOnce(Glean.newtab.homepageCategory.set);
assert.calledWith(Glean.newtab.homepageCategory.set, "disabled");
});
it("should send a 'newtab' ping", async () => {
instance._prefs.set(TELEMETRY_PREF, true);
sandbox.spy(GleanPings.newtab, "submit");
await instance.sendPageTakeoverData();
assert.calledOnce(GleanPings.newtab.submit);
assert.calledWithExactly(GleanPings.newtab.submit, "component_init");
});
});
describe("#sendDiscoveryStreamImpressions", () => {
it("should not send impression pings if there is no impression data", () => {