Bug 1316408 - Remove all b2g related code from testing/xpcshell, r=jmaher
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 09 Nov 2016 14:50:45 -0500
changeset 348552 d2192fd7bf45180fce623528e0d81d93a0657b74
parent 348551 f6f28be8d8f25ff7ed865a0e8cfd11e36334e3cc
child 348553 0bc5e1c941a21a32668adae737030887a7865fba
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1316408
milestone52.0a1
Bug 1316408 - Remove all b2g related code from testing/xpcshell, r=jmaher MozReview-Commit-ID: KF5Pw5WBleX
testing/xpcshell/b2g_xpcshell_venv.sh
testing/xpcshell/mach_commands.py
testing/xpcshell/runtestsb2g.py
testing/xpcshell/runxpcshelltests.py
testing/xpcshell/selftest.py
testing/xpcshell/xpcshellcommandline.py
deleted file mode 100644
--- a/testing/xpcshell/b2g_xpcshell_venv.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/bash
-# 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/.
-
-PYTHON=$1
-
-if [ -z "${PYTHON}" ]
-then
-    echo "No python found"
-    exit 1
-fi
-
-if [ -z "${MARIONETTE_HOME}" ]
-then
-    echo "No MARIONETTE_HOME found"
-    exit 1
-fi
-
-if [ -z "${XPCSHELLTEST_HOME}" ]
-then
-    echo "No XPCSHELLTEST_HOME found"
-    exit 1
-fi
-
-echo "Detected Marionette home in $MARIONETTE_HOME"
-
-# If a GECKO_OBJDIR environemnt variable exists, we will create the Python
-# virtual envirnoment there. Otherwise we create it in the PWD.
-VENV_DIR="marionette_venv"
-if [ -z $GECKO_OBJDIR ]
-then
-    VENV_DIR="$MARIONETTE_HOME/$VENV_DIR"
-else
-    VENV_DIR="$GECKO_OBJDIR/$VENV_DIR"
-fi
-
-# Check if environment exists, if not, create a virtualenv:
-if [ -d $VENV_DIR ]
-then
-  echo "Using virtual environment in $VENV_DIR"
-  cd $VENV_DIR
-  . bin/activate
-else
-  echo "Creating a virtual environment in $VENV_DIR"
-  curl https://raw.github.com/pypa/virtualenv/develop/virtualenv.py | ${PYTHON} - $VENV_DIR
-  cd $VENV_DIR
-  . bin/activate
-  # set up mozbase
-  git clone git://github.com/mozilla/mozbase.git
-  cd mozbase
-  python setup_development.py
-fi
-
-# update the marionette_client
-cd $MARIONETTE_HOME
-python setup.py develop
-
-cd $XPCSHELLTEST_HOME
-
-# pop off the python parameter
-shift
-python runtestsb2g.py $@
--- a/testing/xpcshell/mach_commands.py
+++ b/testing/xpcshell/mach_commands.py
@@ -4,54 +4,41 @@
 
 # Integrates the xpcshell test runner with mach.
 
 from __future__ import absolute_import, unicode_literals, print_function
 
 import argparse
 import errno
 import os
-import shutil
 import sys
 
 from mozlog import structured
 
 from mozbuild.base import (
     MachCommandBase,
     MozbuildObject,
     MachCommandConditions as conditions,
 )
 
 from mach.decorators import (
-    CommandArgument,
     CommandProvider,
     Command,
 )
 
-from xpcshellcommandline import parser_desktop, parser_remote, parser_b2g
-
-ADB_NOT_FOUND = '''
-The %s command requires the adb binary to be on your path.
-
-If you have a B2G build, this can be found in
-'%s/out/host/<platform>/bin'.
-'''.lstrip()
-
-BUSYBOX_URLS = {
-    'arm': 'http://www.busybox.net/downloads/binaries/latest/busybox-armv7l',
-    'x86': 'http://www.busybox.net/downloads/binaries/latest/busybox-i686'
-}
+from xpcshellcommandline import parser_desktop, parser_remote
 
 here = os.path.abspath(os.path.dirname(__file__))
 
 if sys.version_info[0] < 3:
     unicode_type = unicode
 else:
     unicode_type = str
 
+
 # This should probably be consolidated with similar classes in other test
 # runners.
 class InvalidTestPathError(Exception):
     """Exception raised when the test path is not valid."""
 
 
 class XPCShellRunner(MozbuildObject):
     """Run xpcshell tests."""
