зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
c0c05e2936
Коммит
c20aaa3bd9
|
@ -17,8 +17,6 @@ const { AppConstants } = ChromeUtils.import(
|
||||||
"resource://gre/modules/AppConstants.jsm"
|
"resource://gre/modules/AppConstants.jsm"
|
||||||
);
|
);
|
||||||
|
|
||||||
Cu.importGlobalProperties(["Glean"]);
|
|
||||||
|
|
||||||
XPCOMUtils.defineLazyModuleGetters(this, {
|
XPCOMUtils.defineLazyModuleGetters(this, {
|
||||||
AboutNewTab: "resource:///modules/AboutNewTab.jsm",
|
AboutNewTab: "resource:///modules/AboutNewTab.jsm",
|
||||||
ActorManagerParent: "resource://gre/modules/ActorManagerParent.jsm",
|
ActorManagerParent: "resource://gre/modules/ActorManagerParent.jsm",
|
||||||
|
@ -1097,8 +1095,6 @@ BrowserGlue.prototype = {
|
||||||
}
|
}
|
||||||
} else if (data == "add-breaches-sync-handler") {
|
} else if (data == "add-breaches-sync-handler") {
|
||||||
this._addBreachesSyncHandler();
|
this._addBreachesSyncHandler();
|
||||||
} else if (data == "new-window-restriction-telemetry") {
|
|
||||||
this._collectNewWindowRestrictionTelemetry();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "initial-migration-will-import-default-bookmarks":
|
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
|
// WebDriver components (Remote Agent and Marionette) need to be
|
||||||
// initialized as very last step.
|
// 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([
|
QueryInterface: ChromeUtils.generateQI([
|
||||||
"nsIObserver",
|
"nsIObserver",
|
||||||
"nsISupportsWeakReference",
|
"nsISupportsWeakReference",
|
||||||
|
|
|
@ -4,18 +4,3 @@
|
||||||
|
|
||||||
---
|
---
|
||||||
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
|
$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_distribution_cachedexistence.js]
|
||||||
[test_browserGlue_migration_no_errors.js]
|
[test_browserGlue_migration_no_errors.js]
|
||||||
[test_browserGlue_migration_social_cleanup.js]
|
[test_browserGlue_migration_social_cleanup.js]
|
||||||
[test_browserGlue_newwindow_restriction_telemetry.js]
|
|
||||||
skip-if = true #Bug 1744591
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче