Bug 1316800 - Remove session copy of Marionette harness. r=maja_zf
authorHenrik Skupin <mail@hskupin.info>
Fri, 11 Nov 2016 09:48:46 +0100
changeset 352240 1d905b01094e7e8b0acfcb7c4b49f17a41e644cc
parent 352239 3b39fd1f2c80e5f10493cb10c1ea6d30da7a3fd6
child 352241 7444086c2a4df4c28a89176462d03e0c3e2b2ea9
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf
bugs1316800
milestone52.0a1
Bug 1316800 - Remove session copy of Marionette harness. r=maja_zf MozReview-Commit-ID: LMXdJM6D3zZ
testing/marionette/harness/session/__init__.py
testing/marionette/harness/session/runner/__init__.py
testing/marionette/harness/session/runner/base.py
testing/marionette/harness/session/runner/ping_server.py
testing/marionette/harness/session/runtests.py
testing/marionette/harness/session/session_test.py
testing/marionette/harness/session/tests/test_session.py
testing/marionette/harness/session/tests/unit-tests.ini
testing/marionette/mach_commands.py
deleted file mode 100644
--- a/testing/marionette/harness/session/__init__.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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 marionette.marionette_test import (
-    expectedFailure,
-    skip,
-    skip_if_desktop,
-    SkipTest,
-    skip_unless_protocol,
-)
-
-from marionette.runner import (
-    TestManifest,
-    TestResult,
-    TestResultCollection,
-)
-
-from .session_test import (
-    SessionJSTestCase,
-    SessionTestCase,
-)
-
-from .runner import (
-    BaseSessionArguments,
-    BaseSessionTestRunner,
-    SessionTest,
-    SessionTestResult,
-    SessionTextTestRunner,
-    PingServer,
-)
deleted file mode 100644
--- a/testing/marionette/harness/session/runner/__init__.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# 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 .base import (
-    BaseSessionArguments,
-    BaseSessionTestRunner,
-    SessionTest,
-    SessionTestResult,
-    SessionTextTestRunner,
-)
-
-from .ping_server import (
-    PingServer,
-)
deleted file mode 100644
--- a/testing/marionette/harness/session/runner/base.py
+++ /dev/null
@@ -1,804 +0,0 @@
-# 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 argparse import ArgumentParser
-
-import json
-import mozinfo
-import moznetwork
-import os
-import random
-import socket
-import sys
-import time
-import traceback
-import unittest
-import warnings
-import mozprofile
-
-
-from manifestparser import TestManifest
-from manifestparser.filters import tags
-from marionette_driver.marionette import Marionette
-from mozlog import get_default_logger
-from moztest.adapters.unit import StructuredTestRunner, StructuredTestResult
-from moztest.results import TestResultCollection, TestResult, relevant_line
-import mozversion
-
-from marionette.runner import httpd
-
-
-here = os.path.abspath(os.path.dirname(__file__))
-
-
-class SessionTest(TestResult):
-
-    @property
-    def test_name(self):
-        if self.test_class is not None:
-            return '{0}.py {1}.{2}'.format(self.test_class.split('.')[0],
-                                    self.test_class,
-                                    self.name)
-        else:
-            return self.name
-
-class SessionTestResult(StructuredTestResult, TestResultCollection):
-
-    resultClass = SessionTest
-
-    def __init__(self, *args, **kwargs):
-        TestResultCollection.__init__(self, 'SessionTest')
-        self.passed = 0
-        self.testsRun = 0
-        self.result_modifiers = [] # used by mixins to modify the result
-        StructuredTestResult.__init__(self, *args, **kwargs)
-
-    @property
-    def skipped(self):
-        return [t for t in self if t.result == 'SKIPPED']
-
-    @skipped.setter
-    def skipped(self, value):
-        pass
-
-    @property
-    def expectedFailures(self):
-        return [t for t in self if t.result == 'KNOWN-FAIL']
-
-    @expectedFailures.setter
-    def expectedFailures(self, value):
-        pass
-
-    @property
-    def unexpectedSuccesses(self):
-        return [t for t in self if t.result == 'UNEXPECTED-PASS']
-
-    @unexpectedSuccesses.setter
-    def unexpectedSuccesses(self, value):
-        pass
-
-    @property
-    def tests_passed(self):
-        return [t for t in self if t.result == 'PASS']
-
-    @property
-    def errors(self):
-        return [t for t in self if t.result == 'ERROR']
-
-    @errors.setter
-    def errors(self, value):
-        pass
-
-    @property
-    def failures(self):
-        return [t for t in self if t.result == 'UNEXPECTED-FAIL']
-
-    @failures.setter
-    def failures(self, value):
-        pass
-
-    @property
-    def duration(self):
-        if self.stop_time:
-            return self.stop_time - self.start_time
-        else:
-            return 0
-
-    def add_test_result(self, test, result_expected='PASS',
-                        result_actual='PASS', output='', context=None, **kwargs):
-        def get_class(test):
-            return test.__class__.__module__ + '.' + test.__class__.__name__
-
-        name = str(test).split()[0]
-        test_class = get_class(test)
-        if hasattr(test, 'jsFile'):
-            name = os.path.basename(test.jsFile)
-            test_class = None
-
-        t = self.resultClass(name=name, test_class=test_class,
-                       time_start=test.start_time, result_expected=result_expected,
-                       context=context, **kwargs)
-        # call any registered result modifiers
-        for modifier in self.result_modifiers:
-            result_expected, result_actual, output, context = modifier(t, result_expected, result_actual, output, context)
-        t.finish(result_actual,
-                 time_end=time.time() if test.start_time else 0,
-                 reason=relevant_line(output),
-                 output=output)
-        self.append(t)
-
-    def addError(self, test, err):
-        self.add_test_result(test, output=self._exc_info_to_string(err, test), result_actual='ERROR')
-        super(SessionTestResult, self).addError(test, err)
-
-    def addFailure(self, test, err):
-        self.add_test_result(test, output=self._exc_info_to_string(err, test), result_actual='UNEXPECTED-FAIL')
-        super(SessionTestResult, self).addFailure(test, err)
-
-    def addSuccess(self, test):
-        self.passed += 1
-        self.add_test_result(test, result_actual='PASS')
-        super(SessionTestResult, self).addSuccess(test)
-
-    def addExpectedFailure(self, test, err):
-        """Called when an expected failure/error occured."""
-        self.add_test_result(test, output=self._exc_info_to_string(err, test),
-                             result_actual='KNOWN-FAIL')
-        super(SessionTestResult, self).addExpectedFailure(test, err)
-
-    def addUnexpectedSuccess(self, test):
-        """Called when a test was expected to fail, but succeed."""
-        self.add_test_result(test, result_actual='UNEXPECTED-PASS')
-        super(SessionTestResult, self).addUnexpectedSuccess(test)
-
-    def addSkip(self, test, reason):
-        self.add_test_result(test, output=reason, result_actual='SKIPPED')
-        super(SessionTestResult, self).addSkip(test, reason)
-
-    def getInfo(self, test):
-        return test.test_name
-
-    def getDescription(self, test):
-        doc_first_line = test.shortDescription()
-        if self.descriptions and doc_first_line:
-            return '\n'.join((str(test), doc_first_line))
-        else:
-            desc = str(test)
-            if hasattr(test, 'jsFile'):
-                desc = "{0}, {1}".format(test.jsFile, desc)
-            return desc
-
-    def printLogs(self, test):
-        for testcase in test._tests:
-            if hasattr(testcase, 'loglines') and testcase.loglines:
-                # Don't dump loglines to the console if they only contain
-                # TEST-START and TEST-END.
-                skip_log = True
-                for line in testcase.loglines:
-                    str_line = ' '.join(line)
-                    if not 'TEST-END' in str_line and not 'TEST-START' in str_line:
-                        skip_log = False
-                        break
-                if skip_log:
-                    return
-                self.logger.info('START LOG:')
-                for line in testcase.loglines:
-                    self.logger.info(' '.join(line).encode('ascii', 'replace'))
-                self.logger.info('END LOG:')
-
-    def stopTest(self, *args, **kwargs):
-        unittest._TextTestResult.stopTest(self, *args, **kwargs)
-
-
-class SessionTextTestRunner(StructuredTestRunner):
-
-    resultclass = SessionTestResult
-
-    def __init__(self, **kwargs):
-        self.binary = kwargs.pop('binary')
-        StructuredTestRunner.__init__(self, **kwargs)
-
-    def _makeResult(self):
-        return self.resultclass(self.stream,
-                                self.descriptions,
-                                self.verbosity,
-                                logger=self.logger,
-                                result_callbacks=self.result_callbacks)
-
-    def run(self, test):
-        result = super(SessionTextTestRunner, self).run(test)
-        result.printLogs(test)
-        return result
-
-
-class BaseSessionArguments(ArgumentParser):
-    socket_timeout_default = 360.0
-
-    def __init__(self, **kwargs):
-        ArgumentParser.__init__(self, **kwargs)
-
-        def dir_path(path):
-            path = os.path.abspath(os.path.expanduser(path))
-            if not os.access(path, os.F_OK):
-                os.makedirs(path)
-            return path
-
-        self.argument_containers = []
-        self.add_argument('tests',
-                          nargs='*',
-                          default=[],
-                          help='Tests to run.')
-        self.add_argument('-v', '--verbose',
-                        action='count',
-                        help='Increase verbosity to include debug messages with -v, '
-                            'and trace messages with -vv.')
-        self.add_argument('--app',
-                        help='application to use')
-        self.add_argument('--app-arg',
-                        dest='app_args',
-                        action='append',
-                        default=[],
-                        help='specify a command line argument to be passed onto the application')
-        self.add_argument('--binary',
-                        help='gecko executable to launch before running the test')
-        self.add_argument('--profile',
-                        help='profile to use when launching the gecko process. if not passed, then a profile will be '
-                             'constructed and used',
-                        type=dir_path)
-        self.add_argument('--pref',
-                        action='append',
-                        dest='prefs_args',
-                        help=(" A preference to set. Must be a key-value pair"
-                              " separated by a ':'."))
-        self.add_argument('--preferences',
-                        action='append',
-                        dest='prefs_files',
-                        help=("read preferences from a JSON or INI file. For"
-                              " INI, use 'file.ini:section' to specify a"
-                              " particular section."))
-        self.add_argument('--addon',
-                        action='append',
-                        help="addon to install; repeat for multiple addons.")
-        self.add_argument('--repeat',
-                        type=int,
-                        default=0,
-                        help='number of times to repeat the test(s)')
-        self.add_argument('--testvars',
-                        action='append',
-                        help='path to a json file with any test data required')
-        self.add_argument('--symbols-path',
-                        help='absolute path to directory containing breakpad symbols, or the url of a zip file containing symbols')
-        self.add_argument('--timeout',
-                        type=int,
-                        help='if a --timeout value is given, it will set the default page load timeout, search timeout and script timeout to the given value. If not passed in, it will use the default values of 30000ms for page load, 0ms for search timeout and 10000ms for script timeout')
-        self.add_argument('--startup-timeout',
-                        type=int,
-                        default=60,
-                        help='the max number of seconds to wait for a Marionette connection after launching a binary')
-        self.add_argument('--shuffle',
-                        action='store_true',
-                        default=False,
-                        help='run tests in a random order')
-        self.add_argument('--shuffle-seed',
-                        type=int,
-                        default=random.randint(0, sys.maxint),
-                        help='Use given seed to shuffle tests')
-        self.add_argument('--total-chunks',
-                        type=int,
-                        help='how many chunks to split the tests up into')
-        self.add_argument('--this-chunk',
-                        type=int,
-                        help='which chunk to run')
-        self.add_argument('--server-root',
-                        help='url to a webserver or path to a document root from which content '
-                        'resources are served (default: {}).'.format(os.path.join(
-                            os.path.dirname(here), 'www')))
-        self.add_argument('--gecko-log',
-                        help="Define the path to store log file. If the path is"
-                             " a directory, the real log file will be created"
-                             " given the format gecko-(timestamp).log. If it is"
-                             " a file, if will be used directly. '-' may be passed"
-                             " to write to stdout. Default: './gecko.log'")
-        self.add_argument('--logger-name',
-                        default='Marionette-based Tests',
-                        help='Define the name to associate with the logger used')
-        self.add_argument('--jsdebugger',
-                        action='store_true',
-                        default=False,
-                        help='Enable the jsdebugger for marionette javascript.')
-        self.add_argument('--pydebugger',
-                        help='Enable python post-mortem debugger when a test fails.'
-                             ' Pass in the debugger you want to use, eg pdb or ipdb.')
-        self.add_argument('--socket-timeout',
-                        default=self.socket_timeout_default,
-                        help='Set the global timeout for marionette socket operations.')
-        self.add_argument('--disable-e10s',
-                        action='store_false',
-                        dest='e10s',
-                        default=True,
-                        help='Disable e10s when running marionette tests.')
-        self.add_argument('--tag',
-                        action='append', dest='test_tags',
-                        default=None,
-                        help="Filter out tests that don't have the given tag. Can be "
-                             "used multiple times in which case the test must contain "
-                             "at least one of the given tags.")
-        self.add_argument('--workspace',
-                          action='store',
-                          default=None,
-                          help="Path to directory for Marionette output. "
-                               "(Default: .) (Default profile dest: TMP)",
-                          type=dir_path)
-
-    def register_argument_container(self, container):
-        group = self.add_argument_group(container.name)
-
-        for cli, kwargs in container.args:
-            group.add_argument(*cli, **kwargs)
-
-        self.argument_containers.append(container)
-
-    def parse_args(self, args=None, values=None):
-        args = ArgumentParser.parse_args(self, args, values)
-        for container in self.argument_containers:
-            if hasattr(container, 'parse_args_handler'):
-                container.parse_args_handler(args)
-        return args
-
-    def _get_preferences(self, prefs_files, prefs_args):
-        """
-        return user defined profile preferences as a dict
-        """
-        # object that will hold the preferences
-        prefs = mozprofile.prefs.Preferences()
-
-        # add preferences files
-        if prefs_files:
-            for prefs_file in prefs_files:
-                prefs.add_file(prefs_file)
-
-        separator = ':'
-        cli_prefs = []
-        if prefs_args:
-            for pref in prefs_args:
-                if separator not in pref:
-                    continue
-                cli_prefs.append(pref.split(separator, 1))
-
-        # string preferences
-        prefs.add(cli_prefs, cast=True)
-
-        return dict(prefs())
-
-    def verify_usage(self, args):
-        if not args.tests:
-            print 'must specify one or more test files, manifests, or directories'
-            sys.exit(1)
-
-        for path in args.tests:
-            if not os.path.exists(path):
-                print '{0} does not exist'.format(path)
-                sys.exit(1)
-
-        if not args.binary:
-            print 'must specify --binary'
-            sys.exit(1)
-
-        if args.total_chunks is not None and args.this_chunk is None:
-            self.error('You must specify which chunk to run.')
-
-        if args.this_chunk is not None and args.total_chunks is None:
-            self.error('You must specify how many chunks to split the tests into.')
-
-        if args.total_chunks is not None:
-            if not 1 <= args.total_chunks:
-                self.error('Total chunks must be greater than 1.')
-            if not 1 <= args.this_chunk <= args.total_chunks:
-                self.error('Chunk to run must be between 1 and {}.'.format(args.total_chunks))
-
-        if args.jsdebugger:
-            args.app_args.append('-jsdebugger')
-            args.socket_timeout = None
-
-        args.prefs = self._get_preferences(args.prefs_files, args.prefs_args)
-
-        if args.e10s:
-            args.prefs.update({
-                'browser.tabs.remote.autostart': True,
-                'browser.tabs.remote.force-enable': True,
-                'extensions.e10sBlocksEnabling': False
-            })
-
-        for container in self.argument_containers:
-            if hasattr(container, 'verify_usage_handler'):
-                container.verify_usage_handler(args)
-
-        return args
-
-
-class BaseSessionTestRunner(object):
-
-    textrunnerclass = SessionTextTestRunner
-    driverclass = Marionette
-
-    def __init__(self, address=None,
-                 app=None, app_args=None, binary=None, profile=None,
-                 logger=None, logdir=None,
-                 repeat=0, testvars=None,
-                 symbols_path=None, timeout=None,
-                 shuffle=False, shuffle_seed=random.randint(0, sys.maxint),
-                 sdcard=None, this_chunk=1, total_chunks=1, sources=None,
-                 server_root=None, gecko_log=None, result_callbacks=None,
-                 prefs=None, test_tags=None,
-                 socket_timeout=BaseSessionArguments.socket_timeout_default,
-                 startup_timeout=None, addons=None, workspace=None,
-                 verbose=0, e10s=True, **kwargs):
-        self.address = address
-        self.app = app
-        self.app_args = app_args or []
-        self.bin = binary
-        self.profile = profile
-        self.addons = addons
-        self.logger = logger
-        self.httpd = None
-        self.logdir = logdir
-        self.repeat = repeat
-        self.test_kwargs = kwargs
-        self.symbols_path = symbols_path
-        self.timeout = timeout
-        self.socket_timeout = socket_timeout
-        self._appinfo = None
-        self._appName = None
-        self.shuffle = shuffle
-        self.shuffle_seed = shuffle_seed
-        self.sdcard = sdcard
-        self.sources = sources
-        self.server_root = server_root
-        self.this_chunk = this_chunk
-        self.total_chunks = total_chunks
-        self.mixin_run_tests = []
-        self.manifest_skipped_tests = []
-        self.tests = []
-        self.result_callbacks = result_callbacks or []
-        self.prefs = prefs or {}
-        self.test_tags = test_tags
-        self.startup_timeout = startup_timeout
-        self.workspace = workspace
-        # If no workspace is set, default location for gecko.log is .
-        # and default location for profile is TMP
-        self.workspace_path = workspace or os.getcwd()
-        self.verbose = verbose
-        self.e10s = e10s
-
-        def gather_debug(test, status):
-            rv = {}
-            marionette = test.marionette
-
-            # In the event we're gathering debug without starting a session, skip marionette commands
-            if marionette.session is not None:
-                try:
-                    with marionette.using_context(marionette.CONTEXT_CHROME):
-                        rv['screenshot'] = marionette.screenshot()
-                    with marionette.using_context(marionette.CONTEXT_CONTENT):
-                        rv['source'] = marionette.page_source
-                except Exception:
-                    logger = get_default_logger()
-                    logger.warning('Failed to gather test failure debug.', exc_info=True)
-            return rv
-
-        self.result_callbacks.append(gather_debug)
-
-        # testvars are set up in self.testvars property
-        self._testvars = None
-        self.testvars_paths = testvars
-
-        self.test_handlers = []
-
-        self.reset_test_stats()
-
-        self.logger.info('Using workspace for temporary data: '
-                         '"{}"'.format(self.workspace_path))
-
-        if not gecko_log:
-            self.gecko_log = os.path.join(self.workspace_path or '', 'gecko.log')
-        else:
-            self.gecko_log = gecko_log
-
-        self.results = []
-
-    @property
-    def testvars(self):
-        if self._testvars is not None:
-            return self._testvars
-
-        self._testvars = {}
-
-        def update(d, u):
-            """ Update a dictionary that may contain nested dictionaries. """
-            for k, v in u.iteritems():
-                o = d.get(k, {})
-                if isinstance(v, dict) and isinstance(o, dict):
-                    d[k] = update(d.get(k, {}), v)
-                else:
-                    d[k] = u[k]
-            return d
-
-        json_testvars = self._load_testvars()
-        for j in json_testvars:
-            self._testvars = update(self._testvars, j)
-        return self._testvars
-
-    def _load_testvars(self):
-        data = []
-        if self.testvars_paths is not None:
-            for path in list(self.testvars_paths):
-                path = os.path.abspath(os.path.expanduser(path))
-                if not os.path.exists(path):
-                    raise IOError('--testvars file {} does not exist'.format(path))
-                try:
-                    with open(path) as f:
-                        data.append(json.loads(f.read()))
-                except ValueError as e:
-                    raise Exception("JSON file ({0}) is not properly "
-                                    "formatted: {1}".format(os.path.abspath(path),
-                                                       e.message))
-        return data
-
-    @property
-    def bin(self):
-        return self._bin
-
-    @bin.setter
-    def bin(self, path):
-        """
-        Set binary and reset parts of runner accordingly
-
-        Intended use: to change binary between calls to run_tests
-        """
-        self._bin = path
-        self.tests = []
-
-    def reset_test_stats(self):
-        self.passed = 0
-        self.failed = 0
-        self.crashed = 0
-        self.unexpected_successes = 0
-        self.todo = 0
-        self.skipped = 0
-        self.failures = []
-
-    def run_tests(self, tests):
-        assert len(tests) > 0
-        assert len(self.test_handlers) > 0
-        self.reset_test_stats()
-        self.start_time = time.time()
-
-        # Gaia sets server_root and that means we shouldn't spin up our own httpd
-        if not self.httpd:
-            if self.server_root is None or os.path.isdir(self.server_root):
-                self.logger.info("starting httpd")
-                self.httpd = self.create_httpd(False)
-                self.base_url = self.httpd.get_url()
-                self.logger.info("running httpd on {}".format(self.base_url))
-            else:
-                self.base_url = self.server_root
-                self.logger.info("using remote content from {}".format(self.base_url))
-
-        device_info = None
-
-        for test in tests:
-            self.add_test(test)
-
-        # ensure we have only tests files with names starting with 'test_'
-        invalid_tests = \
-            [t['filepath'] for t in self.tests
-             if not os.path.basename(t['filepath']).startswith('test_')]
-        if invalid_tests:
-            raise Exception("Tests file names must starts with 'test_'."
-                            " Invalid test names:\n  {}".format(
-                                '\n  '.join(invalid_tests)))
-
-        self.logger.info("running with e10s: {}".format(self.e10s))
-
-        self.logger.suite_start(self.tests)
-
-        for test in self.manifest_skipped_tests:
-            name = os.path.basename(test['path'])
-            self.logger.test_start(name)
-            self.logger.test_end(name,
-                                 'SKIP',
-                                 message=test['disabled'])
-            self.todo += 1
-
-        interrupted = None
-        try:
-            counter = self.repeat
-            while counter >=0:
-                round = self.repeat - counter
-                if round > 0:
-                    self.logger.info('\nREPEAT {}\n-------'.format(round))
-                self.run_test_sets()
-                counter -= 1
-        except KeyboardInterrupt:
-            # in case of KeyboardInterrupt during the test execution
-            # we want to display current test results.
-            # so we keep the exception to raise it later.
-            interrupted = sys.exc_info()
-        try:
-            self._print_summary(tests)
-        except:
-            # raise only the exception if we were not interrupted
-            if not interrupted:
-                raise
-        finally:
-            # reraise previous interruption now
-            if interrupted:
-                raise interrupted[0], interrupted[1], interrupted[2]
-
-    def _print_summary(self, tests):
-        self.logger.info('\nSUMMARY\n-------')
-        self.logger.info('passed: {}'.format(self.passed))
-        if self.unexpected_successes == 0:
-            self.logger.info('failed: {}'.format(self.failed))
-        else:
-            self.logger.info('failed: {0} '
-                             '(unexpected sucesses: {1})'.format(self.failed,
-                                                                 self.unexpected_successes))
-        if self.skipped == 0:
-            self.logger.info('todo: {}'.format(self.todo))
-        else:
-            self.logger.info('todo: {0} (skipped: {1})'.format(self.todo, self.skipped))
-
-        if self.failed > 0:
-            self.logger.info('\nFAILED TESTS\n-------')
-            for failed_test in self.failures:
-                self.logger.info(str(failed_test[0]))
-
-        self.end_time = time.time()
-        self.elapsedtime = self.end_time - self.start_time
-
-        for run_tests in self.mixin_run_tests:
-            run_tests(tests)
-        if self.shuffle:
-            self.logger.info("Using seed where seed is: {}".format(self.shuffle_seed))
-
-        self.logger.info('mode: {}'.format('e10s' if self.e10s else 'non-e10s'))
-        self.logger.suite_end()
-
-    def create_httpd(self, need_external_ip):
-        host = "127.0.0.1"
-        if need_external_ip:
-            host = moznetwork.get_ip()
-        root = self.server_root or os.path.join(os.path.dirname(here), "www")
-        rv = httpd.FixtureServer(root, host=host)
-        rv.start()
-        return rv
-
-    def add_test(self, test, expected='pass'):
-        filepath = os.path.abspath(test)
-
-        if os.path.isdir(filepath):
-            for root, dirs, files in os.walk(filepath):
-                for filename in files:
-                    if (filename.startswith('test_') and
-                        (filename.endswith('.py') or filename.endswith('.js'))):
-                        filepath = os.path.join(root, filename)
-                        self.add_test(filepath)
-            return
-
-        file_ext = os.path.splitext(os.path.split(filepath)[-1])[1]
-
-        if file_ext == '.ini':
-            manifest = TestManifest()
-            manifest.read(filepath)
-
-            filters = []
-            if self.test_tags:
-                filters.append(tags(self.test_tags))
-            manifest_tests = manifest.active_tests(exists=False,
-                                                   disabled=True,
-                                                   filters=filters,
-                                                   e10s=self.e10s,
-                                                   **mozinfo.info)
-            if len(manifest_tests) == 0:
-                self.logger.error("no tests to run using specified "
-                                  "combination of filters: {}".format(
-                                       manifest.fmt_filters()))
-
-            target_tests = []
-            for test in manifest_tests:
-                if test.get('disabled'):
-                    self.manifest_skipped_tests.append(test)
-                else:
-                    target_tests.append(test)
-
-            for i in target_tests:
-                if not os.path.exists(i["path"]):
-                    raise IOError("test file: {} does not exist".format(i["path"]))
-
-                file_ext = os.path.splitext(os.path.split(i['path'])[-1])[-1]
-
-                self.add_test(i["path"], i["expected"])
-            return
-
-        self.tests.append({'filepath': filepath, 'expected': expected})
-
-    def run_test(self, filepath, expected):
-
-        testloader = unittest.TestLoader()
-        suite = unittest.TestSuite()
-        self.test_kwargs['binary'] = self.bin
-        self.test_kwargs['expected'] = expected
-        self.test_kwargs['base_url'] = self.base_url
-        mod_name = os.path.splitext(os.path.split(filepath)[-1])[0]
-        for handler in self.test_handlers:
-            if handler.match(os.path.basename(filepath)):
-                handler.add_tests_to_suite(mod_name,
-                                           filepath,
-                                           suite,
-                                           testloader,
-                                           self.testvars,
-                                           **self.test_kwargs)
-                break
-
-        if suite.countTestCases():
-            runner = self.textrunnerclass(logger=self.logger,
-                                          result_callbacks=self.result_callbacks,
-                                          binary=self.bin)
-
-            results = runner.run(suite)
-            self.results.append(results)
-
-            self.failed += len(results.failures) + len(results.errors)
-            if hasattr(results, 'skipped'):
-                self.skipped += len(results.skipped)
-                self.todo += len(results.skipped)
-            self.passed += results.passed
-            for failure in results.failures + results.errors:
-                self.failures.append((results.getInfo(failure), failure.output, 'TEST-UNEXPECTED-FAIL'))
-            if hasattr(results, 'unexpectedSuccesses'):
-                self.failed += len(results.unexpectedSuccesses)
-                self.unexpected_successes += len(results.unexpectedSuccesses)
-                for failure in results.unexpectedSuccesses:
-                    self.failures.append((results.getInfo(failure), failure.output, 'TEST-UNEXPECTED-PASS'))
-            if hasattr(results, 'expectedFailures'):
-                self.todo += len(results.expectedFailures)
-
-            self.mixin_run_tests = []
-            for result in self.results:
-                result.result_modifiers = []
-
-    def run_test_set(self, tests):
-        if self.shuffle:
-            random.seed(self.shuffle_seed)
-            random.shuffle(tests)
-
-        for test in tests:
-            self.run_test(test['filepath'], test['expected'])
-
-    def run_test_sets(self):
-        if len(self.tests) < 1:
-            raise Exception('There are no tests to run.')
-        elif self.total_chunks > len(self.tests):
-            raise ValueError('Total number of chunks must be between 1 and {}.'
-                             .format(len(self.tests)))
-        if self.total_chunks > 1:
-            chunks = [[] for i in range(self.total_chunks)]
-            for i, test in enumerate(self.tests):
-                target_chunk = i % self.total_chunks
-                chunks[target_chunk].append(test)
-
-            self.logger.info('Running chunk {0} of {1} ({2} tests selected from a '
-                             'total of {3})'.format(self.this_chunk, self.total_chunks,
-                                                    len(chunks[self.this_chunk - 1]),
-                                                    len(self.tests)))
-            self.tests = chunks[self.this_chunk - 1]
-
-        self.run_test_set(self.tests)
-
-    def cleanup(self):
-        if self.httpd:
-            self.httpd.stop()
-
-    __del__ = cleanup
deleted file mode 100644
--- a/testing/marionette/harness/session/runner/ping_server.py
+++ /dev/null
@@ -1,63 +0,0 @@
-import BaseHTTPServer
-import threading
-import zlib
-import json
-
-class PingHandler(BaseHTTPServer.BaseHTTPRequestHandler):
-
-    def do_HEAD(s):
-        s.send_response(200)
-        s.send_header("Content-type", "text/html")
-        s.end_headers()
-
-    def do_GET(s):
-        self.do_HEAD(self, s)
-        s.wfile.write("<html>")
-        s.wfile.write("  <head><title>Success</title></head>")
-        s.wfile.write("  <body>")
-        s.wfile.write("    <p>The server is working correctly. Firefox should send a POST request on port {}</p>".format(self.server.port))
-        s.wfile.write("  </body>")
-        s.wfile.write("</html>")
-
-    def do_POST(s):
-        length = int(s.headers["Content-Length"])
-        plainData = s.rfile.read(length)
-        if s.headers.get("Content-Encoding") == "gzip":
-            plainData = zlib.decompress(plainData, zlib.MAX_WBITS | 16)
-        jsonData = json.loads(plainData)
-        self.server.appendPing(jsonData)
-        self.do_HEAD(self, s)
-
-class PingServer(threading.Thread):
-
-    def __init__(self):
-        threading.Thread.__init__(self)
-        self._httpd = BaseHTTPServer.HTTPServer(('', 0), PingHandler)
-        self._receivedPings = dict()
-
-    def run(self):
-        self._httpd.serve_forever()
-
-    def stop(self):
-        self._httpd.shutdown()
-
-    def appendPing(self, jsonData):
-        self._receivedPings[jsonData["id"]] = jsonData
-
-    def clearPings(self):
-        self._receivedPings.clear()
-
-    @property
-    def pings(self):
-        return self._receivedPings
-
-    def ping(self, id):
-        return self._receivedPings.get(id)
-
-    @property
-    def name(self):
-        return self._httpd.server_name
-
-    @property
-    def port(self):
-        return self._httpd.server_port
deleted file mode 100644
--- a/testing/marionette/harness/session/runtests.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# 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
-
-from session.session_test import SessionTestCase, SessionJSTestCase
-from session.runner import BaseSessionTestRunner, BaseSessionArguments
-from marionette.runtests import MarionetteHarness, cli
-
-
-class SessionTestRunner(BaseSessionTestRunner):
-    def __init__(self, **kwargs):
-        BaseSessionTestRunner.__init__(self, **kwargs)
-        self.test_handlers = [SessionTestCase, SessionJSTestCase]
-
-
-class SessionArguments(BaseSessionArguments):
-    def __init__(self, **kwargs):
-        BaseSessionArguments.__init__(self, **kwargs)
-
-
-if __name__ == "__main__":
-    cli(runner_class=SessionTestRunner, parser_class=SessionArguments,
-        harness_class=MarionetteHarness, testcase_class=SessionTestCase, args=None)
deleted file mode 100644
--- a/testing/marionette/harness/session/session_test.py
+++ /dev/null
@@ -1,493 +0,0 @@
-# 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 imp
-import os
-import re
-import functools
-import sys
-import socket
-import time
-import types
-import unittest
-import weakref
-import warnings
-
-
-from mozprofile import FirefoxProfile
-from mozrunner import FirefoxRunner
-from marionette_driver.errors import (
-        MarionetteException, TimeoutException,
-        JavascriptException, NoSuchElementException, NoSuchWindowException,
-        StaleElementException, ScriptTimeoutException, ElementNotVisibleException,
-        NoSuchFrameException, InvalidElementStateException, NoAlertPresentException,
-        InvalidCookieDomainException, UnableToSetCookieException, InvalidSelectorException,
-        MoveTargetOutOfBoundsException
-        )
-from marionette_driver.marionette import Marionette
-from marionette_driver.wait import Wait
-from marionette_driver.expected import element_present, element_not_present
-from mozlog import get_default_logger
-from runner import PingServer
-
-from marionette.marionette_test import (
-        SkipTest,
-        _ExpectedFailure,
-        _UnexpectedSuccess,
-        skip,
-        expectedFailure,
-        parameterized,
-        with_parameters,
-        wraps_parameterized,
-        MetaParameterized,
-        JSTest
-        )
-
-
-class JSTest:
-    head_js_re = re.compile(r"MARIONETTE_HEAD_JS(\s*)=(\s*)['|\"](.*?)['|\"];")
-    context_re = re.compile(r"MARIONETTE_CONTEXT(\s*)=(\s*)['|\"](.*?)['|\"];")
-    timeout_re = re.compile(r"MARIONETTE_TIMEOUT(\s*)=(\s*)(\d+);")
-    inactivity_timeout_re = re.compile(r"MARIONETTE_INACTIVITY_TIMEOUT(\s*)=(\s*)(\d+);")
-
-class CommonTestCase(unittest.TestCase):
-
-    __metaclass__ = MetaParameterized
-    match_re = None
-    failureException = AssertionError
-    pydebugger = None
-
-    def __init__(self, methodName, **kwargs):
-        unittest.TestCase.__init__(self, methodName)
-        self.loglines = []
-        self.duration = 0
-        self.expected = kwargs.pop('expected', 'pass')
-        self.logger = get_default_logger()
-        self.profile = FirefoxProfile()
-        self.binary = kwargs.pop('binary', None)
-
-    def _enter_pm(self):
-        if self.pydebugger:
-            self.pydebugger.post_mortem(sys.exc_info()[2])
-
-    def _addSkip(self, result, reason):
-        addSkip = getattr(result, 'addSkip', None)
-        if addSkip is not None:
-            addSkip(self, reason)
-        else:
-            warnings.warn("TestResult has no addSkip method, skips not reported",
-                          RuntimeWarning, 2)
-            result.addSuccess(self)
-
-    def run(self, result=None):
-        # Bug 967566 suggests refactoring run, which would hopefully
-        # mean getting rid of this inner function, which only sits
-        # here to reduce code duplication:
-        def expected_failure(result, exc_info):
-            addExpectedFailure = getattr(result, "addExpectedFailure", None)
-            if addExpectedFailure is not None:
-                addExpectedFailure(self, exc_info)
-            else:
-                warnings.warn("TestResult has no addExpectedFailure method, "
-                              "reporting as passes", RuntimeWarning)
-                result.addSuccess(self)
-
-        self.start_time = time.time()
-        orig_result = result
-        if result is None:
-            result = self.defaultTestResult()
-            startTestRun = getattr(result, 'startTestRun', None)
-            if startTestRun is not None:
-                startTestRun()
-
-        result.startTest(self)
-
-        testMethod = getattr(self, self._testMethodName)
-        if (getattr(self.__class__, "__unittest_skip__", False) or
-            getattr(testMethod, "__unittest_skip__", False)):
-            # If the class or method was skipped.
-            try:
-                skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
-                            or getattr(testMethod, '__unittest_skip_why__', ''))
-                self._addSkip(result, skip_why)
-            finally:
-                result.stopTest(self)
-            self.stop_time = time.time()
-            return
-        try:
-            success = False
-            try:
-                if self.expected == "fail":
-                    try:
-                        self.setUp()
-                    except Exception:
-                        raise _ExpectedFailure(sys.exc_info())
-                else:
-                    self.setUp()
-            except SkipTest as e:
-                self._addSkip(result, str(e))
-            except KeyboardInterrupt:
-                raise
-            except _ExpectedFailure as e:
-                expected_failure(result, e.exc_info)
-            except:
-                self._enter_pm()
-                result.addError(self, sys.exc_info())
-            else:
-                try:
-                    if self.expected == 'fail':
-                        try:
-                            testMethod()
-                        except:
-                            raise _ExpectedFailure(sys.exc_info())
-                        raise _UnexpectedSuccess
-                    else:
-                        testMethod()
-                except self.failureException:
-                    self._enter_pm()
-                    result.addFailure(self, sys.exc_info())
-                except KeyboardInterrupt:
-                    raise
-                except _ExpectedFailure as e:
-                    expected_failure(result, e.exc_info)
-                except _UnexpectedSuccess:
-                    addUnexpectedSuccess = getattr(result, 'addUnexpectedSuccess', None)
-                    if addUnexpectedSuccess is not None:
-                        addUnexpectedSuccess(self)
-                    else:
-                        warnings.warn("TestResult has no addUnexpectedSuccess method, reporting as failures",
-                                      RuntimeWarning)
-                        result.addFailure(self, sys.exc_info())
-                except SkipTest as e:
-                    self._addSkip(result, str(e))
-                except:
-                    self._enter_pm()
-                    result.addError(self, sys.exc_info())
-                else:
-                    success = True
-                try:
-                    if self.expected == "fail":
-                        try:
-                            self.tearDown()
-                        except:
-                            raise _ExpectedFailure(sys.exc_info())
-                    else:
-                        self.tearDown()
-                except KeyboardInterrupt:
-                    raise
-                except _ExpectedFailure as e:
-                    expected_failure(result, e.exc_info)
-                except:
-                    self._enter_pm()
-                    result.addError(self, sys.exc_info())
-                    success = False
-            # Here we could handle doCleanups() instead of calling cleanTest directly
-            self.cleanTest()
-
-            if success:
-                result.addSuccess(self)
-
-        finally:
-            result.stopTest(self)
-            if orig_result is None:
-                stopTestRun = getattr(result, 'stopTestRun', None)
-                if stopTestRun is not None:
-                    stopTestRun()
-
-    @classmethod
-    def match(cls, filename):
-        """
-        Determines if the specified filename should be handled by this
-        test class; this is done by looking for a match for the filename
-        using cls.match_re.
-        """
-        if not cls.match_re:
-            return False
-        m = cls.match_re.match(filename)
-        return m is not None
-
-    @classmethod
-    def add_tests_to_suite(cls, mod_name, filepath, suite, testloader, testvars):
-        """
-        Adds all the tests in the specified file to the specified suite.
-        """
-        raise NotImplementedError
-
-    @property
-    def test_name(self):
-        if hasattr(self, 'jsFile'):
-            return os.path.basename(self.jsFile)
-        else:
-            return '{0}.py {1}.{2}'.format(self.__class__.__module__,
-                                           self.__class__.__name__,
-                                           self._testMethodName)
-
-    def id(self):
-        # TBPL starring requires that the "test name" field of a failure message
-        # not differ over time. The test name to be used is passed to
-        # mozlog via the test id, so this is overriden to maintain
-        # consistency.
-        return self.test_name
-
-    def setUp(self):
-        # Convert the marionette weakref to an object, just for the
-        # duration of the test; this is deleted in tearDown() to prevent
-        # a persistent circular reference which in turn would prevent
-        # proper garbage collection.
-        self.start_time = time.time()
-        self.pingServer = PingServer()
-        self.pingServer.start()
-        self.marionette = Marionette(bin=self.binary, profile=self.profile)
-        if self.marionette.session is None:
-            self.marionette.start_session()
-        self.marionette.reset_timeouts()
-
-    def tearDown(self):
-        self.marionette.cleanup()
-        self.pingServer.stop()
-
-    def cleanTest(self):
-        self._deleteSession()
-
-    def _deleteSession(self):
-        if hasattr(self, 'start_time'):
-            self.duration = time.time() - self.start_time
-        if hasattr(self.marionette, 'session'):
-            if self.marionette.session is not None:
-                try:
-                    self.loglines.extend(self.marionette.get_logs())
-                except Exception, inst:
-                    self.loglines = [['Error getting log: {}'.format(inst)]]
-                try:
-                    self.marionette.delete_session()
-                except (socket.error, MarionetteException, IOError):
-                    # Gecko has crashed?
-                    self.marionette.session = None
-                    try:
-                        self.marionette.client.close()
-                    except socket.error:
-                        pass
-        self.marionette = None
-
-    def setup_SpecialPowers_observer(self):
-        self.marionette.set_context("chrome")
-        self.marionette.execute_script("""
-            let SECURITY_PREF = "security.turn_off_all_security_so_that_viruses_can_take_over_this_computer";
-            Components.utils.import("resource://gre/modules/Preferences.jsm");
-            Preferences.set(SECURITY_PREF, true);
-
-            if (!testUtils.hasOwnProperty("specialPowersObserver")) {
-              let loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
-                .getService(Components.interfaces.mozIJSSubScriptLoader);
-              loader.loadSubScript("chrome://specialpowers/content/SpecialPowersObserver.jsm",
-                testUtils);
-              testUtils.specialPowersObserver = new testUtils.SpecialPowersObserver();
-              testUtils.specialPowersObserver.init();
-            }
-            """)
-
-    def run_js_test(self, filename, marionette=None):
-        '''
-        Run a JavaScript test file and collect its set of assertions
-        into the current test's results.
-
-        :param filename: The path to the JavaScript test file to execute.
-                         May be relative to the current script.
-        :param marionette: The Marionette object in which to execute the test.
-                           Defaults to self.marionette.
-        '''
-        marionette = marionette or self.marionette
-        if not os.path.isabs(filename):
-            # Find the caller's filename and make the path relative to that.
-            caller_file = sys._getframe(1).f_globals.get('__file__', '')
-            caller_file = os.path.abspath(caller_file)
-            filename = os.path.join(os.path.dirname(caller_file), filename)
-        self.assert_(os.path.exists(filename),
-                     'Script "{}" must exist'.format(filename))
-        original_test_name = self.marionette.test_name
-        self.marionette.test_name = os.path.basename(filename)
-        f = open(filename, 'r')
-        js = f.read()
-        args = []
-
-        head_js = JSTest.head_js_re.search(js);
-        if head_js:
-            head_js = head_js.group(3)
-            head = open(os.path.join(os.path.dirname(filename), head_js), 'r')
-            js = head.read() + js;
-
-        context = JSTest.context_re.search(js)
-        if context:
-            context = context.group(3)
-        else:
-            context = 'content'
-
-        if 'SpecialPowers' in js:
-            self.setup_SpecialPowers_observer()
-
-            if context == 'content':
-                js = "var SpecialPowers = window.wrappedJSObject.SpecialPowers;\n" + js
-            else:
-                marionette.execute_script("""
-                if (typeof(SpecialPowers) == 'undefined') {
-                  let loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"]
-                    .getService(Components.interfaces.mozIJSSubScriptLoader);
-                  loader.loadSubScript("chrome://specialpowers/content/specialpowersAPI.js");
-                  loader.loadSubScript("chrome://specialpowers/content/SpecialPowersObserverAPI.js");
-                  loader.loadSubScript("chrome://specialpowers/content/ChromePowers.js");
-                }
-                """)
-
-        marionette.set_context(context)
-
-        if context != 'chrome':
-            marionette.navigate('data:text/html,<html>test page</html>')
-
-        timeout = JSTest.timeout_re.search(js)
-        if timeout:
-            timeout = timeout.group(3)
-            marionette.set_script_timeout(timeout)
-
-        inactivity_timeout = JSTest.inactivity_timeout_re.search(js)
-        if inactivity_timeout:
-            inactivity_timeout = inactivity_timeout.group(3)
-
-        try:
-            results = marionette.execute_js_script(
-                js,
-                args,
-                inactivity_timeout=inactivity_timeout,
-                filename=os.path.basename(filename)
-            )
-
-            self.assertTrue(not 'timeout' in filename,
-                            'expected timeout not triggered')
-
-            if 'fail' in filename:
-                self.assertTrue(len(results['failures']) > 0,
-                                "expected test failures didn't occur")
-            else:
-                for failure in results['failures']:
-                    diag = "" if failure.get('diag') is None else failure['diag']
-                    name = "got false, expected true" if failure.get('name') is None else failure['name']
-                    self.logger.test_status(self.test_name, name, 'FAIL',
-                                            message=diag)
-                for failure in results['expectedFailures']:
-                    diag = "" if failure.get('diag') is None else failure['diag']
-                    name = "got false, expected false" if failure.get('name') is None else failure['name']
-                    self.logger.test_status(self.test_name, name, 'FAIL',
-                                            expected='FAIL', message=diag)
-                for failure in results['unexpectedSuccesses']:
-                    diag = "" if failure.get('diag') is None else failure['diag']
-                    name = "got true, expected false" if failure.get('name') is None else failure['name']
-                    self.logger.test_status(self.test_name, name, 'PASS',
-                                            expected='FAIL', message=diag)
-                self.assertEqual(0, len(results['failures']),
-                                 '{} tests failed'.format(len(results['failures'])))
-                if len(results['unexpectedSuccesses']) > 0:
-                    raise _UnexpectedSuccess('')
-                if len(results['expectedFailures']) > 0:
-                    raise _ExpectedFailure((AssertionError, AssertionError(''), None))
-
-            self.assertTrue(results['passed']
-                            + len(results['failures'])
-                            + len(results['expectedFailures'])
-                            + len(results['unexpectedSuccesses']) > 0,
-                            'no tests run')
-
-        except ScriptTimeoutException:
-            if 'timeout' in filename:
-                # expected exception
-                pass
-            else:
-                self.loglines = marionette.get_logs()
-                raise
-        self.marionette.test_name = original_test_name
-
-
-
-class SessionTestCase(CommonTestCase):
-
-    match_re = re.compile(r"test_(.*)\.py$")
-
-    def __init__(self, methodName='runTest',
-                 filepath='', **kwargs):
-        self.marionette = None
-        self.methodName = methodName
-        self.filepath = filepath
-        self.testvars = kwargs.pop('testvars', None)
-        CommonTestCase.__init__(self, methodName, **kwargs)
-
-    @classmethod
-    def add_tests_to_suite(cls, mod_name, filepath, suite, testloader, testvars, **kwargs):
-        # since we use imp.load_source to load test modules, if a module
-        # is loaded with the same name as another one the module would just be
-        # reloaded.
-        #
-        # We may end up by finding too many test in a module then since
-        # reload() only update the module dict (so old keys are still there!)
-        # see https://docs.python.org/2/library/functions.html#reload
-        #
-        # we get rid of that by removing the module from sys.modules,
-        # so we ensure that it will be fully loaded by the
-        # imp.load_source call.
-        if mod_name in sys.modules:
-            del sys.modules[mod_name]
-
-        test_mod = imp.load_source(mod_name, filepath)
-
-        for name in dir(test_mod):
-            obj = getattr(test_mod, name)
-            if (isinstance(obj, (type, types.ClassType)) and
-                issubclass(obj, unittest.TestCase)):
-                testnames = testloader.getTestCaseNames(obj)
-                for testname in testnames:
-                    suite.addTest(obj(methodName=testname,
-                                  filepath=filepath,
-                                  testvars=testvars,
-                                  **kwargs))
-
-    def setUp(self):
-        CommonTestCase.setUp(self)
-
-    def tearDown(self):
-        CommonTestCase.tearDown(self)
-
-    def wait_for_condition(self, method, timeout=30):
-        timeout = float(timeout) + time.time()
-        while time.time() < timeout:
-            value = method(self.marionette)
-            if value:
-                return value
-            time.sleep(0.5)
-        else:
-            raise TimeoutException("wait_for_condition timed out")
-
-class SessionJSTestCase(CommonTestCase):
-
-    match_re = re.compile(r"test_(.*)\.js$")
-
-    def __init__(self, methodName='runTest', jsFile=None, **kwargs):
-        assert(jsFile)
-        self.jsFile = jsFile
-        self.marionette = None
-        CommonTestCase.__init__(self, methodName)
-
-    @classmethod
-    def add_tests_to_suite(cls, mod_name, filepath, suite, testloader, testvars, **kwargs):
-        suite.addTest(cls(jsFile=filepath, **kwargs))
-
-    def runTest(self):
-        self.run_js_test(self.jsFile)
-
-    def get_test_class_name(self):
-        # returns a dot separated folders as class name
-        dirname = os.path.dirname(self.jsFile).replace('\\', '/')
-        if dirname.startswith('/'):
-            dirname = dirname[1:]
-        return '.'.join(dirname.split('/'))
-
-    def get_test_method_name(self):
-        # returns the js filename without extension as method name
-        return os.path.splitext(os.path.basename(self.jsFile))[0]
deleted file mode 100644
--- a/testing/marionette/harness/session/tests/test_session.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# 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 itertools
-
-from marionette_driver import errors
-from session.session_test import SessionTestCase as TC
-
-
-class TestHelloWorld(TC):
-    def setUp(self):
-        TC.setUp(self)
-
-    def tearDown(self):
-        TC.tearDown(self)
-
-    def test_malformed_packet(self):
-        req = ["error", "message", "stacktrace"]
-        ps = []
-        for p in [p for i in range(0, len(req) + 1) for p in itertools.permutations(req, i)]:
-            ps.append(dict((x, None) for x in p))
-
-        for p in filter(lambda p: len(p) < 3, ps):
-            self.assertRaises(KeyError, self.marionette._handle_error, p)
-
-    def test_known_error_code(self):
-        with self.assertRaises(errors.NoSuchElementException):
-            self.marionette._handle_error(
-                {"error": errors.NoSuchElementException.code[0],
-                 "message": None,
-                 "stacktrace": None})
-
-    def test_known_error_status(self):
-        with self.assertRaises(errors.NoSuchElementException):
-            self.marionette._handle_error(
-                {"error": errors.NoSuchElementException.status,
-                 "message": None,
-                 "stacktrace": None})
-
-    def test_unknown_error_code(self):
-        with self.assertRaises(errors.MarionetteException):
-            self.marionette._handle_error(
-                {"error": 123456,
-                 "message": None,
-                 "stacktrace": None})
-
-    def test_unknown_error_status(self):
-        with self.assertRaises(errors.MarionetteException):
-            self.marionette._handle_error(
-                {"error": "barbera",
-                 "message": None,
-                 "stacktrace": None})
deleted file mode 100644
--- a/testing/marionette/harness/session/tests/unit-tests.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-; session unit tests
-[test_session.py]
--- a/testing/marionette/mach_commands.py
+++ b/testing/marionette/mach_commands.py
@@ -57,60 +57,16 @@ def run_marionette(tests, binary=None, t
                                             args,
                                             {"mach": sys.stdout})
     failed = MarionetteHarness(MarionetteTestRunner, args=vars(args)).run()
     if failed > 0:
         return 1
     else:
         return 0
 
