Files
sousa-gecko/testing/modules/moz.build
T
Florian Quèze e2c13d3f0e Bug 2047562 - Save a profile instead of crashing when a fatal test-only condition is hit during a profiled run, r=ahal,profiler-reviewers,necko-reviewers,sergesanspaille,jesup,dcarver.
When the profiler is running during a test, hitting a MOZ_CRASH-style guard
aborts the process before the profile can be saved, losing the data that would
help diagnose the failure (for example a race leading to an unexpected
non-local connection).

Add MOZ_DUMP_PROFILE_OR_CRASH_UNSAFE, which in a profiled run notifies the
"profiler-dump-and-quit" topic so the test harness saves a profile and ends the
process with an unmissable failure, and otherwise crashes as before. Use it for
the non-local connection guard in nsHttpChannel::OnStartRequest.

The mochitest and xpcshell harnesses register the observer and share a single
TestProfilerArtifact module for writing the profile artifact, replacing the
upload code that was previously duplicated between them.

Differential Revision: https://phabricator.services.mozilla.com/D307002
2026-06-23 13:14:05 +00:00

40 lines
1.1 KiB
INI

# 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/.
XPCSHELL_TESTS_MANIFESTS += ["tests/xpcshell/xpcshell.toml"]
BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.toml"]
TESTING_JS_MODULES += [
"AppData.sys.mjs",
"AppInfo.sys.mjs",
"Assert.sys.mjs",
"FileTestUtils.sys.mjs",
"ImageTestUtils.sys.mjs",
"Mochia.js",
"MockRegistrar.sys.mjs",
"sinon-7.2.7.js",
"Sinon.sys.mjs",
"StructuredLog.sys.mjs",
"TestProfilerArtifact.sys.mjs",
"TestUtils.sys.mjs",
"XPCShellContentUtils.sys.mjs",
]
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
TESTING_JS_MODULES += [
"MockRegistry.sys.mjs",
]
TEST_HARNESS_FILES.testing.mochitest.tests.SimpleTest += ["StructuredLog.sys.mjs"]
with Files("**"):
BUG_COMPONENT = ("Testing", "General")
with Files("tests/xpcshell/**"):
BUG_COMPONENT = ("Testing", "XPCShell Harness")
with Files("tests/browser/**"):
BUG_COMPONENT = ("Testing", "General")