diff --git a/testing/mochitest/mach_commands.py b/testing/mochitest/mach_commands.py index 3de801a8f047..3aa7304ac02a 100644 --- a/testing/mochitest/mach_commands.py +++ b/testing/mochitest/mach_commands.py @@ -243,6 +243,7 @@ class MochitestRunner(MozbuildObject): start_at=None, end_at=None, e10s=False, + enable_cpow_warnings=False, strict_content_sandbox=False, nested_oop=False, dmd=False, @@ -383,6 +384,7 @@ class MochitestRunner(MozbuildObject): options.startAt = start_at options.endAt = end_at options.e10s = e10s + options.enableCPOWWarnings = enable_cpow_warnings options.strictContentSandbox = strict_content_sandbox options.nested_oop = nested_oop options.dumpAboutMemoryAfterTest = dump_about_memory_after_test @@ -623,6 +625,11 @@ def add_mochitest_general_args(parser): action='store_true', help='Run tests with electrolysis preferences and test filtering enabled.') + parser.add_argument( + '--enable-cpow-warnings', + action='store_true', + help='Run tests with unsafe CPOW usage warnings enabled.') + parser.add_argument( '--strict-content-sandbox', action='store_true', diff --git a/testing/mochitest/mochitest_options.py b/testing/mochitest/mochitest_options.py index fb6d743a5924..b2318fcd0dd5 100644 --- a/testing/mochitest/mochitest_options.py +++ b/testing/mochitest/mochitest_options.py @@ -440,6 +440,11 @@ class MochitestOptions(ArgumentParser): "used multiple times in which case the test must contain " "at least one of the given tags.", }], + [["--enable-cpow-warnings"], + {"action": "store_true", + "dest": "enableCPOWWarnings", + "help": "enable logging of unsafe CPOW usage, which is disabled by default for tests", + }], ] def __init__(self, **kwargs): diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py index dc183ae649b6..922c1f461d98 100644 --- a/testing/mochitest/runtests.py +++ b/testing/mochitest/runtests.py @@ -1519,6 +1519,11 @@ class Mochitest(MochitestUtilsMixin): if debugger and not options.slowscript: browserEnv["JS_DISABLE_SLOW_SCRIPT_SIGNALS"] = "1" + # For e10s, our tests default to suppressing the "unsafe CPOW usage" + # warnings that can plague test logs. + if not options.enableCPOWWarnings: + browserEnv["DISABLE_UNSAFE_CPOW_WARNINGS"] = "1" + return browserEnv def cleanup(self, options):