Bug 1823543 - Add telemetry to distinguish trending results. r=adw

Differential Revision: https://phabricator.services.mozilla.com/D173093
This commit is contained in:
Dale Harvey
2023-03-28 13:28:44 +00:00
parent 5cda0837e7
commit 543ce47074
7 changed files with 132 additions and 16 deletions

View File

@@ -112,6 +112,29 @@ add_task(async function test_trending_results() {
});
});
add_task(async function test_trending_telemetry() {
await SpecialPowers.pushPrefEnv({
set: [
["browser.urlbar.trending.featureGate", true],
["browser.urlbar.trending.requireSearchMode", false],
],
});
await UrlbarTestUtils.promiseAutocompleteResultPopup({
window,
value: "",
waitForFocus: SimpleTest.waitForFocus,
});
await UrlbarTestUtils.promisePopupClose(window, () => {
EventUtils.synthesizeKey("KEY_ArrowDown");
EventUtils.synthesizeKey("KEY_Enter");
});
let scalars = TelemetryTestUtils.getProcessScalars("parent", true, true);
TelemetryTestUtils.assertKeyedScalar(scalars, "urlbar.picked.trending", 0, 1);
});
async function check_results({
featureEnabled = false,
requireSearchModeEnabled = true,