@@ -67,17 +54,16 @@ class XPCShellRunner(MozbuildObject):
             sys.path.append(build_path)
 
         src_build_path = os.path.join(self.topsrcdir, 'mozilla', 'build')
         if os.path.isdir(src_build_path):
             sys.path.append(src_build_path)
 
         return self.run_suite(**kwargs)
 
-
     def _run_xpcshell_harness(self, **kwargs):
         # Obtain a reference to the xpcshell test runner.
         import runxpcshelltests
 
         log = kwargs.pop("log")
 
         xpcshell = runxpcshelltests.XPCShellTests(log=log)
         self.log_manager.enable_unstructured()
@@ -151,16 +137,17 @@ class XPCShellRunner(MozbuildObject):
 
         self.log_manager.disable_unstructured()
 
         if not result and not xpcshell.sequential:
             print("Tests were run in parallel. Try running with --sequential "
                   "to make sure the failures were not caused by this.")
         return int(not result)
 
+
 class AndroidXPCShellRunner(MozbuildObject):
     """Get specified DeviceManager"""
     def get_devicemanager(self, devicemanager, ip, port, remote_test_root):
         import mozdevice
         dm = None
         if devicemanager == "adb":
             if ip:
                 dm = mozdevice.DroidADB(ip, port, packageName=None, deviceRoot=remote_test_root)
