Bug 1744591 - Stop collecting telemetry for hidden browser.link.open_newwindow.restriction preference usage. r=chutten

Differential Revision: https://phabricator.services.mozilla.com/D133010
This commit is contained in:
Tooru Fujisawa 2021-12-09 07:58:19 +00:00
Родитель c0c05e2936
Коммит c20aaa3bd9
4 изменённых файлов: 0 добавлений и 84 удалений

Просмотреть файл

@ -17,8 +17,6 @@ const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
Cu.importGlobalProperties(["Glean"]);
XPCOMUtils.defineLazyModuleGetters(this, {
AboutNewTab: "resource:///modules/AboutNewTab.jsm",
ActorManagerParent: "resource://gre/modules/ActorManagerParent.jsm",
@ -1097,8 +1095,6 @@ BrowserGlue.prototype = {
}
} else if (data == "add-breaches-sync-handler") {
this._addBreachesSyncHandler();
} else if (data == "new-window-restriction-telemetry") {
this._collectNewWindowRestrictionTelemetry();
}
break;
case "initial-migration-will-import-default-bookmarks":
@ -2698,12 +2694,6 @@ BrowserGlue.prototype = {
},
},
{
task: () => {
this._collectNewWindowRestrictionTelemetry();
},
},
// WebDriver components (Remote Agent and Marionette) need to be
// initialized as very last step.
{
@ -4532,14 +4522,6 @@ BrowserGlue.prototype = {
}
},
_collectNewWindowRestrictionTelemetry() {
let restrictionPref = Services.prefs.getIntPref(
"browser.link.open_newwindow.restriction",
2
);
Glean.browserLink.openNewwindowRestriction.set(restrictionPref);
},
QueryInterface: ChromeUtils.generateQI([
"nsIObserver",
"nsISupportsWeakReference",

Просмотреть файл

@ -4,18 +4,3 @@
---
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
browser.link:
open_newwindow_restriction:
type: quantity
description: >
browser.link.open_newwindow.restriction preference value, that is one of
0, 1, or 2, where 2 is desktop default
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1740063
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1740063#c6
notification_emails:
- tfujisawa.birchill@mozilla.com
expires: "97"
unit: "-"

Просмотреть файл

@ -1,49 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const gBrowserGlue = Cc["@mozilla.org/browser/browserglue;1"].getService(
Ci.nsIObserver
);
Cu.importGlobalProperties(["Glean"]);
const RESTRICTION_PREF = "browser.link.open_newwindow.restriction";
function collectTelemetry() {
gBrowserGlue.observe(
null,
"browser-glue-test",
"new-window-restriction-telemetry"
);
}
add_task(async function() {
Services.fog.initializeFOG();
Services.prefs.setIntPref(RESTRICTION_PREF, 0);
collectTelemetry();
Assert.equal(Glean.browserLink.openNewwindowRestriction.testGetValue(), 0);
Services.prefs.setIntPref(RESTRICTION_PREF, 1);
collectTelemetry();
Assert.equal(Glean.browserLink.openNewwindowRestriction.testGetValue(), 1);
Services.prefs.setIntPref(RESTRICTION_PREF, 2);
collectTelemetry();
Assert.equal(Glean.browserLink.openNewwindowRestriction.testGetValue(), 2);
// Test 0 again to verify that 0 above wasn't garbage data, and also as a
// preparetion for the next default pref test.
Services.prefs.setIntPref(RESTRICTION_PREF, 0);
collectTelemetry();
Assert.equal(Glean.browserLink.openNewwindowRestriction.testGetValue(), 0);
Services.prefs.clearUserPref(RESTRICTION_PREF);
collectTelemetry();
Assert.equal(Glean.browserLink.openNewwindowRestriction.testGetValue(), 2);
});
registerCleanupFunction(function() {
Services.prefs.clearUserPref(RESTRICTION_PREF);
});

Просмотреть файл

@ -11,5 +11,3 @@ support-files =
[test_distribution_cachedexistence.js]
[test_browserGlue_migration_no_errors.js]
[test_browserGlue_migration_social_cleanup.js]
[test_browserGlue_newwindow_restriction_telemetry.js]
skip-if = true #Bug 1744591