Bug 1224305 - Add an option to the mochitest harness to provide a copy of the extra chrome manifest it writes. r=ahal

This commit is contained in:
Chris Manchester 2015-11-13 16:14:40 -08:00
parent 2a6a9f4abe
commit 384b3737c7
2 changed files with 16 additions and 0 deletions

View File

@ -394,6 +394,13 @@ class MochitestArguments(ArgumentContainer):
"default": False,
"help": "Run tests with electrolysis preferences and test filtering enabled.",
}],
[["--store-chrome-manifest"],
{"action": "store",
"help": "Destination path to write a copy of any chrome manifest "
"written by the harness.",
"default": None,
"suppress": True,
}],
[["--strict-content-sandbox"],
{"action": "store_true",
"default": False,
@ -669,6 +676,13 @@ class MochitestArguments(ArgumentContainer):
parser.error(
"--debugger-args requires --debugger.")
if options.store_chrome_manifest:
options.store_chrome_manifest = os.path.abspath(options.store_chrome_manifest)
if not os.path.isdir(os.path.dirname(options.store_chrome_manifest)):
parser.error(
"directory for %s does not exist as a destination to copy a "
"chrome manifest." % options.store_chrome_manifest)
if options.testingModulesDir is None:
if build_obj:
options.testingModulesDir = os.path.join(

View File

@ -905,6 +905,8 @@ class MochitestUtilsMixin(object):
if options.testingModulesDir is not None:
manifestFile.write("resource testing-common file:///%s\n" %
options.testingModulesDir)
if options.store_chrome_manifest:
shutil.copyfile(manifest, options.store_chrome_manifest)
return manifest
def addChromeToProfile(self, options):