Bug 1308202 - Remove all b2g and mulet related code from testing/mochitest, r=jmaher
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Thu, 06 Oct 2016 10:05:27 -0400
changeset 317052 5c28890906c347d9aa96c8b6a30004c1dad9d040
parent 317051 2f462ac4c8e4a0fda8696ba3676b6d2dea8f0598
child 317053 8e1e90f2494760d1b2d599cce518c9c128040be6
push id20681
push userphilringnalda@gmail.com
push dateSat, 08 Oct 2016 23:57:20 +0000
treeherderfx-team@7a7ba250bb2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1308202
milestone52.0a1
Bug 1308202 - Remove all b2g and mulet related code from testing/mochitest, r=jmaher MozReview-Commit-ID: BfIJLp6oGHO
testing/mochitest/browser-test.js
testing/mochitest/chrome/chrome.ini
testing/mochitest/mach_commands.py
testing/mochitest/manifestLibrary.js
testing/mochitest/mochitest_options.py
testing/mochitest/moz.build
testing/mochitest/runtests.py
testing/mochitest/runtestsb2g.py
testing/mochitest/runtestsremote.py
testing/mochitest/start_b2g.js
testing/mochitest/tests/Harness_sanity/mochitest.ini
testing/mochitest/tests/MochiKit-1.4.2/tests/mochitest.ini
testing/mochitest/tests/SimpleTest/SimpleTest.js
testing/profiles/moz.build
testing/profiles/prefs_b2g_unittest.js
--- a/testing/mochitest/browser-test.js
+++ b/testing/mochitest/browser-test.js
@@ -25,25 +25,16 @@ if (Services.appinfo.OS == 'Android') {
       window.removeEventListener("MozAfterPaint", testOnMozAfterPaint);
       setTimeout(testInit, 0);
     });
   });
 } else {
   setTimeout(testInit, 0);
 }
 
