Bug 1152864 - Disable unsafe CPOW warnings when running mochitests by default, and add option to re-enable. r=ahal.

--enable-cpow-warnings can now be passed when running a mochitest to re-enable the warnings,
should one wish to do that.

--HG--
extra : rebase_source : 47b51bade91531269a77fec6c2c68fa1b3babf36
This commit is contained in:
Mike Conley 2015-04-10 13:45:22 -04:00
Родитель 63226d2f85
Коммит 8d20846655
3 изменённых файлов: 17 добавлений и 0 удалений

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

@ -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',

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

@ -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):

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

@ -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):