Пример #1
0
    def run_desktop_test(self, **kwargs):
        """Runs a reftest, in desktop Firefox."""
        import runreftest

        args = Namespace(**kwargs)
        if args.suite not in ("reftest", "crashtest", "jstestbrowser"):
            raise Exception("None or unrecognized reftest suite type.")

        default_manifest = {
            "reftest": (self.topsrcdir, "layout", "reftests", "reftest.list"),
            "crashtest": (self.topsrcdir, "testing", "crashtest", "crashtests.list"),
            "jstestbrowser": (self.topobjdir, "dist", "test-stage", "jsreftest", "tests", "jstests.list"),
        }

        args.extraProfileFiles.append(os.path.join(self.topobjdir, "dist", "plugins"))
        args.symbolsPath = os.path.join(self.topobjdir, "crashreporter-symbols")

        if not args.tests:
            args.tests = [os.path.join(*default_manifest[args.suite])]

        if args.suite == "jstestbrowser":
            args.extraProfileFiles.append(
                os.path.join(self.topobjdir, "dist", "test-stage", "jsreftest", "tests", "user.js")
            )

        self.log_manager.enable_unstructured()
        try:
            rv = runreftest.run_test_harness(parser, args)
        finally:
            self.log_manager.disable_unstructured()

        return rv
def run_reftest_desktop(context, args):
    from runreftest import run_test_harness

    args.app = args.app or context.firefox_bin
    args.extraProfileFiles.append(os.path.join(context.bin_dir, 'plugins'))
    args.utilityPath = context.bin_dir

    return run_test_harness(parser, args)
def run_reftest(context, **kwargs):
    kwargs['certPath'] = context.certs_dir
    kwargs['utilityPath'] = context.bin_dir
    kwargs['extraProfileFiles'].append(os.path.join(context.bin_dir, 'plugins'))

    if not kwargs['app']:
        # This could still return None in which case --appname must be used
        # to specify the firefox binary.
        kwargs['app'] = context.find_firefox()

    if not kwargs['tests']:
        kwargs['tests'] = [os.path.join('layout', 'reftests', 'reftest.list')]

    test_root = os.path.join(context.package_root, 'reftest', 'tests')
    normalize = partial(context.normalize_test_path, test_root)
    kwargs['tests'] = map(normalize, kwargs['tests'])

    from runreftest import run as run_test_harness
    return run_test_harness(**kwargs)
def run_reftest_android(context, args):
    from remotereftest import run_test_harness

    args.app = args.app or 'org.mozilla.fennec'
    args.utilityPath = context.hostutils
    args.xrePath = context.hostutils
    args.httpdPath = context.module_dir
    args.dm_trans = 'adb'
    args.ignoreWindowSize = True
    args.printDeviceInfo = False

    config = context.mozharness_config
    if config:
        args.remoteWebServer = config['remote_webserver']
        args.httpPort = config['emulator']['http_port']
        args.sslPort = config['emulator']['ssl_port']
        args.adb_path = config['exes']['adb'] % {'abs_work_dir': context.mozharness_workdir}

    return run_test_harness(parser, args)