-function b2gStart() {
-  let homescreen = document.getElementById('systemapp');
-  var webNav = homescreen.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
-                                   .getInterface(Ci.nsIWebNavigation);
-  var url = "chrome://mochikit/content/harness.xul?manifestFile=tests.json";
-
-  webNav.loadURI(url, null, null, null, null);
-}
-
 var TabDestroyObserver = {
   outstanding: new Set(),
   promiseResolver: null,
 
   init: function() {
     Services.obs.addObserver(this, "message-manager-close", false);
     Services.obs.addObserver(this, "message-manager-disconnect", false);
   },
--- a/testing/mochitest/chrome/chrome.ini
+++ b/testing/mochitest/chrome/chrome.ini
@@ -1,18 +1,16 @@
 [DEFAULT]
-skip-if = buildapp == 'b2g' || os == 'android'
+skip-if = os == 'android'
 support-files = test-dir/test-file
 
 [test_sample.xul]
 [test_sanityAddTask.xul]
 [test_sanityEventUtils.xul]
-skip-if = buildapp == 'mulet'
 [test_sanityPluginUtils.html]
-skip-if = buildapp == 'mulet'
 [test_sanityException.xul]
 [test_sanityException2.xul]
 [test_sanityManifest.xul]
 fail-if = true
 [test_sanityManifest_pf.xul]
 fail-if = true
 [test_sanitySpawnTask.xul]
 [test_chromeGetTestFile.xul]
--- a/testing/mochitest/mach_commands.py
+++ b/testing/mochitest/mach_commands.py
@@ -18,17 +18,16 @@ from mozbuild.base import (
     MozbuildObject,
 )
 
 from mach.decorators import (
     CommandArgument,
     CommandProvider,
     Command,
 )
-import mozpack.path as mozpath
 
 here = os.path.abspath(os.path.dirname(__file__))
 
 
 ENG_BUILD_REQUIRED = '''
 The mochitest command requires an engineering build. It may be the case that
 VARIANT=user or PRODUCTION=1 were set. Try re-building with VARIANT=eng:
 
@@ -77,25 +76,25 @@ NOW_RUNNING = '''
 '''
 
 
 # Maps test flavors to data needed to run them
 ALL_FLAVORS = {
     'mochitest': {
         'suite': 'plain',
         'aliases': ('plain', 'mochitest'),
-        'enabled_apps': ('firefox', 'b2g', 'android', 'mulet'),
+        'enabled_apps': ('firefox', 'android'),
         'extra_args': {
             'flavor': 'plain',
         }
     },
     'chrome': {
         'suite': 'chrome',
         'aliases': ('chrome', 'mochitest-chrome'),
-        'enabled_apps': ('firefox', 'mulet', 'b2g', 'android'),
+        'enabled_apps': ('firefox', 'android'),
         'extra_args': {
             'flavor': 'chrome',
         }
     },
     'browser-chrome': {
         'suite': 'browser',
         'aliases': ('browser', 'browser-chrome', 'mochitest-browser-chrome', 'bc'),
         'enabled_apps': ('firefox',),
@@ -124,17 +123,17 @@ ALL_FLAVORS = {
         'aliases': ('a11y', 'mochitest-a11y', 'accessibility'),
         'enabled_apps': ('firefox',),
         'extra_args': {
             'flavor': 'a11y',
         }
     },
 }
 
-SUPPORTED_APPS = ['firefox', 'b2g', 'android', 'mulet']
+SUPPORTED_APPS = ['firefox', 'android']
 SUPPORTED_FLAVORS = list(chain.from_iterable([f['aliases'] for f in ALL_FLAVORS.values()]))
 CANONICAL_FLAVORS = sorted([f['aliases'][0] for f in ALL_FLAVORS.values()])
 
 parser = None
 
 
 class MochitestRunner(MozbuildObject):
 
@@ -163,51 +162,16 @@ class MochitestRunner(MozbuildObject):
         if test_objects:
             return test_objects
 
         from mozbuild.testing import TestResolver
         resolver = self._spawn(TestResolver)
         tests = list(resolver.resolve_tests(paths=test_paths, cwd=cwd))
         return tests
 
-    def run_b2g_test(self, context, tests=None, suite='mochitest', **kwargs):
-        """Runs a b2g mochitest."""
-        if context.target_out:
-            host_webapps_dir = os.path.join(context.target_out, 'data', 'local', 'webapps')
-            if not os.path.isdir(os.path.join(
-                    host_webapps_dir, 'test-container.gaiamobile.org')):
-                print(ENG_BUILD_REQUIRED.format(host_webapps_dir))
-                sys.exit(1)
-
-        # TODO without os.chdir, chained imports fail below
-        os.chdir(self.mochitest_dir)
-
-        # The imp module can spew warnings if the modules below have
-        # already been imported, ignore them.
-        with warnings.catch_warnings():
-            warnings.simplefilter('ignore')
-
-            import imp
-            path = os.path.join(self.mochitest_dir, 'runtestsb2g.py')
-            with open(path, 'r') as fh:
-                imp.load_module('mochitest', fh, path,
-                                ('.py', 'r', imp.PY_SOURCE))
-
-            import mochitest
-
-        options = Namespace(**kwargs)
-
-        from manifestparser import TestManifest
-        if tests and not options.manifestFile:
-            manifest = TestManifest()
-            manifest.tests.extend(tests)
-            options.manifestFile = manifest
-
-        return mochitest.run_test_harness(parser, options)
-
     def run_desktop_test(self, context, tests=None, suite=None, **kwargs):
         """Runs a mochitest.
 
         suite is the type of mochitest to run. It can be one of ('plain',
         'chrome', 'browser', 'a11y', 'jetpack-package', 'jetpack-addon').
         """
         # runtests.py is ambiguous, so we load the file/module manually.
         if 'mochitest' not in sys.modules:
@@ -390,30 +354,16 @@ class MachCommands(MachCommandBase):
             flavors = [f for f, v in ALL_FLAVORS.iteritems() if buildapp in v['enabled_apps']]
 
         from mozbuild.controller.building import BuildDriver
         self._ensure_state_subdir_exists('.')
 
         test_paths = kwargs['test_paths']
         kwargs['test_paths'] = []
 
-        if test_paths and buildapp == 'b2g':
-            # In B2G there is often a 'gecko' directory, though topsrcdir is actually
-            # elsewhere. This little hack makes test paths like 'gecko/dom' work, even if
-            # GECKO_PATH is set in the .userconfig
-            gecko_path = mozpath.abspath(mozpath.join(kwargs['b2gPath'], 'gecko'))
-            if gecko_path != self.topsrcdir:
-                new_paths = []
-                for tp in test_paths:
-                    if mozpath.abspath(tp).startswith(gecko_path):
-                        new_paths.append(mozpath.relpath(tp, gecko_path))
-                    else:
-                        new_paths.append(tp)
-                test_paths = new_paths
-
         mochitest = self._spawn(MochitestRunner)
         tests = []
         if resolve_tests:
             tests = mochitest.resolve_tests(test_paths, test_objects, cwd=self._mach_context.cwd)
 
         driver = self._spawn(BuildDriver)
         driver.install_tests(tests)
 
@@ -471,19 +421,17 @@ class MachCommands(MachCommandBase):
                     reason = 'requires {}'.format(' or '.join(apps))
                 else:
                     reason = 'excluded by the command line'
                 msg.append('    mochitest -f {} ({})'.format(name, reason))
             print(SUPPORTED_TESTS_NOT_FOUND.format(
                 buildapp, '\n'.join(sorted(msg))))
             return 1
 
-        if buildapp in ('b2g',):
-            run_mochitest = mochitest.run_b2g_test
-        elif buildapp == 'android':
+        if buildapp == 'android':
             from mozrunner.devices.android_device import grant_runtime_permissions
             grant_runtime_permissions(self)
             run_mochitest = mochitest.run_android_test
         else:
             run_mochitest = mochitest.run_desktop_test
 
         overall = None
         for (flavor, subsuite), tests in sorted(suites.items()):
--- a/testing/mochitest/manifestLibrary.js
+++ b/testing/mochitest/manifestLibrary.js
@@ -3,17 +3,17 @@
 /* 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/. */
 
 function parseTestManifest(testManifest, params, callback) {
   var links = {};
   var paths = [];
 
-  // Support --test-manifest format for mobile/b2g
+  // Support --test-manifest format for mobile
   if ("runtests" in testManifest || "excludetests" in testManifest) {
     callback(testManifest);
     return;
   }
 
   // For mochitest-chrome and mochitest-browser-chrome harnesses, we 
   // define tests as links[testname] = true.
   // For mochitest-plain, we define lists as an array of testnames.
--- a/testing/mochitest/mochitest_options.py
+++ b/testing/mochitest/mochitest_options.py
@@ -561,18 +561,18 @@ class MochitestArguments(ArgumentContain
     def validate(self, parser, options, context):
         """Validate generic options."""
 
         # for test manifest parsing.
         mozinfo.update({"strictContentSandbox": options.strictContentSandbox})
         # for test manifest parsing.
         mozinfo.update({"nested_oop": options.nested_oop})
 
-        # b2g and android don't use 'app' the same way, so skip validation
-        if parser.app not in ('b2g', 'android'):
+        # and android doesn't use 'app' the same way, so skip validation
+        if parser.app != 'android':
             if options.app is None:
                 if build_obj:
                     options.app = build_obj.get_binary_path()
                 else:
                     parser.error(
                         "could not find the application path, --appname must be specified")
             elif options.app == "dist" and build_obj:
                 options.app = build_obj.get_binary_path(where='staged-package')
@@ -784,189 +784,16 @@ class MochitestArguments(ArgumentContain
         if options.test_paths and build_obj:
             # Normalize test paths so they are relative to test root
             options.test_paths = [build_obj._wrap_path_argument(p).relpath()
                                   for p in options.test_paths]
 
         return options
 
 
-class B2GArguments(ArgumentContainer):
-    """B2G specific arguments."""
-
-    args = [
-        [["--b2gpath"],
-         {"dest": "b2gPath",
-          "default": None,
-          "help": "Path to B2G repo or QEMU directory.",
-          "suppress": True,
-          }],
-        [["--emulator"],
-         {"default": None,
-          "help": "Architecture of emulator to use, x86 or arm",
-          "suppress": True,
-          }],
-        [["--wifi"],
-         {"default": False,
-          "help": "Devine wifi configuration for on device mochitest",
-          "suppress": True,
-          }],
-        [["--sdcard"],
-         {"default": "10MB",
-          "help": "Define size of sdcard: 1MB, 50MB...etc",
-          }],
-        [["--no-window"],
-         {"action": "store_true",
-          "dest": "noWindow",
-          "default": False,
-          "help": "Pass --no-window to the emulator",
-          }],
-        [["--adbpath"],
-         {"dest": "adbPath",
-          "default": None,
-          "help": "Path to adb binary.",
-          "suppress": True,
-          }],
-        [["--deviceIP"],
-         {"dest": "deviceIP",
-          "default": None,
-          "help": "IP address of remote device to test.",
-          "suppress": True,
-          }],
-        [["--devicePort"],
-         {"default": 20701,
-          "help": "port of remote device to test",
-          "suppress": True,
-          }],
-        [["--remote-logfile"],
-         {"dest": "remoteLogFile",
-          "default": None,
-          "help": "Name of log file on the device relative to the device root. "
-                  "PLEASE ONLY USE A FILENAME.",
-          "suppress": True,
-          }],
-        [["--remote-webserver"],
-         {"dest": "remoteWebServer",
-          "default": None,
-          "help": "IP address where the remote web server is hosted.",
-          "suppress": True,
-          }],
-        [["--http-port"],
-         {"dest": "httpPort",
-          "default": DEFAULT_PORTS['http'],
-          "help": "Port used for http on the remote web server.",
-          "suppress": True,
-          }],
-        [["--ssl-port"],
-         {"dest": "sslPort",
-          "default": DEFAULT_PORTS['https'],
-          "help": "Port used for https on the remote web server.",
-          "suppress": True,
-          }],
-        [["--gecko-path"],
-         {"dest": "geckoPath",
-          "default": None,
-          "help": "The path to a gecko distribution that should be installed on the emulator "
-                  "prior to test.",
-          "suppress": True,
-          }],
-        [["--logdir"],
-         {"dest": "logdir",
-          "default": None,
-          "help": "Directory to store log files.",
-          }],
-        [['--busybox'],
-         {"dest": 'busybox',
-          "default": None,
-          "help": "Path to busybox binary to install on device.",
-          }],
-        [['--profile-data-dir'],
-         {"dest": 'profile_data_dir',
-          "default": os.path.join(here, 'profile_data'),
-          "help": "Path to a directory containing preference and other data to be installed "
-                  "into the profile.",
-          "suppress": True,
-          }],
-    ]
-
-    defaults = {
-        'logFile': 'mochitest.log',
-        # Specialpowers is integrated with marionette for b2g,
-        # see marionette's jar.mn.
-        'extensionsToExclude': ['specialpowers'],
-        # mochijar doesn't get installed via marionette on android
-        'extensionsToInstall': [os.path.join(here, 'mochijar')],
-        # See dependencies of bug 1038943.
-        'defaultLeakThreshold': 5536,
-    }
-
-    def validate(self, parser, options, context):
-        """Validate b2g options."""
-
-        if options.remoteWebServer is None:
-            if os.name != "nt":
-                options.remoteWebServer = moznetwork.get_ip()
-            else:
-                parser.error(
-                    "You must specify a --remote-webserver=<ip address>")
-        options.webServer = options.remoteWebServer
-
-        if not options.b2gPath and hasattr(context, 'b2g_home'):
-            options.b2gPath = context.b2g_home
-
-        if hasattr(context, 'device_name') and not options.emulator:
-            if context.device_name.startswith('emulator'):
-                options.emulator = 'x86' if 'x86' in context.device_name else 'arm'
-
-        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")
-        elif not options.logdir and options.emulator and build_obj:
-            options.logdir = os.path.join(
-                build_obj.topobjdir, '_tests', 'testing', 'mochitest')
-
-        if hasattr(context, 'xre_path'):
-            options.xrePath = context.xre_path
-
-        if not os.path.isdir(options.xrePath):
-            parser.error("--xre-path '%s' is not a directory" % options.xrePath)
-
-        xpcshell = os.path.join(options.xrePath, 'xpcshell')
-        if not os.access(xpcshell, os.F_OK):
-            parser.error('xpcshell not found at %s' % xpcshell)
-
-        if self.elf_arm(xpcshell):
-            parser.error('--xre-path points to an ARM version of xpcshell; it '
-                         'should instead point to a version that can run on '
-                         'your desktop')
-
-        if not options.httpdPath and build_obj:
-            options.httpdPath = os.path.join(
-                build_obj.topobjdir, '_tests', 'testing', 'mochitest')
-
-        # Bug 1071866 - B2G Mochitests do not always produce a leak log.
-        options.ignoreMissingLeaks.append("default")
-        # Bug 1070068 - Leak logging does not work for tab processes on B2G.
-        options.ignoreMissingLeaks.append("tab")
-
-        if options.pidFile != "":
-            f = open(options.pidFile, 'w')
-            f.write("%s" % os.getpid())
-            f.close()
-
-        return options
-
-    def elf_arm(self, filename):
-        data = open(filename, 'rb').read(20)
-        return data[:4] == "\x7fELF" and ord(data[18]) == 40  # EM_ARM
-
-
 class AndroidArguments(ArgumentContainer):
     """Android specific arguments."""
 
     args = [
         [["--remote-app-path"],
          {"dest": "remoteAppPath",
           "help": "Path to remote executable relative to device root using \
                    only forward slashes. Either this or app must be specified \
@@ -1155,17 +982,16 @@ class AndroidArguments(ArgumentContainer
         # allow us to keep original application around for cleanup while
         # running robocop via 'am'
         options.remoteappname = options.app
         return options
 
 
 container_map = {
     'generic': [MochitestArguments],
-    'b2g': [MochitestArguments, B2GArguments],
     'android': [MochitestArguments, AndroidArguments],
 }
 
 
 class MochitestArgumentParser(ArgumentParser):
     """%(prog)s [options] [test paths]"""
 
     _containers = None
@@ -1174,18 +1000,16 @@ class MochitestArgumentParser(ArgumentPa
     def __init__(self, app=None, **kwargs):
         ArgumentParser.__init__(self, usage=self.__doc__, conflict_handler='resolve', **kwargs)
 
         self.oldcwd = os.getcwd()
         self.app = app
         if not self.app and build_obj:
             if conditions.is_android(build_obj):
                 self.app = 'android'
-            elif conditions.is_b2g(build_obj):
-                self.app = 'b2g'
         if not self.app:
             # platform can't be determined and app wasn't specified explicitly,
             # so just use generic arguments and hope for the best
             self.app = 'generic'
 
         if self.app not in container_map:
             self.error("Unrecognized app '{}'! Must be one of: {}".format(
                 self.app, ', '.join(container_map.keys())))
--- a/testing/mochitest/moz.build
+++ b/testing/mochitest/moz.build
@@ -58,20 +58,18 @@ TEST_HARNESS_FILES.testing.mochitest += 
     'manifest.webapp',
     'manifestLibrary.js',
     'mochitest_options.py',
     'nested_setup.js',
     'pywebsocket_wrapper.py',
     'redirect.html',
     'runrobocop.py',
     'runtests.py',
-    'runtestsb2g.py',
     'runtestsremote.py',
     'server.js',
-    'start_b2g.js',
     'start_desktop.js',
 ]
 
 TEST_HARNESS_FILES.testing.mochitest.embed += [
     'embed/Xm5i5kbIXzc',
     'embed/Xm5i5kbIXzc^headers^',
 ]
 
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -514,17 +514,17 @@ class WebSocketServer(object):
         self._log.info("runtests.py | Websocket server pid: %d" % pid)
 
     def stop(self):
         self._process.kill()
 
 
 class MochitestBase(object):
     """
-    Base mochitest class for both desktop and b2g.
+    Base mochitest class for desktop.
     """
 
     oldcwd = os.getcwd()
     mochijar = os.path.join(SCRIPT_DIR, 'mochijar')
 
     # Path to the test script on the server
     TEST_PATH = "tests"
     NESTED_OOP_TEST_PATH = "nested_oop"
@@ -1514,17 +1514,17 @@ def parseKeyValue(strings, separator='='
         raise KeyValueParseError(
             "Error: syntax error in %s" %
             (context, ','.join(missing)), errors=missing)
     return [string.split(separator, 1) for string in strings]
 
 
 class MochitestDesktop(MochitestBase):
     """
-    Mochitest class for desktop firefox and mulet.
+    Mochitest class for desktop firefox.
     """
     certdbNew = False
     sslTunnel = None
     DEFAULT_TIMEOUT = 60.0
     mediaDevices = None
 
     # XXX use automation.py for test name to avoid breaking legacy
     # TODO: replace this with 'runtests.py' or 'mochitest' or the like
@@ -1579,17 +1579,17 @@ class MochitestDesktop(MochitestBase):
         if mozinfo.info["asan"]:
             # Disable leak checking when running these tools
             toolsEnv["ASAN_OPTIONS"] = "detect_leaks=0"
         if mozinfo.info["tsan"]:
             # Disable race checking when running these tools
             toolsEnv["TSAN_OPTIONS"] = "report_bugs=0"
 
         if self.certdbNew:
-            # android and b2g use the new DB formats exclusively
+            # android uses the new DB formats exclusively
             certdbPath = "sql:" + options.profilePath
         else:
             # desktop seems to use the old
             certdbPath = options.profilePath
 
         status = call(
             [certutil, "-N", "-d", certdbPath, "-f", pwfilePath], env=toolsEnv)
         if status:
@@ -1656,42 +1656,32 @@ class MochitestDesktop(MochitestBase):
 
         # preferences
         preferences = [
             os.path.join(
                 SCRIPT_DIR,
                 'profile_data',
                 'prefs_general.js')]
 
-        # TODO: Let's include those prefs until bug 1072443 is fixed
-        if mozinfo.info.get('buildapp') == 'mulet':
-            preferences += [os.path.join(SCRIPT_DIR,
-                                         'profile_data',
-                                         'prefs_b2g_unittest.js')]
-
         prefs = {}
         for path in preferences:
             prefs.update(Preferences.read_prefs(path))
 
         prefs.update(self.extraPrefs(options.extraPrefs))
 
         # Bug 1262954: For windows XP + e10s disable acceleration
         if platform.system() in ("Windows", "Microsoft") and \
            '5.1' in platform.version() and options.e10s:
             prefs['layers.acceleration.disabled'] = True
 
         # interpolate preferences
         interpolation = {
             "server": "%s:%s" %
             (options.webServer, options.httpPort)}
 
-        # TODO: Remove OOP once bug 1072443 is fixed
-        if mozinfo.info.get('buildapp') == 'mulet':
-            interpolation["OOP"] = "false"
-
         prefs = json.loads(json.dumps(prefs) % interpolation)
         for pref in prefs:
             prefs[pref] = Preferences.cast(prefs[pref])
         # TODO: make this less hacky
         # https://bugzilla.mozilla.org/show_bug.cgi?id=913152
 
         # proxy
         # use SSL port for legacy compatibility; see
@@ -1993,27 +1983,21 @@ class MochitestDesktop(MochitestBase):
                          'cwd': SCRIPT_DIR,
                          'onTimeout': [timeoutHandler]}
             kp_kwargs['processOutputLine'] = [outputHandler]
 
             # create mozrunner instance and start the system under test process
             self.lastTestSeen = self.test_name
             startTime = datetime.now()
 
-            # b2g desktop requires Runner even though appname is b2g
-            if mozinfo.info.get('appname') == 'b2g' and mozinfo.info.get(
-                    'toolkit') != 'gonk':
-                runner_cls = mozrunner.Runner
-            else:
-                runner_cls = mozrunner.runners.get(
-                    mozinfo.info.get(
-                        'appname',
-                        'firefox'),
-                    mozrunner.Runner)
-
+            runner_cls = mozrunner.runners.get(
+                mozinfo.info.get(
+                    'appname',
+                    'firefox'),
+                mozrunner.Runner)
             runner = runner_cls(profile=self.profile,
                                 binary=cmd,
                                 cmdargs=args,
                                 env=env,
                                 process_class=mozprocess.ProcessHandlerMixin,
                                 process_args=kp_kwargs)
 
             # start the runner
@@ -2321,24 +2305,16 @@ class MochitestDesktop(MochitestBase):
         self.leak_report_file = os.path.join(
             options.profilePath,
             "runtests_leaks.log")
 
         self.browserEnv = self.buildBrowserEnv(
             options,
             debuggerInfo is not None)
 
-        # If there are any Mulet-specific tests doing remote network access,
-        # we will not be aware since we are explicitely allowing this, as for
-        # B2G
-        if 'MOZ_DISABLE_NONLOCAL_CONNECTIONS' in self.browserEnv:
-            if mozinfo.info.get('buildapp') == 'mulet':
-                del self.browserEnv['MOZ_DISABLE_NONLOCAL_CONNECTIONS']
-                os.environ["MOZ_DISABLE_NONLOCAL_CONNECTIONS"] = "0"
-
         if self.browserEnv is None:
             return 1
 
         if self.mozLogs:
             self.browserEnv["MOZ_LOG_FILE"] = "{}/moz-pid=%PID-uid={}.log".format(
                 self.browserEnv["MOZ_UPLOAD_DIR"], str(uuid.uuid4()))
 
         try:
@@ -2689,19 +2665,16 @@ def run_test_harness(parser, options):
 
     runner = MochitestDesktop(logger_options)
 
     options.runByDir = False
 
     if options.flavor in ('plain', 'browser', 'chrome'):
         options.runByDir = True
 
-    if mozinfo.info.get('buildapp') == 'mulet':
-        options.runByDir = False
-
     result = runner.runTests(options)
 
     if runner.mozLogs:
         with zipfile.ZipFile("{}/mozLogs.zip".format(runner.browserEnv["MOZ_UPLOAD_DIR"]),
                              "w", zipfile.ZIP_DEFLATED) as logzip:
             for logfile in glob.glob("{}/moz*.log*".format(runner.browserEnv["MOZ_UPLOAD_DIR"])):
                 logzip.write(logfile)
                 os.remove(logfile)
deleted file mode 100644
--- a/testing/mochitest/runtestsb2g.py
+++ /dev/null
@@ -1,423 +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 json
-import os
-import posixpath
-import sys
-import tempfile
-import traceback
-
-here = os.path.abspath(os.path.dirname(__file__))
-sys.path.insert(0, here)
-
-from runtests import MochitestBase
-from mochitest_options import MochitestArgumentParser
-from marionette import Marionette
-from mozprofile import Profile, Preferences
-from mozrunner.utils import get_stack_fixer_function
-import mozinfo
-import mozleak
-
-
-class MochitestB2G(MochitestBase):
-    """
-    Mochitest class for b2g emulators and devices.
-    """
-    marionette = None
-    remote_log = None
-
-    def __init__(self, marionette_args,
-                 logger_options,
-                 profile_data_dir,
-                 local_binary_dir,
-                 locations=os.path.join(here, 'server-locations.txt'),
-                 out_of_process=True,
-                 remote_test_root=None,
-                 remote_log_file=None):
-        MochitestBase.__init__(self, logger_options)
-        self.marionette_args = marionette_args
-        self.out_of_process = out_of_process
-        self.locations_file = locations
-        self.preferences = []
-        self.webapps = None
-        self.start_script = os.path.join(here, 'start_b2g.js')
-        self.start_script_args = [self.out_of_process]
-        self.product = 'b2g'
-        self.remote_chrome_test_dir = None
-        self.local_log = None
-        self.local_binary_dir = local_binary_dir
-
-        self.preferences = [
-            os.path.join(
-                profile_data_dir,
-                f) for f in os.listdir(profile_data_dir) if f.startswith('pref')]
-        self.webapps = [
-            os.path.join(
-                profile_data_dir,
-                f) for f in os.listdir(profile_data_dir) if f.startswith('webapp')]
-
-        # mozinfo is populated by the parent class
-        if mozinfo.info['debug']:
-            self.SERVER_STARTUP_TIMEOUT = 180
-        else:
-            self.SERVER_STARTUP_TIMEOUT = 90
-
-    def buildTestPath(self, options, testsToFilter=None):
-        if options.manifestFile != 'tests.json':
-            MochitestBase.buildTestPath(self, options, testsToFilter, disabled=False)
-        return self.buildTestURL(options)
-
-    def build_profile(self, options):
-        # preferences
-        prefs = {}
-        for path in self.preferences:
-            prefs.update(Preferences.read_prefs(path))
-
-        for v in options.extraPrefs:
-            thispref = v.split("=", 1)
-            if len(thispref) < 2:
-                print "Error: syntax error in --setpref=" + v
-                sys.exit(1)
-            prefs[thispref[0]] = thispref[1]
-
-        # interpolate the preferences
-        interpolation = {
-            "server": "%s:%s" %
-            (options.webServer,
-             options.httpPort),
-            "OOP": "true" if self.out_of_process else "false"}
-        prefs = json.loads(json.dumps(prefs) % interpolation)
-        for pref in prefs:
-            prefs[pref] = Preferences.cast(prefs[pref])
-
-        kwargs = {
-            'addons': self.getExtensionsToInstall(options),
-            'apps': self.webapps,
-            'locations': self.locations_file,
-            'preferences': prefs,
-            'proxy': {"remote": options.webServer}
-        }
-
-        self.profile = Profile(**kwargs)
-        options.profilePath = self.profile.profile
-        # TODO bug 839108 - mozprofile should probably handle this
-        manifest = self.addChromeToProfile(options)
-        self.copyExtraFilesToProfile(options)
-        return manifest
-
-    def run_tests(self, options):
-        """ Prepare, configure, run tests and cleanup """
-
-        self.setTestRoot(options)
-
-        manifest = self.build_profile(options)
-        self.logPreamble(self.getActiveTests(options))
-
-        # configuring the message logger's buffering
-        self.message_logger.buffering = options.quiet
-
-        if options.debugger or not options.autorun:
-            timeout = None
-        else:
-            if not options.timeout:
-                if mozinfo.info['debug']:
-                    options.timeout = 420
-                else:
-                    options.timeout = 300
-            timeout = options.timeout + 30.0
-
-        self.log.info("runtestsb2g.py | Running tests: start.")
-        status = 0
-        try:
-            def on_output(line):
-                messages = self.message_logger.write(line)
-                for message in messages:
-                    if message['action'] == 'test_start':
-                        self.runner.last_test = message['test']
-
-            # The logging will be handled by on_output, so we set the stream to
-            # None
-            process_args = {'processOutputLine': on_output,
-                            'stream': None}
-            self.marionette_args['process_args'] = process_args
-            self.marionette_args['profile'] = self.profile
-            # Increase the timeout to fix bug 1208725
-            self.marionette_args['socket_timeout'] = 720
-
-            self.marionette = Marionette(**self.marionette_args)
-            self.runner = self.marionette.runner
-            self.app_ctx = self.runner.app_ctx
-
-            self.remote_log = posixpath.join(self.app_ctx.remote_test_root,
-                                             'log', 'mochitest.log')
-            if not self.app_ctx.dm.dirExists(
-                posixpath.dirname(
-                    self.remote_log)):
-                self.app_ctx.dm.mkDirs(self.remote_log)
-
-            if options.flavor == 'chrome':
-                # Update chrome manifest file in profile with correct path.
-                self.writeChromeManifest(options)
-
-            self.leak_report_file = posixpath.join(
-                self.app_ctx.remote_test_root,
-                'log',
-                'runtests_leaks.log')
-
-            # We don't want to copy the host env onto the device, so pass in an
-            # empty env.
-            self.browserEnv = self.buildBrowserEnv(options, env={})
-
-            # B2G emulator debug tests still make external connections, so don't
-            # pass MOZ_DISABLE_NONLOCAL_CONNECTIONS to them for now (bug
-            # 1039019).
-            if mozinfo.info[
-                    'debug'] and 'MOZ_DISABLE_NONLOCAL_CONNECTIONS' in self.browserEnv:
-                del self.browserEnv['MOZ_DISABLE_NONLOCAL_CONNECTIONS']
-            self.runner.env.update(self.browserEnv)
-
-            # Despite our efforts to clean up servers started by this script, in practice
-            # we still see infrequent cases where a process is orphaned and interferes
-            # with future tests, typically because the old server is keeping the port in use.
-            # Try to avoid those failures by checking for and killing orphan servers before
-            # trying to start new ones.
-            self.killNamedOrphans('ssltunnel')
-            self.killNamedOrphans('xpcshell')
-
-            self.startServers(options, None)
-
-            # In desktop mochitests buildTestPath is called before buildURLOptions. This
-            # means options.manifestFile has already been converted to the proper json
-            # style manifest. Not so with B2G, that conversion along with updating the URL
-            # option will happen later. So backup and restore options.manifestFile to
-            # prevent us from trying to pass in an instance of TestManifest via url param.
-            manifestFile = options.manifestFile
-            options.manifestFile = None
-            self.buildURLOptions(options, {'MOZ_HIDE_RESULTS_TABLE': '1'})
-            options.manifestFile = manifestFile
-
-            self.start_script_args.append(not options.emulator)
-            self.start_script_args.append(options.wifi)
-            self.start_script_args.append(options.flavor == 'chrome')
-
-            self.runner.start(outputTimeout=timeout)
-
-            self.marionette.wait_for_port()
-            self.marionette.start_session()
-            self.marionette.set_context(self.marionette.CONTEXT_CHROME)
-
-            # Disable offline status management (bug 777145), otherwise the network
-            # will be 'offline' when the mochitests start.  Presumably, the network
-            # won't be offline on a real device, so we only do this for
-            # emulators.
-            self.marionette.execute_script("""
-                Components.utils.import("resource://gre/modules/Services.jsm");
-                Services.io.manageOfflineStatus = false;
-                Services.io.offline = false;
-                """)
-
-            self.marionette.execute_script("""
-                let SECURITY_PREF = "security.turn_off_all_security_" +
-                                    "so_that_viruses_can_take_over_this_computer";
-                Services.prefs.setBoolPref(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();
-                }
-                """)
-
-            if options.flavor == 'chrome':
-                self.app_ctx.dm.removeDir(self.remote_chrome_test_dir)
-                self.app_ctx.dm.mkDir(self.remote_chrome_test_dir)
-                local = MochitestBase.getChromeTestDir(self, options)
-                local = os.path.join(local, "chrome")
-                remote = self.remote_chrome_test_dir
-                self.log.info(
-                    "pushing %s to %s on device..." %
-                    (local, remote))
-                self.app_ctx.dm.pushDir(local, remote)
-
-            self.execute_start_script()
-            status = self.runner.wait()
-
-            if status is None:
-                # the runner has timed out
-                status = 124
-
-            local_leak_file = tempfile.NamedTemporaryFile()
-            self.app_ctx.dm.getFile(
-                self.leak_report_file,
-                local_leak_file.name)
-            self.app_ctx.dm.removeFile(self.leak_report_file)
-
-            mozleak.process_leak_log(
-                local_leak_file.name,
-                leak_thresholds=options.leakThresholds,
-                ignore_missing_leaks=options.ignoreMissingLeaks,
-                log=self.log,
-                stack_fixer=get_stack_fixer_function(options.utilityPath,
-                                                     options.symbolsPath),
-            )
-        except KeyboardInterrupt:
-            self.log.info("runtests.py | Received keyboard interrupt.\n")
-            status = -1
-        except:
-            traceback.print_exc()
-            self.log.error(
-                "Automation Error: Received unexpected exception while running application\n")
-            if hasattr(self, 'runner'):
-                self.runner.check_for_crashes()
-            status = 1
-
-        self.stopServers()
-
-        self.log.info("runtestsb2g.py | Running tests: end.")
-
-        if manifest is not None:
-            self.cleanup(manifest, options)
-        return status
-
-    def getGMPPluginPath(self, options):
-        if options.gmp_path:
-            return options.gmp_path
-        return '/system/b2g/gmp-clearkey/0.1'
-
-    def getChromeTestDir(self, options):
-        # The chrome test directory returned here is the remote location
-        # of chrome test files. A reference to this directory is requested
-        # when building the profile locally, before self.app_ctx is defined.
-        # To get around this, return a dummy directory until self.app_ctx
-        # is defined; the correct directory will be returned later, over-
-        # writing the dummy.
-        if hasattr(self, 'app_ctx'):
-            self.remote_chrome_test_dir = posixpath.join(
-                self.app_ctx.remote_test_root,
-                'chrome')
-            return self.remote_chrome_test_dir
-        return 'dummy-chrome-test-dir'
-
-    def cleanup(self, manifest, options):
-        if self.local_log:
-            self.app_ctx.dm.getFile(self.remote_log, self.local_log)
-            self.app_ctx.dm.removeFile(self.remote_log)
-
-        if options.pidFile != "":
-            try:
-                os.remove(options.pidFile)
-                os.remove(options.pidFile + ".xpcshell.pid")
-            except:
-                print("Warning: cleaning up pidfile '%s' was unsuccessful "
-                      "from the test harness") % options.pidFile
-
-        # stop and clean up the runner
-        if getattr(self, 'runner', False):
-            if self.local_log:
-                self.app_ctx.dm.getFile(self.remote_log, self.local_log)
-                self.app_ctx.dm.removeFile(self.remote_log)
-
-            self.runner.cleanup()
-            self.runner = None
-
-    def startServers(self, options, debuggerInfo):
-        """ Create the servers on the host and start them up """
-        savedXre = options.xrePath
-        savedUtility = options.utilityPath
-        savedProfie = options.profilePath
-        options.xrePath = self.local_binary_dir
-        options.utilityPath = self.local_binary_dir
-        options.profilePath = tempfile.mkdtemp()
-
-        MochitestBase.startServers(self, options, debuggerInfo)
-
-        options.xrePath = savedXre
-        options.utilityPath = savedUtility
-        options.profilePath = savedProfie
-
-    def buildURLOptions(self, options, env):
-        self.local_log = options.logFile
-        options.logFile = self.remote_log
-        options.profilePath = self.profile.profile
-        MochitestBase.buildURLOptions(self, options, env)
-
-        test_url = self.buildTestPath(options)
-
-        # For B2G emulators buildURLOptions has been called
-        # without calling buildTestPath first and that
-        # causes manifestFile not to be set
-        if "manifestFile=tests.json" not in self.urlOpts:
-            self.urlOpts.append("manifestFile=%s" % options.manifestFile)
-
-        if len(self.urlOpts) > 0:
-            test_url += "?" + "&".join(self.urlOpts)
-        self.start_script_args.append(test_url)
-
-        options.profilePath = self.app_ctx.remote_profile
-        options.logFile = self.local_log
-
-
-def run_test_harness(parser, options):
-    parser.validate(options)
-
-    # create our Marionette instance
-    marionette_args = {
-        'adb_path': options.adbPath,
-        'emulator': options.emulator,
-        'no_window': options.noWindow,
-        'logdir': options.logdir,
-        'busybox': options.busybox,
-        'symbols_path': options.symbolsPath,
-        'sdcard': options.sdcard,
-        'homedir': options.b2gPath,
-    }
-    if options.marionette:
-        host, port = options.marionette.split(':')
-        marionette_args['host'] = host
-        marionette_args['port'] = int(port)
-
-    if (options is None):
-        print "ERROR: Invalid options specified, use --help for a list of valid options"
-        sys.exit(1)
-
-    mochitest = MochitestB2G(
-        marionette_args,
-        options,
-        options.profile_data_dir,
-        options.xrePath,
-        remote_log_file=options.remoteLogFile)
-
-    if (options is None):
-        sys.exit(1)
-
-    retVal = 1
-    try:
-        mochitest.cleanup(None, options)
-        retVal = mochitest.run_tests(options)
-    except:
-        print "Automation Error: Exception caught while running tests"
-        traceback.print_exc()
-        mochitest.stopServers()
-        try:
-            mochitest.cleanup(None, options)
-        except:
-            pass
-        retVal = 1
-
-    mochitest.message_logger.finish()
-
-    return retVal
-
-
-def main():
-    parser = MochitestArgumentParser(app='b2g')
-    options = parser.parse_args()
-    return run_test_harness(parser, options)
-
-if __name__ == "__main__":
-    sys.exit(main())
--- a/testing/mochitest/runtestsremote.py
+++ b/testing/mochitest/runtestsremote.py
@@ -185,18 +185,17 @@ class MochiRemote(MochitestDesktop):
 
         restoreRemotePaths()
         options.profilePath = self.remoteProfile
         return manifest
 
     def addChromeToProfile(self, options):
         manifest = MochitestDesktop.addChromeToProfile(self, options)
 
-        # Support Firefox (browser), B2G (shell), SeaMonkey (navigator), and Webapp
-        # Runtime (webapp).
+        # Support Firefox (browser), SeaMonkey (navigator), and Webapp Runtime (webapp).
         if options.flavor == 'chrome':
             # append overlay to chrome.manifest
             chrome = ("overlay chrome://browser/content/browser.xul "
                       "chrome://mochikit/content/browser-test-overlay.xul")
             path = os.path.join(options.profilePath, 'extensions', 'staged',
                                 'mochikit@mozilla.org', 'chrome.manifest')
             with open(path, "a") as f:
                 f.write(chrome)
deleted file mode 100644
--- a/testing/mochitest/start_b2g.js
+++ /dev/null
@@ -1,176 +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/. */
-
-var outOfProcess = __webDriverArguments[0]
-var mochitestUrl = __webDriverArguments[1]
-var onDevice = __webDriverArguments[2]
-var wifiSettings = __webDriverArguments[3]
-var chrome = __webDriverArguments[4]
-var prefs = Components.classes["@mozilla.org/preferences-service;1"].
-                            getService(Components.interfaces.nsIPrefBranch)
-var settings = window.navigator.mozSettings;
-var cm = Components.classes["@mozilla.org/categorymanager;1"].
-                    getService(Components.interfaces.nsICategoryManager);
-
-if (wifiSettings)
-  wifiSettings = JSON.parse(wifiSettings);
-
-const CHILD_SCRIPT = "chrome://specialpowers/content/specialpowers.js";
-const CHILD_SCRIPT_API = "chrome://specialpowers/content/specialpowersAPI.js";
-const CHILD_LOGGER_SCRIPT = "chrome://specialpowers/content/MozillaLogger.js";
-
-var homescreen = document.getElementById('systemapp');
-var container = homescreen.contentWindow.document.getElementById('test-container');
-
-// Disable udpate timers which cause failure in b2g permisson prompt tests.
-if (cm) {
-  cm.deleteCategoryEntry("update-timer", "WebappsUpdateTimer", false);
-  cm.deleteCategoryEntry("update-timer", "nsUpdateService", false);
-}
-
-var SECURITY_PREF = "security.turn_off_all_security_so_that_viruses_can_take_over_this_computer";
-Components.utils.import("resource://gre/modules/Services.jsm");
-Services.prefs.setBoolPref(SECURITY_PREF, true);
-// RIL DOM events and mozChromeEvents will be pending until
-// this observer message is sent.
-Services.obs.notifyObservers(null, 'system-message-listener-ready', null);
-
-function openWindow(aEvent) {
-  var popupIframe = aEvent.detail.frameElement;
-  popupIframe.id = 'popupiframe';
-
-  // This is to size the iframe to what is requested in the window.open call,
-  // e.g. window.open("", "", "width=600,height=600");
-  if (aEvent.detail.features.indexOf('width') != -1) {
-    let width = aEvent.detail.features.substr(aEvent.detail.features.indexOf('width')+6);
-    width = width.substr(0,width.indexOf(',') == -1 ? width.length : width.indexOf(','));
-    popupIframe.setAttribute('width', width);
-  }
-  if (aEvent.detail.features.indexOf('height') != -1) {
-    let height = aEvent.detail.features.substr(aEvent.detail.features.indexOf('height')+7);
-    height = height.substr(0, height.indexOf(',') == -1 ? height.length : height.indexOf(','));
-    popupIframe.setAttribute('height', height);
-  }
-
-  popupIframe.addEventListener('mozbrowserclose', function(e) {
-    container.parentNode.removeChild(popupIframe);
-    container.focus();
-  });
-
-  // yes, the popup can call window.open too!
-  popupIframe.addEventListener('mozbrowseropenwindow', openWindow);
-
-  popupIframe.addEventListener('mozbrowserloadstart', function(e) {
-    popupIframe.focus();
-    let mm = popupIframe.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager;
-    mm.loadFrameScript(CHILD_LOGGER_SCRIPT, true);
-    mm.loadFrameScript(CHILD_SCRIPT_API, true);
-    mm.loadFrameScript(CHILD_SCRIPT, true);
-    mm.loadFrameScript('data:,attachSpecialPowersToWindow(content);', true);
-  });
-
-  container.parentNode.appendChild(popupIframe);
-}
-container.addEventListener('mozbrowseropenwindow', openWindow);
-container.addEventListener('mozbrowsershowmodalprompt', function (e) {
-  if (e.detail.message == 'setVisible::false') {
-    container.setVisible(false);
-  }
-  else if (e.detail.message == 'setVisible::true') {
-    container.setVisible(true);
-  }
-});
-
-function StartTest() {
-  if (outOfProcess) {
-    let mm = container.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager;
-
-    //Workaround for bug 848411, once that bug is fixed, the following line can be removed
-    function contentScript() {
-      addEventListener("DOMWindowCreated", function listener(e) {
-        removeEventListener("DOMWindowCreated", listener, false);
-        var window = e.target.defaultView;
-        window.wrappedJSObject.SpecialPowers.addPermission("allowXULXBL", true, window.document);
-      });
-    }
-    mm.loadFrameScript("data:,(" + encodeURI(contentScript.toSource()) + ")();", true);
-  }
-
-  if (chrome) {
-    let loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader);
-    if (typeof(SpecialPowers) == 'undefined') {
-      loader.loadSubScript("chrome://specialpowers/content/specialpowersAPI.js");
-      loader.loadSubScript("chrome://specialpowers/content/SpecialPowersObserverAPI.js");
-      loader.loadSubScript("chrome://specialpowers/content/ChromePowers.js");
-    }
-    loader.loadSubScript("chrome://mochikit/content/browser-test.js");
-    b2gStart();
-  }
-
-  if (onDevice) {
-    var cpuLock = Components.classes["@mozilla.org/power/powermanagerservice;1"]
-      .getService(Ci.nsIPowerManagerService)
-      .newWakeLock("cpu");
-
-    let manager = navigator.mozWifiManager;
-    let con = manager.connection;
-    manager.setPowerSavingMode(false);
-
-    manager.onenabled = function () {
-      if(wifiSettings) {
-        var req = manager.getKnownNetworks();
-        req.onsuccess = function () {
-          var networks = req.result;
-          for (var i = 0; i < networks.length; ++i){
-            var network = networks[i];
-            if(network.ssid == wifiSettings.ssid) {
-              manager.forget(network);
-            }
-          }
-          manager.associate(new window.MozWifiNetwork(wifiSettings));
-        };
-      }
-    };
-
-    manager.onstatuschange = function (event) {
-      prefs.setIntPref("network.proxy.type", 2);
-      if (event.status == 'connected') {
-        container.src = mochitestUrl;
-      }
-    };
-
-    if(wifiSettings) {
-      var req = settings.createLock().set({
-        'wifi.enabled': false,
-      'wifi.suspended': false
-      });
-
-      req.onsuccess = function () {
-        dump("----------------------enabling wifi------------------\n");
-        var req1 = settings.createLock().set({
-          'wifi.enabled': true,
-            'wifi.suspended': false});
-      };
-    }
-  } else {
-    if (!chrome) {
-      container.src = mochitestUrl;
-    }
-  }
-}
-
-// Prevent display off during testing.
-navigator.mozPower.screenEnabled = true;
-var settingLock = navigator.mozSettings.createLock();
-var settingResult = settingLock.set({
-  'screen.timeout': 0
-});
-settingResult.onsuccess = function () {
-  dump("Set screen.time to 0\n");
-  StartTest();
-}
-settingResult.onerror = function () {
-  dump("Change screen.time failed\n");
-  StartTest();
-}
--- a/testing/mochitest/tests/Harness_sanity/mochitest.ini
+++ b/testing/mochitest/tests/Harness_sanity/mochitest.ini
@@ -1,10 +1,9 @@
 [DEFAULT]
-skip-if = buildapp == 'b2g'
 [test_TestsRunningAfterSimpleTestFinish.html]
 skip-if = true #depends on fix for bug 1048446
 [test_add_task.html]
 [test_createFiles.html]
 [test_importInMainProcess.html]
 support-files = importtesting_chromescript.js
 [test_sanity.html]
 [test_sanityException.html]
@@ -30,24 +29,24 @@ support-files =
 [test_SpecialPowersPushPrefEnv.html]
 [test_SimpletestGetTestFileURL.html]
 [test_SpecialPowersLoadChromeScript.html]
 support-files = SpecialPowersLoadChromeScript.js
 [test_SpecialPowersLoadChromeScript_function.html]
 [test_SpecialPowersLoadPrivilegedScript.html]
 [test_bug649012.html]
 [test_bug816847.html]
-skip-if = true || toolkit == 'android' || buildapp == 'b2g' || buildapp == 'mulet' || e10s #No test app installed ### Bug 1255339: blacklist because no more mozApps
+skip-if = true || toolkit == 'android' || e10s  # No test app installed
 [test_sanity_cleanup.html]
 [test_sanity_cleanup2.html]
 [test_sanityEventUtils.html]
-skip-if = buildapp == 'mulet' || toolkit == 'android' #bug 688052
+skip-if = toolkit == 'android'  # bug 688052
 [test_sanitySimpletest.html]
 subsuite = clipboard
-skip-if = toolkit == 'android' #bug 688052
+skip-if = toolkit == 'android'  # bug 688052
 [test_sanity_manifest.html]
 skip-if = toolkit == 'android' # we use the old manifest style on android
 fail-if = true
 [test_sanity_manifest_pf.html]
 skip-if = toolkit == 'android' # we use the old manifest style on android
 fail-if = true
 [test_spawn_task.html]
 [test_sanity_waitForCondition.html]
--- a/testing/mochitest/tests/MochiKit-1.4.2/tests/mochitest.ini
+++ b/testing/mochitest/tests/MochiKit-1.4.2/tests/mochitest.ini
@@ -1,10 +1,9 @@
 [DEFAULT]
-skip-if = buildapp == 'b2g'
 support-files =
   SimpleTest/test.css
   test_Base.js
   test_Color.js
   test_DateTime.js
   test_DragAndDrop.js
   test_Format.js
   test_Iter.js
--- a/testing/mochitest/tests/SimpleTest/SimpleTest.js
+++ b/testing/mochitest/tests/SimpleTest/SimpleTest.js
@@ -302,17 +302,17 @@ SimpleTest.todo = function(condition, na
     SimpleTest._logResult(test, successInfo, failureInfo);
     SimpleTest._tests.push(test);
 };
 
 /*
  * Returns the absolute URL to a test data file from where tests
  * are served. i.e. the file doesn't necessarely exists where tests
  * are executed.
- * (For b2g and android, mochitest are executed on the device, while
+ * (For android, mochitest are executed on the device, while
  * all mochitest html (and others) files are served from the test runner
  * slave)
  */
 SimpleTest.getTestFileURL = function(path) {
   var lastSlashIdx = path.lastIndexOf("/") + 1;
   var filename = path.substr(lastSlashIdx);
   var location = window.location;
   // Remove mochitest html file name from the path
@@ -1620,17 +1620,17 @@ function getAndroidSdk() {
         var iframe = document.documentElement.appendChild(document.createElement("iframe"));
         iframe.style.display = "none";
         var nav = iframe.contentWindow.navigator;
         if (nav.userAgent.indexOf("Mobile") == -1 &&
             nav.userAgent.indexOf("Tablet") == -1) {
             gAndroidSdk = -1;
         } else {
             // See nsSystemInfo.cpp, the getProperty('version') returns different value
-            // on each platforms, so we need to distinguish the android and B2G platform.
+            // on each platforms, so we need to distinguish the android platform.
             var versionString = nav.userAgent.indexOf("Android") != -1 ?
                                 'version' : 'sdk_version';
             gAndroidSdk = SpecialPowers.Cc['@mozilla.org/system-info;1']
                                        .getService(SpecialPowers.Ci.nsIPropertyBag2)
                                        .getProperty(versionString);
         }
         document.documentElement.removeChild(iframe);
     }
--- a/testing/profiles/moz.build
+++ b/testing/profiles/moz.build
@@ -1,14 +1,13 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=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/.
 
 mochitest_profile_files = [
-    'prefs_b2g_unittest.js',
     'prefs_general.js',
     'webapps_mochitest.json',
 ]
 
 TEST_HARNESS_FILES.testing.mochitest.profile_data += mochitest_profile_files
 TEST_HARNESS_FILES['web-platform'].prefs += mochitest_profile_files
deleted file mode 100644
--- a/testing/profiles/prefs_b2g_unittest.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// Prefs specific to b2g mochitests
-
-user_pref("b2g.system_manifest_url","app://test-container.gaiamobile.org/manifest.webapp");
-user_pref("b2g.system_startup_url","app://test-container.gaiamobile.org/index.html");
-user_pref("dom.ipc.browser_frames.oop_by_default", false);
-user_pref("dom.ipc.tabs.disabled", false);
-user_pref("dom.ipc.tabs.shutdownTimeoutSecs", 0);
-user_pref("dom.mozBrowserFramesEnabled", "%(OOP)s");
-user_pref("dom.mozBrowserFramesWhitelist","app://test-container.gaiamobile.org,http://mochi.test:8888");
-user_pref("dom.testing.datastore_enabled_for_hosted_apps", true);
-user_pref('identity.fxaccounts.skipDeviceRegistration', true);
-user_pref("marionette.force-local", true);