Bug 1680735 - Rename SearchTelemetry to SearchSERPTelemetry. r=daleharvey

Differential Revision: https://phabricator.services.mozilla.com/D98791
This commit is contained in:
Mark Banner 2020-12-08 20:42:15 +00:00
parent 5cf95b6b27
commit 5bfe12a2c4
14 changed files with 40 additions and 39 deletions

View File

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["SearchTelemetryChild", "ADLINK_CHECK_TIMEOUT_MS"];
var EXPORTED_SYMBOLS = ["SearchSERPTelemetryChild", "ADLINK_CHECK_TIMEOUT_MS"];
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
@ -95,7 +95,7 @@ const searchProviders = new SearchProviders();
* page are returned to SearchTelemetry. If no ads are found, no notification is
* given.
*/
class SearchTelemetryChild extends JSWindowActorChild {
class SearchSERPTelemetryChild extends JSWindowActorChild {
/**
* Determines if there is a provider that matches the supplied URL and returns
* the information associated with that provider.

View File

@ -3,18 +3,18 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
var EXPORTED_SYMBOLS = ["SearchTelemetryParent"];
var EXPORTED_SYMBOLS = ["SearchSERPTelemetryParent"];
ChromeUtils.defineModuleGetter(
this,
"SearchTelemetry",
"resource:///modules/SearchTelemetry.jsm"
"SearchSERPTelemetry",
"resource:///modules/SearchSERPTelemetry.jsm"
);
class SearchTelemetryParent extends JSWindowActorParent {
class SearchSERPTelemetryParent extends JSWindowActorParent {
receiveMessage(msg) {
if (msg.name == "SearchTelemetry:PageInfo") {
SearchTelemetry.reportPageWithAds(msg.data);
SearchSERPTelemetry.reportPageWithAds(msg.data);
}
}
}

View File

@ -81,8 +81,8 @@ FINAL_TARGET_FILES.actors += [
"RefreshBlockerParent.jsm",
"RFPHelperChild.jsm",
"RFPHelperParent.jsm",
"SearchTelemetryChild.jsm",
"SearchTelemetryParent.jsm",
"SearchSERPTelemetryChild.jsm",
"SearchSERPTelemetryParent.jsm",
"SwitchDocumentDirectionChild.jsm",
"WebRTCChild.jsm",
"WebRTCParent.jsm",

View File

@ -40,7 +40,7 @@ const known_scripts = {
"resource:///actors/BrowserTabChild.jsm",
"resource:///actors/LinkHandlerChild.jsm",
"resource:///actors/PageStyleChild.jsm",
"resource:///actors/SearchTelemetryChild.jsm",
"resource:///actors/SearchSERPTelemetryChild.jsm",
"resource://gre/modules/Readerable.jsm",
// Telemetry

View File

@ -73,7 +73,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
SafeBrowsing: "resource://gre/modules/SafeBrowsing.jsm",
Sanitizer: "resource:///modules/Sanitizer.jsm",
SaveToPocket: "chrome://pocket/content/SaveToPocket.jsm",
SearchTelemetry: "resource:///modules/SearchTelemetry.jsm",
SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.jsm",
SessionStartup: "resource:///modules/sessionstore/SessionStartup.jsm",
SessionStore: "resource:///modules/sessionstore/SessionStore.jsm",
TabCrashHandler: "resource:///modules/ContentCrashHandlers.jsm",
@ -637,12 +637,12 @@ let JSWINDOWACTORS = {
enablePreference: "accessibility.blockautorefresh",
},
SearchTelemetry: {
SearchSERPTelemetry: {
parent: {
moduleURI: "resource:///actors/SearchTelemetryParent.jsm",
moduleURI: "resource:///actors/SearchSERPTelemetryParent.jsm",
},
child: {
moduleURI: "resource:///actors/SearchTelemetryChild.jsm",
moduleURI: "resource:///actors/SearchSERPTelemetryChild.jsm",
events: {
DOMContentLoaded: {},
pageshow: { mozSystemGroup: true },
@ -2114,7 +2114,7 @@ BrowserGlue.prototype = {
}
BrowserUsageTelemetry.uninit();
SearchTelemetry.uninit();
SearchSERPTelemetry.uninit();
PageThumbs.uninit();
NewTabUtils.uninit();
@ -2309,7 +2309,7 @@ BrowserGlue.prototype = {
this._windowsWereRestored = true;
BrowserUsageTelemetry.init();
SearchTelemetry.init();
SearchSERPTelemetry.init();
ExtensionsUI.init();

View File

@ -4,7 +4,7 @@
"use strict";
var EXPORTED_SYMBOLS = ["SearchTelemetry"];
var EXPORTED_SYMBOLS = ["SearchSERPTelemetry"];
const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
@ -34,8 +34,8 @@ XPCOMUtils.defineLazyGetter(this, "logConsole", () => {
});
/**
* TelemetryHandler is the main class handling search telemetry. It primarily
* deals with tracking of what pages are loaded into tabs.
* TelemetryHandler is the main class handling Search Engine Result Page (SERP)
* telemetry. It primarily deals with tracking of what pages are loaded into tabs.
*
* It handles the *in-content:sap* keys of the SEARCH_COUNTS histogram.
*/
@ -760,4 +760,4 @@ class ContentHandler {
}
}
var SearchTelemetry = new TelemetryHandler();
var SearchSERPTelemetry = new TelemetryHandler();

View File

@ -15,6 +15,8 @@ page.
Search probes relevant to front-end searches
--------------------------------------------
The following probes are all handled by `SearchSERPTelemetry.jsm and the associated parent/child actors`_.
Definitions:
* ``organic`` is a search that a user performs by visiting a search engine
@ -40,3 +42,4 @@ browser.search.ad_clicks
``<provider>:<sap|organic>``.
.. _address bar telemetry: /browser/urlbar/telemetry.html
.. _SearchSERPTelemetry.jsm and the associated parent/child actors: https://searchfox.org/mozilla-central/search?q=&path=SearchSERPTelemetry*.jsm&case=false&regexp=false

View File

@ -7,7 +7,7 @@
EXTRA_JS_MODULES += [
"BrowserSearchTelemetry.jsm",
"SearchOneOffs.jsm",
"SearchTelemetry.jsm",
"SearchSERPTelemetry.jsm",
"SearchUIUtils.jsm",
]

View File

@ -2,16 +2,16 @@
* http://creativecommons.org/publicdomain/zero/1.0/ */
/*
* Main tests for SearchTelemetry - general engine visiting and link clicking.
* Main tests for SearchSERPTelemetry - general engine visiting and link clicking.
*/
"use strict";
const { SearchTelemetry } = ChromeUtils.import(
"resource:///modules/SearchTelemetry.jsm"
const { SearchSERPTelemetry } = ChromeUtils.import(
"resource:///modules/SearchSERPTelemetry.jsm"
);
const { ADLINK_CHECK_TIMEOUT_MS } = ChromeUtils.import(
"resource:///actors/SearchTelemetryChild.jsm"
"resource:///actors/SearchSERPTelemetryChild.jsm"
);
const TEST_PROVIDER_INFO = [
@ -116,7 +116,7 @@ async function waitForIdle() {
}
add_task(async function setup() {
SearchTelemetry.overrideSearchTelemetryForTests(TEST_PROVIDER_INFO);
SearchSERPTelemetry.overrideSearchTelemetryForTests(TEST_PROVIDER_INFO);
await waitForIdle();
// Enable local telemetry recording for the duration of the tests.
let oldCanRecord = Services.telemetry.canRecordExtended;
@ -125,7 +125,7 @@ add_task(async function setup() {
registerCleanupFunction(async () => {
Services.prefs.clearUserPref("browser.search.log");
SearchTelemetry.overrideSearchTelemetryForTests();
SearchSERPTelemetry.overrideSearchTelemetryForTests();
Services.telemetry.canRecordExtended = oldCanRecord;
Services.telemetry.clearScalars();
});

View File

@ -8,7 +8,7 @@ const { XPCOMUtils } = ChromeUtils.import(
XPCOMUtils.defineLazyModuleGetters(this, {
BrowserSearchTelemetry: "resource:///modules/BrowserSearchTelemetry.jsm",
NetUtil: "resource://gre/modules/NetUtil.jsm",
SearchTelemetry: "resource:///modules/SearchTelemetry.jsm",
SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.jsm",
SearchUtils: "resource://gre/modules/SearchUtils.jsm",
Services: "resource://gre/modules/Services.jsm",
sinon: "resource://testing-common/Sinon.jsm",
@ -185,7 +185,7 @@ async function testAdUrlClicked(serpUrl, adUrl, expectedAdKey) {
),
loadUsingSystemPrincipal: true,
});
SearchTelemetry._contentHandler.observeActivity(
SearchSERPTelemetry._contentHandler.observeActivity(
channel,
Ci.nsIHttpActivityObserver.ACTIVITY_TYPE_HTTP_TRANSACTION,
Ci.nsIHttpActivityObserver.ACTIVITY_SUBTYPE_TRANSACTION_CLOSE
@ -212,7 +212,7 @@ async function testAdUrlClicked(serpUrl, adUrl, expectedAdKey) {
add_task(async function setup() {
Services.prefs.setBoolPref(SearchUtils.BROWSER_SEARCH_PREF + "log", true);
await SearchTelemetry.init();
await SearchSERPTelemetry.init();
sinon.stub(BrowserSearchTelemetry, "shouldRecordSearchCount").returns(true);
});
@ -222,7 +222,7 @@ add_task(async function test_parsing_search_urls() {
if (test.setUp) {
test.setUp();
}
SearchTelemetry.updateTrackingStatus(
SearchSERPTelemetry.updateTrackingStatus(
{
getTabBrowser: () => {},
},

View File

@ -15,7 +15,7 @@ const SCALAR_SEARCHMODE = "browser.engagement.navigation.urlbar_searchmode";
const SUGGEST_URLBAR_PREF = "browser.urlbar.suggest.searches";
XPCOMUtils.defineLazyModuleGetters(this, {
SearchTelemetry: "resource:///modules/SearchTelemetry.jsm",
SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.jsm",
UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.jsm",
});
@ -1512,7 +1512,7 @@ add_task(async function test_formHistory_enterSelection() {
add_task(async function test_privateWindow() {
// Override the search telemetry search provider info to
// count in-content SEARCH_COUNTs telemetry for our test engine.
SearchTelemetry.overrideSearchTelemetryForTests([
SearchSERPTelemetry.overrideSearchTelemetryForTests([
{
telemetryId: "example",
searchPageRegexp: "^http://example\\.com/",
@ -1686,6 +1686,6 @@ add_task(async function test_privateWindow() {
await BrowserTestUtils.closeWindow(win);
// Reset the search provider info.
SearchTelemetry.overrideSearchTelemetryForTests();
SearchSERPTelemetry.overrideSearchTelemetryForTests();
await UrlbarTestUtils.formHistory.clear();
});

View File

@ -21,7 +21,6 @@ const SUGGEST_PREF = "browser.search.suggest.enabled";
XPCOMUtils.defineLazyModuleGetters(this, {
AppConstants: "resource://gre/modules/AppConstants.jsm",
SearchTelemetry: "resource:///modules/SearchTelemetry.jsm",
UrlbarProviderTabToSearch:
"resource:///modules/UrlbarProviderTabToSearch.jsm",
UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.jsm",

View File

@ -23,7 +23,7 @@ XPCOMUtils.defineLazyModuleGetters(this, {
CustomizableUI: "resource:///modules/CustomizableUI.jsm",
PageActions: "resource:///modules/PageActions.jsm",
PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
SearchTelemetry: "resource:///modules/SearchTelemetry.jsm",
SearchSERPTelemetry: "resource:///modules/SearchSERPTelemetry.jsm",
Services: "resource://gre/modules/Services.jsm",
setTimeout: "resource://gre/modules/Timer.jsm",
clearTimeout: "resource://gre/modules/Timer.jsm",
@ -249,7 +249,7 @@ let URICountListener = {
onLocationChange(browser, webProgress, request, uri, flags) {
if (!(flags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT)) {
// By default, assume we no longer need to track this tab.
SearchTelemetry.stopTrackingBrowser(browser);
SearchSERPTelemetry.stopTrackingBrowser(browser);
}
// Don't count this URI if it's an error page.
@ -321,7 +321,7 @@ let URICountListener = {
}
if (!(flags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT)) {
SearchTelemetry.updateTrackingStatus(browser, uriSpec);
SearchSERPTelemetry.updateTrackingStatus(browser, uriSpec);
}
// Update total URI count, including when in private mode.

View File

@ -20,7 +20,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
CustomizableUITestUtils:
"resource://testing-common/CustomizableUITestUtils.jsm",
Region: "resource://gre/modules/Region.jsm",
SearchTelemetry: "resource:///modules/SearchTelemetry.jsm",
SearchTestUtils: "resource://testing-common/SearchTestUtils.jsm",
UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.jsm",
HttpServer: "resource://testing-common/httpd.js",