@@ -230,128 +217,27 @@ class AndroidXPCShellRunner(MozbuildObje
         result = xpcshell.runTests(testClass=remotexpcshelltests.RemoteXPCShellTestThread,
                                    mobileArgs=xpcshell.mobileArgs,
                                    **vars(options))
 
         self.log_manager.disable_unstructured()
 
         return int(not result)
 
-class B2GXPCShellRunner(MozbuildObject):
-    def __init__(self, *args, **kwargs):
-        MozbuildObject.__init__(self, *args, **kwargs)
-
-        # TODO Bug 794506 remove once mach integrates with virtualenv.
-        build_path = os.path.join(self.topobjdir, 'build')
-        if build_path not in sys.path:
-            sys.path.append(build_path)
-
-        build_path = os.path.join(self.topsrcdir, 'build')
-        if build_path not in sys.path:
-            sys.path.append(build_path)
-
-        self.tests_dir = os.path.join(self.topobjdir, '_tests')
-        self.xpcshell_dir = os.path.join(self.tests_dir, 'xpcshell')
-        self.bin_dir = os.path.join(self.distdir, 'bin')
-
-    def _download_busybox(self, b2g_home, emulator):
-        import urllib2
-
-        target_device = 'generic'
-        if emulator == 'x86':
-            target_device = 'generic_x86'
-        system_bin = os.path.join(b2g_home, 'out', 'target', 'product', target_device, 'system', 'bin')
-        busybox_path = os.path.join(system_bin, 'busybox')
-
-        if os.path.isfile(busybox_path):
-            return busybox_path
-
-        if not os.path.isdir(system_bin):
-            os.makedirs(system_bin)
-
-        try:
-            data = urllib2.urlopen(BUSYBOX_URLS[emulator])
-        except urllib2.URLError:
-            print('There was a problem downloading busybox. Proceeding without it,' \
-                  'initial setup will be slow.')
-            return
-
-        with open(busybox_path, 'wb') as f:
-            f.write(data.read())
-        return busybox_path
-
-    def run_test(self, **kwargs):
-        try:
-            import which
-            which.which('adb')
-        except which.WhichError:
-            # TODO Find adb automatically if it isn't on the path
-            print(ADB_NOT_FOUND % ('mochitest-remote', kwargs["b2g_home"]))
-            sys.exit(1)
-
-        import runtestsb2g
-
-        log = kwargs.pop("log")
-        self.log_manager.enable_unstructured()
-
-        if kwargs["device_name"].startswith('emulator') and 'x86' in kwargs["device_name"]:
-            kwargs["emulator"] = 'x86'
-
-        if kwargs["xpcshell"] is None:
-            kwargs["xpcshell"] = "xpcshell"
-        if kwargs["b2g_path"] is None:
-            kwargs["b2g_path"] = kwargs["b2g_home"]
-        if kwargs["busybox"] is None:
-            kwargs["busybox"] = os.environ.get('BUSYBOX')
-        if kwargs["busybox"] is None:
-            kwargs["busybox"] = self._download_busybox(kwargs["b2g_home"], kwargs["emulator"])
-
-        if kwargs["localLib"] is None:
-            kwargs["localLib"] = self.bin_dir
-        if kwargs["localBin"] is None:
-            kwargs["localBin"] = self.bin_dir
-        if kwargs["logdir"] is None:
-            kwargs["logdir"] = self.xpcshell_dir
-        if kwargs["manifest"] is None:
-            kwargs["manifest"] = os.path.join(self.xpcshell_dir, 'xpcshell.ini')
-        if kwargs["mozInfo"] is None:
-            kwargs["mozInfo"] = os.path.join(self.topobjdir, 'mozinfo.json')
-        if kwargs["objdir"] is None:
-            kwargs["objdir"] = self.topobjdir
-        if kwargs["symbolsPath"] is None:
-            kwargs["symbolsPath"] = os.path.join(self.distdir, 'crashreporter-symbols')
-        if kwargs["testingModulesDir"] is None:
-            kwargs["testingModulesDir"] = os.path.join(self.tests_dir, 'modules')
-        if kwargs["use_device_libs"] is None:
-            kwargs["use_device_libs"] = True
-
-        parser = parser_b2g()
-        options = argparse.Namespace(**kwargs)
-        rv = runtestsb2g.run_remote_xpcshell(parser, options, log)
-
-        self.log_manager.disable_unstructured()
-        return rv
 
 def get_parser():
     build_obj = MozbuildObject.from_environment(cwd=here)
     if conditions.is_android(build_obj):
         return parser_remote()
-    elif conditions.is_b2g(build_obj):
-        return parser_b2g()
     else:
         return parser_desktop()
 
+
 @CommandProvider
 class MachCommands(MachCommandBase):
-    def __init__(self, context):
-        MachCommandBase.__init__(self, context)
-
-        for attr in ('b2g_home', 'device_name'):
-            setattr(self, attr, getattr(context, attr, None))
-
     @Command('xpcshell-test', category='testing',
              description='Run XPCOM Shell tests (API direct unit testing)',
              conditions=[lambda *args: True],
              parser=get_parser)
     def run_xpcshell_test(self, test_objects=None, **params):
         from mozbuild.controller.building import BuildDriver
 
         if test_objects is not None:
@@ -363,30 +249,25 @@ class MachCommands(MachCommandBase):
         driver = self._spawn(BuildDriver)
         driver.install_tests(test_objects)
 
         # We should probably have a utility function to ensure the tree is
         # ready to run tests. Until then, we just create the state dir (in
         # case the tree wasn't built with mach).
         self._ensure_state_subdir_exists('.')
 
-
         params['log'] = structured.commandline.setup_logging("XPCShellTests",
                                                              params,
                                                              {"mach": sys.stdout},
                                                              {"verbose": True})
 
         if conditions.is_android(self):
             from mozrunner.devices.android_device import verify_android_device
             verify_android_device(self)
             xpcshell = self._spawn(AndroidXPCShellRunner)
-        elif conditions.is_b2g(self):
-            xpcshell = self._spawn(B2GXPCShellRunner)
-            params['b2g_home'] = self.b2g_home
-            params['device_name'] = self.device_name
         else:
             xpcshell = self._spawn(XPCShellRunner)
         xpcshell.cwd = self._mach_context.cwd
 
         try:
             return xpcshell.run_test(**params)
         except InvalidTestPathError as e:
             print(e.message)
deleted file mode 100644
--- a/testing/xpcshell/runtestsb2g.py
+++ /dev/null
@@ -1,162 +0,0 @@
-#!/usr/bin/env python
-#
-# 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/.
-
-import sys
-import os
-sys.path.insert(0, os.path.abspath(os.path.realpath(os.path.dirname(sys.argv[0]))))
-
-import traceback
-import remotexpcshelltests
-from remotexpcshelltests import RemoteXPCShellTestThread, XPCShellRemote
-from mozdevice import devicemanagerADB, DMError
-from mozlog import commandline
-
-DEVICE_TEST_ROOT = '/data/local/tests'
-
-from marionette import Marionette
-from xpcshellcommandline import parser_b2g
-
-class B2GXPCShellTestThread(RemoteXPCShellTestThread):
-    # Overridden
-    def launchProcess(self, cmd, stdout, stderr, env, cwd, timeout=None):
-        try:
-            # This returns 1 even when tests pass - hardcode returncode to 0 (bug 773703)
-            outputFile = RemoteXPCShellTestThread.launchProcess(self, cmd, stdout, stderr, env, cwd, timeout=timeout)
-            self.shellReturnCode = 0
-        except DMError:
-            self.shellReturnCode = -1
-            outputFile = "xpcshelloutput"
-            f = open(outputFile, "a")
-            f.write("\n%s" % traceback.format_exc())
-            f.close()
-        return outputFile
-
-class B2GXPCShellRemote(XPCShellRemote):
-    # Overridden
-    def setLD_LIBRARY_PATH(self):
-        self.env['LD_LIBRARY_PATH'] = '/system/b2g'
-        if not self.options.use_device_libs:
-            # overwrite /system/b2g if necessary
-            XPCShellRemote.setLD_LIBRARY_PATH(self)
-
-    # Overridden
-    def setupUtilities(self):
-        if self.options.clean:
-            # Ensure a fresh directory structure for our tests
-            self.clean()
-            self.device.mkDir(self.options.remoteTestRoot)
-
-        XPCShellRemote.setupUtilities(self)
-
-    def clean(self):
-        print >>sys.stderr, "\nCleaning files from previous run.."
-        self.device.removeDir(self.options.remoteTestRoot)
-
-    # Overriden
-    def setupTestDir(self):
-        if self.device._useZip:
-            return XPCShellRemote.setupTestDir(self)
-
-        for root, dirs, files in os.walk(self.xpcDir):
-            for filename in files:
-                rel_path = os.path.relpath(os.path.join(root, filename), self.xpcDir)
-                test_file = os.path.join(self.remoteScriptsDir, rel_path)
-                print 'pushing %s' % test_file
-                self.device.pushFile(os.path.join(root, filename), test_file, retryLimit=10)
-
-    # Overridden
-    def pushLibs(self):
-        if not self.options.use_device_libs:
-            count = XPCShellRemote.pushLibs(self)
-            if not count:
-                # couldn't find any libs, fallback to device libs
-                self.env['LD_LIBRARY_PATH'] = '/system/b2g'
-                self.options.use_device_libs = True
-
-def verifyRemoteOptions(parser, options):
-    if options.b2g_path is None:
-        parser.error("Need to specify a --b2gpath")
-
-    if options.geckoPath and not options.emulator:
-        parser.error("You must specify --emulator if you specify --gecko-path")
-
-    if options.logdir and not options.emulator:
-        parser.error("You must specify --emulator if you specify --logdir")
-    return remotexpcshelltests.verifyRemoteOptions(parser, options)
-
-def run_remote_xpcshell(parser, options, log):
-    options = verifyRemoteOptions(parser, options)
-
-    # Create the Marionette instance
-    kwargs = {}
-    if options.emulator:
-        kwargs['emulator'] = options.emulator
-        if options.no_window:
-            kwargs['noWindow'] = True
-        if options.geckoPath:
-            kwargs['gecko_path'] = options.geckoPath
-        if options.logdir:
-            kwargs['logdir'] = options.logdir
-        if options.busybox:
-            kwargs['busybox'] = options.busybox
-        if options.symbolsPath:
-            kwargs['symbols_path'] = options.symbolsPath
-    if options.b2g_path:
-        kwargs['homedir'] = options.emu_path or options.b2g_path
-    if options.address:
-        host, port = options.address.split(':')
-        kwargs['host'] = host
-        kwargs['port'] = int(port)
-        kwargs['baseurl'] = 'http://%s:%d/' % (host, int(port))
-        if options.emulator:
-            kwargs['connectToRunningEmulator'] = True
-    marionette = Marionette(**kwargs)
-
-    if options.emulator:
-        dm = marionette.emulator.dm
-    else:
-        # Create the DeviceManager instance
-        kwargs = {'adbPath': options.adb_path}
-        if options.deviceIP:
-            kwargs['host'] = options.deviceIP
-            kwargs['port'] = options.devicePort
-        kwargs['deviceRoot'] = options.remoteTestRoot
-        dm = devicemanagerADB.DeviceManagerADB(**kwargs)
-
-    if not options.remoteTestRoot:
-        options.remoteTestRoot = dm.deviceRoot
-    xpcsh = B2GXPCShellRemote(dm, options, log)
-
-    # we don't run concurrent tests on mobile
-    options.sequential = True
-
-    if options.xpcshell is None:
-        options.xpcshell = "xpcshell"
-
-    try:
-        if not xpcsh.runTests(testClass=B2GXPCShellTestThread,
-                              mobileArgs=xpcsh.mobileArgs,
-                              **vars(options)):
-            sys.exit(1)
-    except:
-        print "Automation Error: Exception caught while running tests"
-        traceback.print_exc()
-        sys.exit(1)
-
-def main():
-    parser = parser_b2g()
-    options = parser.parse_args()
-    log = commandline.setup_logging("Remote XPCShell",
-                                    options,
-                                    {"tbpl": sys.stdout})
-    run_remote_xpcshell(parser, options, log)
-
-# You usually run this like :
-# python runtestsb2g.py --emulator arm --b2gpath $B2GPATH --manifest $MANIFEST [--xre-path $MOZ_HOST_BIN
-#                                                                               --adbpath $ADB_PATH
-#                                                                               ...]
-if __name__ == '__main__':
-    main()
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -237,17 +237,17 @@ class XPCShellTestThread(Thread):
 
         return proc.communicate()
 
     def launchProcess(self, cmd, stdout, stderr, env, cwd, timeout=None):
         """
           Simple wrapper to launch a process.
           On a remote system, this is more complex and we need to overload this function.
         """
-        # timeout is needed by remote and b2g xpcshell to extend the
+        # timeout is needed by remote xpcshell to extend the
         # devicemanager.shell() timeout. It is not used in this function.
         if HAVE_PSUTIL:
             popen_func = psutil.Popen
         else:
             popen_func = Popen
         proc = popen_func(cmd, stdout=stdout, stderr=stderr,
                     env=env, cwd=cwd)
         return proc
--- a/testing/xpcshell/selftest.py
+++ b/testing/xpcshell/selftest.py
@@ -551,18 +551,16 @@ tail =
         log_lines = self.log.getvalue().splitlines()
         line_pat = "#\d\d:"
         unknown_pat = "#\d\d\: \?\?\?\[.* \+0x[a-f0-9]+\]"
         self.assertFalse(any(re.search(unknown_pat, line) for line in log_lines),
                          "An stack frame without symbols was found in\n%s" % pprint.pformat(log_lines))
         self.assertTrue(any(re.search(line_pat, line) for line in log_lines),
                         "No line resembling a stack frame was found in\n%s" % pprint.pformat(log_lines))
 
-    @unittest.skipIf(build_obj.defines.get('MOZ_B2G'),
-                     'selftests with child processes fail on b2g desktop builds')
     def testChildPass(self):
         """
         Check that a simple test running in a child process passes.
         """
         self.writeFile("test_pass.js", SIMPLE_PASSING_TEST)
         self.writeFile("test_child_pass.js", CHILD_TEST_PASSING)
         self.writeManifest(["test_child_pass.js"])
 
@@ -572,18 +570,16 @@ tail =
         self.assertEquals(0, self.x.failCount)
         self.assertEquals(0, self.x.todoCount)
         self.assertInLog(TEST_PASS_STRING)
         self.assertInLog("CHILD-TEST-STARTED")
         self.assertInLog("CHILD-TEST-COMPLETED")
         self.assertNotInLog(TEST_FAIL_STRING)
 
 
-    @unittest.skipIf(build_obj.defines.get('MOZ_B2G'),
-                     'selftests with child processes fail on b2g desktop builds')
     def testChildFail(self):
         """
         Check that a simple failing test running in a child process fails.
         """
         self.writeFile("test_fail.js", SIMPLE_FAILING_TEST)
         self.writeFile("test_child_fail.js", CHILD_TEST_FAILING)
         self.writeManifest(["test_child_fail.js"])
 
@@ -592,18 +588,16 @@ tail =
         self.assertEquals(0, self.x.passCount)
         self.assertEquals(1, self.x.failCount)
         self.assertEquals(0, self.x.todoCount)
         self.assertInLog(TEST_FAIL_STRING)
         self.assertInLog("CHILD-TEST-STARTED")
         self.assertInLog("CHILD-TEST-COMPLETED")
         self.assertNotInLog(TEST_PASS_STRING)
 
-    @unittest.skipIf(build_obj.defines.get('MOZ_B2G'),
-                     'selftests with child processes fail on b2g desktop builds')
     def testChildHang(self):
         """
         Check that incomplete output from a child process results in a
         test failure.
         """
         self.writeFile("test_pass.js", SIMPLE_PASSING_TEST)
         self.writeFile("test_child_hang.js", CHILD_TEST_HANG)
         self.writeManifest(["test_child_hang.js"])
@@ -613,18 +607,16 @@ tail =
         self.assertEquals(0, self.x.passCount)
         self.assertEquals(1, self.x.failCount)
         self.assertEquals(0, self.x.todoCount)
         self.assertInLog(TEST_FAIL_STRING)
         self.assertInLog("CHILD-TEST-STARTED")
         self.assertNotInLog("CHILD-TEST-COMPLETED")
         self.assertNotInLog(TEST_PASS_STRING)
 
-    @unittest.skipIf(build_obj.defines.get('MOZ_B2G'),
-                     'selftests with child processes fail on b2g desktop builds')
     def testChild(self):
         """
         Checks that calling do_load_child_test_harness without run_test_in_child
         results in a usable test state. This test has a spurious failure when
         run using |mach python-test|. See bug 1103226.
         """
         self.writeFile("test_child_assertions.js", CHILD_HARNESS_SIMPLE)
         self.writeManifest(["test_child_assertions.js"])
--- a/testing/xpcshell/xpcshellcommandline.py
+++ b/testing/xpcshell/xpcshellcommandline.py
@@ -1,12 +1,13 @@
 import argparse
 
 from mozlog import commandline
 
+
 def add_common_arguments(parser):
     parser.add_argument("--app-path",
                         type=unicode, dest="appPath", default=None,
                         help="application directory (as opposed to XRE directory)")
     parser.add_argument("--interactive",
                         action="store_true", dest="interactive", default=False,
                         help="don't automatically run tests, drop to an xpcshell prompt")
     parser.add_argument("--verbose",
@@ -140,76 +141,26 @@ def add_remote_arguments(parser):
                         help="local path to library directory")
 
     parser.add_argument("--local-bin-dir", action="store", type=str, dest="localBin",
                         help="local path to bin directory")
 
     parser.add_argument("--remoteTestRoot", action="store", type=str, dest="remoteTestRoot",
                         help="remote directory to use as test root (eg. /mnt/sdcard/tests or /data/local/tests)")
 
-def add_b2g_arguments(parser):
-    parser.add_argument('--b2gpath', action='store', type=str, dest='b2g_path',
-                        help="Path to B2G repo or qemu dir")
-
-    parser.add_argument('--emupath', action='store', type=str, dest='emu_path',
-                        help="Path to emulator folder (if different "
-                        "from b2gpath")
-
-    parser.add_argument('--no-clean', action='store_false', dest='clean', default=True,
-                        help="Do not clean TESTROOT. Saves [lots of] time")
-
-    parser.add_argument('--emulator', action='store', type=str, dest='emulator',
-                        default="arm", choices=["x86", "arm"],
-                        help="Architecture of emulator to use: x86 or arm")
-
-    parser.add_argument('--no-window', action='store_true', dest='no_window', default=False,
-                        help="Pass --no-window to the emulator")
-
-    parser.add_argument('--adbpath', action='store', type=str, dest='adb_path',
-                        default="adb", help="Path to adb")
-
-    parser.add_argument('--address', action='store', type=str, dest='address',
-                        help="host:port of running Gecko instance to connect to")
-
-    parser.add_argument('--use-device-libs', action='store_true', dest='use_device_libs',
-                        default=None, help="Don't push .so's")
-
-    parser.add_argument("--gecko-path", action="store", type=str, dest="geckoPath",
-                        help="the path to a gecko distribution that should "
-                        "be installed on the emulator prior to test")
-
-    parser.add_argument("--logdir", action="store", type=str, dest="logdir",
-                        help="directory to store log files")
-
-    parser.add_argument('--busybox', action='store', type=str, dest='busybox',
-                        help="Path to busybox binary to install on device")
-
-    parser.set_defaults(remoteTestRoot="/data/local/tests",
-                        dm_trans="adb")
 
 def parser_desktop():
     parser = argparse.ArgumentParser()
     add_common_arguments(parser)
     commandline.add_logging_group(parser)
 
     return parser
 
+
 def parser_remote():
     parser = argparse.ArgumentParser()
     common = parser.add_argument_group("Common Options")
     add_common_arguments(common)
     remote = parser.add_argument_group("Remote Options")
     add_remote_arguments(remote)
     commandline.add_logging_group(parser)
 
     return parser
-
-def parser_b2g():
-    parser = argparse.ArgumentParser()
-    common = parser.add_argument_group("Common Options")
-    add_common_arguments(common)
-    remote = parser.add_argument_group("Remote Options")
-    add_remote_arguments(remote)
-    b2g = parser.add_argument_group("B2G Options")
-    add_b2g_arguments(b2g)
-    commandline.add_logging_group(parser)
-
-    return parser