-def setup_session_argument_parser():
-    from session.runner.base import BaseSessionArguments
-    return BaseSessionArguments()
-
-def run_session(tests, testtype=None, address=None, binary=None, topsrcdir=None, **kwargs):
-    from mozlog.structured import commandline
-
-    from marionette.runtests import (
-        MarionetteHarness
-    )
-
-    from session.runtests import (
-        SessionTestRunner,
-        BaseSessionArguments,
-        SessionArguments,
-        SessionTestCase,
-    )
-
-    parser = BaseSessionArguments()
-    commandline.add_logging_group(parser)
-
-    if not tests:
-        tests = [os.path.join(topsrcdir,
-                 'testing/marionette/harness/session/tests/unit-tests.ini')]
-
-    args = argparse.Namespace(tests=tests)
-
-    args.binary = binary
-
-    for k, v in kwargs.iteritems():
-        setattr(args, k, v)
-
-    parser.verify_usage(args)
-
-    args.logger = commandline.setup_logging("Session Unit Tests",
-                                            args,
-                                            {"mach": sys.stdout})
-    failed = MarionetteHarness(runner_class=SessionTestRunner, parser_class=SessionArguments,
-                               testcase_class=SessionTestCase, args=vars(args)).run()
-    if failed > 0:
-        return 1
-    else:
-        return 0
-
 @CommandProvider
 class B2GCommands(MachCommandBase):
     def __init__(self, context):
         MachCommandBase.__init__(self, context)
 
         for attr in ('b2g_home', 'device_name'):
             setattr(self, attr, getattr(context, attr, None))
     @Command('marionette-webapi', category='testing',
@@ -149,24 +105,8 @@ class MachCommands(MachCommandBase):
             tests = []
             for obj in kwargs['test_objects']:
                 tests.append(obj['file_relpath'])
             del kwargs['test_objects']
 
         if not kwargs.get('binary') and conditions.is_firefox(self):
             kwargs['binary'] = self.get_binary_path('app')
         return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
-
-    @Command('session-test', category='testing',
-        description='Run a Session test (Check Telemetry using marionette).',
-        conditions=[conditions.is_firefox],
-        parser=setup_session_argument_parser,
-    )
-    def run_session_test(self, tests, **kwargs):
-        if 'test_objects' in kwargs:
-            tests = []
-            for obj in kwargs['test_objects']:
-                tests.append(obj['file_relpath'])
-            del kwargs['test_objects']
-
-        if not kwargs.get('binary') and conditions.is_firefox(self):
-            kwargs['binary'] = self.get_binary_path('app')
-        return run_session(tests, topsrcdir=self.topsrcdir, **kwargs)