Bug 1103946 Part 1: Change --content-sandbox mach / mochitest option to --strict-content-sandbox. r=jmaher

Also, change tests that are skipped using (contentSandbox != off) to (strictContentSandbox).
This commit is contained in:
Bob Owen 2014-12-10 09:34:03 +00:00
parent 29cc2ddc3a
commit 61edbfb626
6 changed files with 19 additions and 23 deletions

View File

@ -22,7 +22,7 @@
# do ok(true, "Type not supported") and stop the test.
[DEFAULT]
skip-if = buildapp == 'mulet' || (os == 'win' && contentSandbox != 'off') # contentSandbox(Bug 1042735)
skip-if = buildapp == 'mulet' || (os == 'win' && strictContentSandbox) # strictContentSandbox (Bug 1042735)
support-files =
320x240.ogv
320x240.ogv^headers^

View File

@ -1,6 +1,6 @@
[DEFAULT]
# contentSandbox - bug 1042735, Android 2.3 - bug 981881
skip-if = (os == 'win' && contentSandbox != 'off') || android_version == '10'
# strictContentSandbox - bug 1042735, Android 2.3 - bug 981881
skip-if = (os == 'win' && strictContentSandbox) || android_version == '10'
support-files =
head.js
constraints.js

View File

@ -1,5 +1,5 @@
[DEFAULT]
skip-if = ((buildapp == 'mulet' || buildapp == 'b2g') && (toolkit != 'gonk' || debug)) || (os == 'win' && contentSandbox != 'off') #b2g-debug,b2g-desktop(bug 916135); contentSandbox(Bug 1042735)
skip-if = ((buildapp == 'mulet' || buildapp == 'b2g') && (toolkit != 'gonk' || debug)) || (os == 'win' && strictContentSandbox) #b2g-debug,b2g-desktop(bug 916135); strictContentSandbox(Bug 1042735)
support-files =
audio-expected.wav
audio-mono-expected-2.wav

View File

@ -191,7 +191,7 @@ class MochitestRunner(MozbuildObject):
rerun_failures=False, no_autorun=False, repeat=0, run_until_failure=False,
slow=False, chunk_by_dir=0, total_chunks=None, this_chunk=None, extraPrefs=[],
jsdebugger=False, debug_on_failure=False, start_at=None, end_at=None,
e10s=False, content_sandbox='off', dmd=False, dump_output_directory=None,
e10s=False, strict_content_sandbox=False, dmd=False, dump_output_directory=None,
dump_about_memory_after_test=False, dump_dmd_after_test=False,
install_extension=None, quiet=False, environment=[], app_override=None, bisectChunk=None, runByDir=False,
useTestMediaDevices=False, timeout=None, **kwargs):
@ -313,9 +313,7 @@ class MochitestRunner(MozbuildObject):
options.startAt = start_at
options.endAt = end_at
options.e10s = e10s
options.contentSandbox = content_sandbox
if options.contentSandbox != 'off':
options.e10s = True
options.strictContentSandbox = strict_content_sandbox
options.dumpAboutMemoryAfterTest = dump_about_memory_after_test
options.dumpDMDAfterTest = dump_dmd_after_test
options.dumpOutputDirectory = dump_output_directory
@ -502,13 +500,13 @@ def MochitestCommand(func):
help='Start the browser JS debugger before running the test. Implies --no-autorun.')
func = jsdebugger(func)
this_chunk = CommandArgument('--e10s', action='store_true',
e10s = CommandArgument('--e10s', action='store_true',
help='Run tests with electrolysis preferences and test filtering enabled.')
func = this_chunk(func)
func = e10s(func)
this_chunk = CommandArgument('--content-sandbox', default='off', choices=['off', 'warn', 'on'],
help='Run tests with the content sandbox enabled or in warn only mode (Windows only). --e10s is assumed.')
func = this_chunk(func)
strict_content_sandbox = CommandArgument('--strict-content-sandbox', action='store_true',
help='Run tests with a more strict content sandbox (Windows only).')
func = strict_content_sandbox(func)
dmd = CommandArgument('--dmd', action='store_true',
help='Run tests with DMD active.')

View File

@ -363,11 +363,11 @@ class MochitestOptions(optparse.OptionParser):
"dest": "e10s",
"help": "Run tests with electrolysis preferences and test filtering enabled.",
}],
[["--content-sandbox"],
{ "choices": ["off", "warn", "on"],
"default": "off",
"dest": "contentSandbox",
"help": "Run tests with the content sandbox enabled or in warn only mode (Windows only). --e10s is assumed.",
[["--strict-content-sandbox"],
{ "action": "store_true",
"default": False,
"dest": "strictContentSandbox",
"help": "Run tests with a more strict content sandbox (Windows only).",
}],
[["--dmd-path"],
{ "action": "store",
@ -479,11 +479,8 @@ class MochitestOptions(optparse.OptionParser):
def verifyOptions(self, options, mochitest):
""" verify correct options and cleanup paths """
if options.contentSandbox != 'off':
options.e10s = True
mozinfo.update({"e10s": options.e10s}) # for test manifest parsing.
mozinfo.update({"contentSandbox": options.contentSandbox}) # for test manifest parsing.
mozinfo.update({"strictContentSandbox": options.strictContentSandbox}) # for test manifest parsing.
if options.app is None:
if build_obj is not None:

View File

@ -1159,7 +1159,8 @@ class Mochitest(MochitestUtilsMixin):
if options.browserChrome and options.timeout:
options.extraPrefs.append("testing.browserTestHarness.timeout=%d" % options.timeout)
options.extraPrefs.append("browser.tabs.remote.autostart=%s" % ('true' if options.e10s else 'false'))
options.extraPrefs.append("browser.tabs.remote.sandbox=%s" % options.contentSandbox)
if options.strictContentSandbox:
options.extraPrefs.append("security.sandbox.windows.content.moreStrict=true")
# get extensions to install
extensions = self.getExtensionsToInstall(options)