summaryrefslogtreecommitdiffstats
path: root/dom/media/test/external/mach_commands.py
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/media/test/external/mach_commands.py
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/media/test/external/mach_commands.py')
-rw-r--r--dom/media/test/external/mach_commands.py74
1 files changed, 74 insertions, 0 deletions
diff --git a/dom/media/test/external/mach_commands.py b/dom/media/test/external/mach_commands.py
new file mode 100644
index 000000000..e309f3c55
--- /dev/null
+++ b/dom/media/test/external/mach_commands.py
@@ -0,0 +1,74 @@
+# 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/.
+
+from __future__ import absolute_import, unicode_literals
+
+import os
+import sys
+
+from mozbuild.base import (
+ MachCommandBase,
+ MachCommandConditions as conditions,
+)
+
+from mach.decorators import (
+ CommandProvider,
+ Command,
+)
+
+def setup_argument_parser():
+ from external_media_harness.runtests import MediaTestArguments
+ from mozlog.structured import commandline
+ parser = MediaTestArguments()
+ commandline.add_logging_group(parser)
+ return parser
+
+
+def run_external_media_test(tests, testtype=None, topsrcdir=None, **kwargs):
+ from external_media_harness.runtests import (
+ FirefoxMediaHarness,
+ MediaTestArguments,
+ MediaTestRunner,
+ mn_cli,
+ )
+
+ from mozlog.structured import commandline
+
+ from argparse import Namespace
+
+ parser = setup_argument_parser()
+
+ if not tests:
+ tests = [os.path.join(topsrcdir,
+ 'dom/media/test/external/external_media_tests/manifest.ini')]
+
+ args = Namespace(tests=tests)
+
+ for k, v in kwargs.iteritems():
+ setattr(args, k, v)
+
+ parser.verify_usage(args)
+
+ args.logger = commandline.setup_logging("Firefox External Media Tests",
+ args,
+ {"mach": sys.stdout})
+ failed = mn_cli(MediaTestRunner, MediaTestArguments, FirefoxMediaHarness,
+ args=vars(args))
+
+ if failed > 0:
+ return 1
+ else:
+ return 0
+
+
+@CommandProvider
+class MachCommands(MachCommandBase):
+ @Command('external-media-tests', category='testing',
+ description='Run Firefox external media tests.',
+ conditions=[conditions.is_firefox],
+ parser=setup_argument_parser,
+ )
+ def run_external_media_test(self, tests, **kwargs):
+ kwargs['binary'] = kwargs['binary'] or self.get_binary_path('app')
+ return run_external_media_test(tests, topsrcdir=self.topsrcdir, **kwargs)