commit e159c0550b7654ae65c8f60399c3d0fbbdb67335
parent d0fb1815d612e78f98590e321ad98119fc311437
Author: Alex Franchuk <afranchuk@mozilla.com>
Date: Fri, 12 Dec 2025 16:53:08 +0000
Bug 1950866 - Enable crash reports on demand r=gsvelto
This removes the Nightly-only restriction on crash reports on-demand.
There was no strong reason to do that in the first place, aside from it
being a large change.
Differential Revision: https://phabricator.services.mozilla.com/D275677
Diffstat:
4 files changed, 48 insertions(+), 77 deletions(-)
diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml
@@ -1425,7 +1425,7 @@
# Control whether we enable the feature of crash pull at all
- name: browser.crashReports.crashPull
type: bool
- value: @IS_NIGHTLY_BUILD@
+ value: true
mirror: always
# Should we prompt the user to send targeted crash report requested by devs?
diff --git a/toolkit/components/crashes/tests/xpcshell/test_remote_settings_crash_pull.js b/toolkit/components/crashes/tests/xpcshell/test_remote_settings_crash_pull.js
@@ -457,6 +457,53 @@ add_task(
}
);
+add_task(function test_pref_disabled() {
+ const originalPref = Services.prefs.getBoolPref(
+ "browser.crashReports.crashPull"
+ );
+ Services.prefs.setBoolPref("browser.crashReports.crashPull", false);
+
+ const originalCollection = RemoteSettingsCrashPull.collection;
+ let collectionCalled = false;
+ RemoteSettingsCrashPull.collection = function () {
+ console.debug("Calling collection()");
+ collectionCalled = true;
+ };
+
+ RemoteSettingsCrashPull.start();
+
+ Assert.ok(RemoteSettingsCrashPull, "RemoteSettingsCrashPull obtained.");
+ Assert.ok(
+ !collectionCalled,
+ "Method collection() should not have been called"
+ );
+
+ RemoteSettingsCrashPull.collection = originalCollection;
+ Services.prefs.setBoolPref("browser.crashReports.crashPull", originalPref);
+});
+
+add_task(function test_pref_enabled() {
+ const originalPref = Services.prefs.getBoolPref(
+ "browser.crashReports.crashPull"
+ );
+ Services.prefs.setBoolPref("browser.crashReports.crashPull", true);
+
+ const originalCollection = RemoteSettingsCrashPull.collection;
+ let collectionCalled = false;
+ RemoteSettingsCrashPull.collection = function () {
+ console.debug("Calling collection()");
+ collectionCalled = true;
+ };
+
+ RemoteSettingsCrashPull.start();
+
+ Assert.ok(RemoteSettingsCrashPull, "RemoteSettingsCrashPull obtained.");
+ Assert.ok(collectionCalled, "Method collection() should have been called");
+
+ RemoteSettingsCrashPull.collection = originalCollection;
+ Services.prefs.setBoolPref("browser.crashReports.crashPull", originalPref);
+});
+
add_task(function teardown_test() {
cleanup_fake_appdir();
});
diff --git a/toolkit/components/crashes/tests/xpcshell/test_remote_settings_crash_pull_nightly.js b/toolkit/components/crashes/tests/xpcshell/test_remote_settings_crash_pull_nightly.js
@@ -1,74 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-const { AppConstants } = ChromeUtils.importESModule(
- "resource://gre/modules/AppConstants.sys.mjs"
-);
-
-const { RemoteSettingsCrashPull } = ChromeUtils.importESModule(
- "resource://gre/modules/RemoteSettingsCrashPull.sys.mjs"
-);
-
-add_setup(async function setup_test() {
- do_get_profile();
-});
-
-add_task(function test_pref_value() {
- const prefValue = Services.prefs.getBoolPref(
- "browser.crashReports.crashPull"
- );
- if (AppConstants.NIGHTLY_BUILD) {
- Assert.ok(prefValue, "RemoteSettingsCrashPull pref enabled on nightly");
- } else {
- Assert.ok(!prefValue, "RemoteSettingsCrashPull pref disabled on nightly");
- }
-});
-
-add_task(function test_pref_disabled() {
- const originalPref = Services.prefs.getBoolPref(
- "browser.crashReports.crashPull"
- );
- Services.prefs.setBoolPref("browser.crashReports.crashPull", false);
-
- const originalCollection = RemoteSettingsCrashPull.collection;
- let collectionCalled = false;
- RemoteSettingsCrashPull.collection = function () {
- console.debug("Calling collection()");
- collectionCalled = true;
- };
-
- RemoteSettingsCrashPull.start();
-
- Assert.ok(RemoteSettingsCrashPull, "RemoteSettingsCrashPull obtained.");
- Assert.ok(
- !collectionCalled,
- "Method collection() should not have been called"
- );
-
- RemoteSettingsCrashPull.collection = originalCollection;
- Services.prefs.setBoolPref("browser.crashReports.crashPull", originalPref);
-});
-
-add_task(function test_pref_enabled() {
- const originalPref = Services.prefs.getBoolPref(
- "browser.crashReports.crashPull"
- );
- Services.prefs.setBoolPref("browser.crashReports.crashPull", true);
-
- const originalCollection = RemoteSettingsCrashPull.collection;
- let collectionCalled = false;
- RemoteSettingsCrashPull.collection = function () {
- console.debug("Calling collection()");
- collectionCalled = true;
- };
-
- RemoteSettingsCrashPull.start();
-
- Assert.ok(RemoteSettingsCrashPull, "RemoteSettingsCrashPull obtained.");
- Assert.ok(collectionCalled, "Method collection() should have been called");
-
- RemoteSettingsCrashPull.collection = originalCollection;
- Services.prefs.setBoolPref("browser.crashReports.crashPull", originalPref);
-});
diff --git a/toolkit/components/crashes/tests/xpcshell/xpcshell.toml b/toolkit/components/crashes/tests/xpcshell/xpcshell.toml
@@ -22,5 +22,3 @@ skip-if = [
["test_remote_settings_crash_pull.js"]
support-files = ["../../../../../toolkit/crashreporter/test/browser/head.js"]
-
-["test_remote_settings_crash_pull_nightly.js"]