move -runtime flag to runtests.py so it gets set in automation
authorMyk Melez <myk@mozilla.org>
Wed, 15 Jul 2015 14:41:00 -0700
changeset 326835 ddae92629ed62b855f0b4f804473194ff30e5f88
parent 326834 78d85b833e332f501efaa5100aaa09ed0642b4f0
child 326836 097acaf0a86b5431b6e4a3f7d4f637ba4b29acfc
push id10169
push userdminor@mozilla.com
push dateThu, 28 Jan 2016 13:10:48 +0000
milestone42.0a1
move -runtime flag to runtests.py so it gets set in automation
testing/mochitest/mach_commands.py
testing/mochitest/runtests.py
--- a/testing/mochitest/mach_commands.py
+++ b/testing/mochitest/mach_commands.py
@@ -328,20 +328,16 @@ class MochitestRunner(MozbuildObject):
             if not options.app or options.app == self.get_binary_path():
                 options.app = self.get_webapp_runtime_path()
             options.xrePath = self.get_webapp_runtime_xre_path()
         elif suite == 'webapprt-chrome':
             options.browserArgs.append("-test-mode")
             if not options.app or options.app == self.get_binary_path():
                 options.app = self.get_webapp_runtime_path()
             options.xrePath = self.get_webapp_runtime_xre_path()
-            # On Mac, pass the path to the runtime, to ensure the test app
-            # uses that specific runtime instead of another one on the system.
-            if sys.platform.startswith('darwin'):
-                options.browserArgs.extend(('-runtime', os.path.join(self.distdir, self.substs['MOZ_MACBUNDLE_NAME'])))
 
         from manifestparser import TestManifest
         manifest = TestManifest()
         manifest.tests.extend(tests)
         options.manifestFile = manifest
 
         # XXX why is this such a special case?
         if len(tests) == 1 and options.closeWhenDone and suite == 'plain':
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -2218,16 +2218,21 @@ class Mochitest(MochitestUtilsMixin):
                     count += 1
                 if count == 0:
                     return 1
 
             self.buildURLOptions(options, self.browserEnv)
             if self.urlOpts:
                 testURL += "?" + "&".join(self.urlOpts)
 
+            # On Mac, pass the path to the runtime, to ensure the test app
+            # uses that specific runtime instead of another one on the system.
+            if mozinfo.isMac and options.webapprtChrome:
+                options.browserArgs.extend(('-runtime', os.path.dirname(os.path.dirname(options.xrePath))))
+
             if options.webapprtContent:
                 options.browserArgs.extend(('-test-mode', testURL))
                 testURL = None
 
             if options.immersiveMode:
                 options.browserArgs.extend(('-firefoxpath', options.app))
                 options.app = self.immersiveHelperPath