зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1603760 - Remove navigation.search legacy event telemetry. r=Standard8,urlbar-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D222362
This commit is contained in:
Родитель
77a823cfa8
Коммит
9d701a4a80
|
@ -288,15 +288,6 @@ class BrowserSearchTelemetryHandler {
|
|||
scalarKey,
|
||||
1
|
||||
);
|
||||
Services.telemetry.recordEvent(
|
||||
"navigation",
|
||||
"search",
|
||||
scalarSource,
|
||||
action,
|
||||
{
|
||||
engine: engine.telemetryId,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -129,14 +129,6 @@ browser.engagement.navigation.*
|
|||
For ``urlbar`` or ``searchbar``, indicates the user confirmed a search
|
||||
suggestion.
|
||||
|
||||
navigation.search (OBSOLETE)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This is a legacy and disabled event telemetry that is currently under
|
||||
discussion for removal or modernization. It can't be enabled through a pref.
|
||||
it's more or less equivalent to browser.engagement.navigation, but can also
|
||||
report the picked search engine.
|
||||
|
||||
SearchSERPTelemetry.sys.mjs
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
@ -32,9 +32,6 @@ add_setup(async function () {
|
|||
let oldCanRecord = Services.telemetry.canRecordExtended;
|
||||
Services.telemetry.canRecordExtended = true;
|
||||
|
||||
// Enable event recording for the events tested here.
|
||||
Services.telemetry.setEventRecordingEnabled("navigation", true);
|
||||
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
[
|
||||
|
@ -46,7 +43,6 @@ add_setup(async function () {
|
|||
|
||||
registerCleanupFunction(async function () {
|
||||
await PlacesUtils.history.clear();
|
||||
Services.telemetry.setEventRecordingEnabled("navigation", false);
|
||||
Services.telemetry.canRecordExtended = oldCanRecord;
|
||||
});
|
||||
});
|
||||
|
@ -106,19 +102,7 @@ add_task(async function test_abouthome_activitystream_simpleQuery() {
|
|||
1
|
||||
);
|
||||
|
||||
// Also check events.
|
||||
TelemetryTestUtils.assertEvents(
|
||||
[
|
||||
{
|
||||
object: "about_home",
|
||||
value: "enter",
|
||||
extra: { engine: "other-MozSearch" },
|
||||
},
|
||||
],
|
||||
{ category: "navigation", method: "search" }
|
||||
);
|
||||
|
||||
// Also also check Glean events.
|
||||
// Also check Glean events.
|
||||
const record = Glean.newtabSearch.issued.testGetValue();
|
||||
Assert.ok(!!record, "Must have recorded a search issuance");
|
||||
Assert.equal(record.length, 1, "One search, one event");
|
||||
|
|
|
@ -28,12 +28,8 @@ add_setup(async function () {
|
|||
let oldCanRecord = Services.telemetry.canRecordExtended;
|
||||
Services.telemetry.canRecordExtended = true;
|
||||
|
||||
// Enable event recording for the events tested here.
|
||||
Services.telemetry.setEventRecordingEnabled("navigation", true);
|
||||
|
||||
registerCleanupFunction(async function () {
|
||||
await PlacesUtils.history.clear();
|
||||
Services.telemetry.setEventRecordingEnabled("navigation", false);
|
||||
Services.telemetry.canRecordExtended = oldCanRecord;
|
||||
});
|
||||
});
|
||||
|
@ -101,18 +97,6 @@ add_task(async function test_context_menu() {
|
|||
1
|
||||
);
|
||||
|
||||
// Also check events.
|
||||
TelemetryTestUtils.assertEvents(
|
||||
[
|
||||
{
|
||||
object: "contextmenu",
|
||||
value: null,
|
||||
extra: { engine: "other-MozSearch" },
|
||||
},
|
||||
],
|
||||
{ category: "navigation", method: "search" }
|
||||
);
|
||||
|
||||
contextMenu.hidePopup();
|
||||
BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
|
@ -174,18 +158,6 @@ add_task(async function test_about_newtab() {
|
|||
1
|
||||
);
|
||||
|
||||
// Also check events.
|
||||
TelemetryTestUtils.assertEvents(
|
||||
[
|
||||
{
|
||||
object: "about_newtab",
|
||||
value: "enter",
|
||||
extra: { engine: "other-MozSearch" },
|
||||
},
|
||||
],
|
||||
{ category: "navigation", method: "search" }
|
||||
);
|
||||
|
||||
// Also also check Glean events.
|
||||
const record = Glean.newtabSearch.issued.testGetValue();
|
||||
Assert.ok(!!record, "Must have recorded a search issuance");
|
||||
|
|
|
@ -78,12 +78,8 @@ add_setup(async function () {
|
|||
let oldCanRecord = Services.telemetry.canRecordExtended;
|
||||
Services.telemetry.canRecordExtended = true;
|
||||
|
||||
// Enable event recording for the events tested here.
|
||||
Services.telemetry.setEventRecordingEnabled("navigation", true);
|
||||
|
||||
registerCleanupFunction(async function () {
|
||||
Services.telemetry.canRecordExtended = oldCanRecord;
|
||||
Services.telemetry.setEventRecordingEnabled("navigation", false);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -129,18 +125,6 @@ add_task(async function test_plainQuery() {
|
|||
1
|
||||
);
|
||||
|
||||
// Also check events.
|
||||
TelemetryTestUtils.assertEvents(
|
||||
[
|
||||
{
|
||||
object: "searchbar",
|
||||
value: "enter",
|
||||
extra: { engine: "other-MozSearch" },
|
||||
},
|
||||
],
|
||||
{ category: "navigation", method: "search" }
|
||||
);
|
||||
|
||||
// Check the histograms as well.
|
||||
let resultMethods = resultMethodHist.snapshot();
|
||||
checkHistogramResults(
|
||||
|
@ -199,18 +183,6 @@ add_task(async function test_oneOff_enter() {
|
|||
1
|
||||
);
|
||||
|
||||
// Also check events.
|
||||
TelemetryTestUtils.assertEvents(
|
||||
[
|
||||
{
|
||||
object: "searchbar",
|
||||
value: "oneoff",
|
||||
extra: { engine: "other-MozSearch2" },
|
||||
},
|
||||
],
|
||||
{ category: "navigation", method: "search" }
|
||||
);
|
||||
|
||||
// Check the histograms as well.
|
||||
let resultMethods = resultMethodHist.snapshot();
|
||||
checkHistogramResults(
|
||||
|
@ -351,18 +323,6 @@ async function checkSuggestionClick(clickOptions, waitForActionFn) {
|
|||
1
|
||||
);
|
||||
|
||||
// Also check events.
|
||||
TelemetryTestUtils.assertEvents(
|
||||
[
|
||||
{
|
||||
object: "searchbar",
|
||||
value: "suggestion",
|
||||
extra: { engine: searchEngineId },
|
||||
},
|
||||
],
|
||||
{ category: "navigation", method: "search" }
|
||||
);
|
||||
|
||||
// Check the histograms as well.
|
||||
let resultMethods = resultMethodHist.snapshot();
|
||||
checkHistogramResults(
|
||||
|
|
|
@ -113,9 +113,6 @@ add_setup(async function () {
|
|||
let oldCanRecord = Services.telemetry.canRecordExtended;
|
||||
Services.telemetry.canRecordExtended = true;
|
||||
|
||||
// Enable event recording for the events tested here.
|
||||
Services.telemetry.setEventRecordingEnabled("navigation", true);
|
||||
|
||||
// Clear history so that history added by previous tests doesn't mess up this
|
||||
// test when it selects results in the urlbar.
|
||||
await PlacesUtils.history.clear();
|
||||
|
@ -137,7 +134,6 @@ add_setup(async function () {
|
|||
Services.prefs.setBoolPref(SUGGEST_URLBAR_PREF, suggestionsEnabled);
|
||||
await PlacesUtils.history.clear();
|
||||
await UrlbarTestUtils.formHistory.clear();
|
||||
Services.telemetry.setEventRecordingEnabled("navigation", false);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -189,20 +185,6 @@ add_task(async function test_simpleQuery() {
|
|||
undefined
|
||||
);
|
||||
|
||||
// Also check events.
|
||||
TelemetryTestUtils.assertEvents(
|
||||
[
|
||||
[
|
||||
"navigation",
|
||||
"search",
|
||||
"urlbar",
|
||||
"enter",
|
||||
{ engine: "other-MozSearch" },
|
||||
],
|
||||
],
|
||||
{ category: "navigation", method: "search" }
|
||||
);
|
||||
|
||||
TelemetryTestUtils.assertHistogram(
|
||||
resultMethodHist,
|
||||
UrlbarTestUtils.SELECTED_RESULT_METHODS.enter,
|
||||
|
@ -245,20 +227,6 @@ add_task(async function test_searchMode_enter() {
|
|||
"This search must only increment one entry in the scalar."
|
||||
);
|
||||
|
||||
// Also check events.
|
||||
TelemetryTestUtils.assertEvents(
|
||||
[
|
||||
[
|
||||
"navigation",
|
||||
"search",
|
||||
"urlbar_searchmode",
|
||||
"enter",
|
||||
{ engine: "other-MozSearch" },
|
||||
],
|
||||
],
|
||||
{ category: "navigation", method: "search" }
|
||||
);
|
||||
|
||||
TelemetryTestUtils.assertHistogram(
|
||||
resultMethodHist,
|
||||
UrlbarTestUtils.SELECTED_RESULT_METHODS.enter,
|
||||
|
@ -333,20 +301,6 @@ add_task(async function test_oneOff_enter() {
|
|||
undefined
|
||||
);
|
||||
|
||||
// Also check events.
|
||||
TelemetryTestUtils.assertEvents(
|
||||
[
|
||||
[
|
||||
"navigation",
|
||||
"search",
|
||||
"urlbar_searchmode",
|
||||
"enter",
|
||||
{ engine: "other-MozSearch" },
|
||||
],
|
||||
],
|
||||
{ category: "navigation", method: "search" }
|
||||
);
|
||||
|
||||
TelemetryTestUtils.assertHistogram(
|
||||
resultMethodHist,
|
||||
UrlbarTestUtils.SELECTED_RESULT_METHODS.enter,
|
||||
|
@ -505,20 +459,6 @@ add_task(async function test_suggestion_click() {
|
|||
1
|
||||
);
|
||||
|
||||
// Also check events.
|
||||
TelemetryTestUtils.assertEvents(
|
||||
[
|
||||
[
|
||||
"navigation",
|
||||
"search",
|
||||
"urlbar",
|
||||
"suggestion",
|
||||
{ engine: searchEngineId },
|
||||
],
|
||||
],
|
||||
{ category: "navigation", method: "search" }
|
||||
);
|
||||
|
||||
TelemetryTestUtils.assertHistogram(
|
||||
resultMethodHist,
|
||||
UrlbarTestUtils.SELECTED_RESULT_METHODS.click,
|
||||
|
@ -676,20 +616,6 @@ add_task(async function test_searchmode_suggestion_click() {
|
|||
1
|
||||
);
|
||||
|
||||
// Also check events.
|
||||
TelemetryTestUtils.assertEvents(
|
||||
[
|
||||
[
|
||||
"navigation",
|
||||
"search",
|
||||
"urlbar_searchmode",
|
||||
"suggestion",
|
||||
{ engine: searchEngineId },
|
||||
],
|
||||
],
|
||||
{ category: "navigation", method: "search" }
|
||||
);
|
||||
|
||||
TelemetryTestUtils.assertHistogram(
|
||||
resultMethodHist,
|
||||
UrlbarTestUtils.SELECTED_RESULT_METHODS.click,
|
||||
|
@ -858,20 +784,6 @@ add_task(async function test_formHistory_click() {
|
|||
1
|
||||
);
|
||||
|
||||
// Also check events.
|
||||
TelemetryTestUtils.assertEvents(
|
||||
[
|
||||
[
|
||||
"navigation",
|
||||
"search",
|
||||
"urlbar",
|
||||
"formhistory",
|
||||
{ engine: searchEngineId },
|
||||
],
|
||||
],
|
||||
{ category: "navigation", method: "search" }
|
||||
);
|
||||
|
||||
TelemetryTestUtils.assertHistogram(
|
||||
resultMethodHist,
|
||||
UrlbarTestUtils.SELECTED_RESULT_METHODS.click,
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/**
|
||||
* This file tests browser.engagement.navigation.urlbar_persisted and the
|
||||
* event navigation.search.urlbar_persisted
|
||||
* This file tests browser.engagement.navigation.urlbar_persisted.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
@ -111,25 +110,6 @@ function assertScalarDoesNotExist(scalar) {
|
|||
Assert.ok(!(scalar in scalars), scalar + " must not be recorded.");
|
||||
}
|
||||
|
||||
function assertTelemetryEvents() {
|
||||
TelemetryTestUtils.assertEvents(
|
||||
[
|
||||
["navigation", "search", "urlbar", "enter", { engine: "Example" }],
|
||||
[
|
||||
"navigation",
|
||||
"search",
|
||||
"urlbar_persisted",
|
||||
"enter",
|
||||
{ engine: "Example" },
|
||||
],
|
||||
],
|
||||
{
|
||||
category: "navigation",
|
||||
method: "search",
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// A user making a search after making a search should result
|
||||
// in the telemetry being recorded.
|
||||
add_task(async function search_after_search() {
|
||||
|
@ -155,9 +135,6 @@ add_task(async function search_after_search() {
|
|||
1
|
||||
);
|
||||
|
||||
// Check events.
|
||||
assertTelemetryEvents();
|
||||
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
||||
|
@ -184,9 +161,6 @@ add_task(async function switch_to_tab_and_search() {
|
|||
1
|
||||
);
|
||||
|
||||
// Check events.
|
||||
assertTelemetryEvents();
|
||||
|
||||
BrowserTestUtils.removeTab(tab1);
|
||||
BrowserTestUtils.removeTab(tab2);
|
||||
});
|
||||
|
@ -213,9 +187,6 @@ add_task(async function handle_revert() {
|
|||
1
|
||||
);
|
||||
|
||||
// Check events.
|
||||
assertTelemetryEvents();
|
||||
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
||||
|
@ -250,8 +221,5 @@ add_task(async function back_and_forth() {
|
|||
1
|
||||
);
|
||||
|
||||
// Check events.
|
||||
assertTelemetryEvents();
|
||||
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
|
|
@ -667,29 +667,6 @@ homepage:
|
|||
extra_keys:
|
||||
webExtensionId: The identifier of the webextension, if known.
|
||||
|
||||
navigation:
|
||||
search:
|
||||
objects: ["about_home", "about_newtab", "contextmenu", "oneoff",
|
||||
"suggestion", "alias", "enter", "searchbar", "urlbar",
|
||||
"urlbar_handoff", "urlbar_persisted", "urlbar_searchmode",
|
||||
"webextension"]
|
||||
release_channel_collection: opt-out
|
||||
products:
|
||||
- "firefox"
|
||||
- "fennec"
|
||||
record_in_processes: ["main"]
|
||||
description: >
|
||||
This is recorded on each search navigation.
|
||||
The value field records the action used to trigger the search:
|
||||
"enter", "oneoff", "suggestion", "alias", null (for contextmenu and webextension)
|
||||
bug_numbers: [1316281, 1496764]
|
||||
notification_emails:
|
||||
- "mdeboer@mozilla.com"
|
||||
- "rharter@mozilla.com"
|
||||
expiry_version: never
|
||||
extra_keys:
|
||||
engine: The id of the search engine used.
|
||||
|
||||
upgrade_dialog:
|
||||
trigger:
|
||||
objects: ["reason"]
|
||||
|
|
Загрузка…
Ссылка в новой задаче