Bug 1253618 - Add support for |skip-if = e10s| manifest annotations in Marionette runner; r=AutomatedTester draft
authorMaja Frydrychowicz <mjzffr@gmail.com>
Wed, 09 Mar 2016 16:04:02 -0500
changeset 339995 06b29403664e2c785488f5543aae77f76e3337ed
parent 339874 f0c0480732d36153e8839c7f17394d45f679f87d
child 339996 29069c94fea1ffcc6f7d194f49bbc48591952d9d
push id12867
push usermjzffr@gmail.com
push dateMon, 14 Mar 2016 17:44:05 +0000
reviewersAutomatedTester
bugs1253618
milestone48.0a1
Bug 1253618 - Add support for |skip-if = e10s| manifest annotations in Marionette runner; r=AutomatedTester MozReview-Commit-ID: ApTPQNa2R1c
testing/marionette/harness/marionette/runner/base.py
--- a/testing/marionette/harness/marionette/runner/base.py
+++ b/testing/marionette/harness/marionette/runner/base.py
@@ -548,16 +548,17 @@ class BaseMarionetteTestRunner(object):
         self.tree = tree
         self.type = type
         self.device_serial = device_serial
         self.symbols_path = symbols_path
         self.timeout = timeout
         self.socket_timeout = socket_timeout
         self._device = None
         self._capabilities = None
+        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
@@ -644,16 +645,33 @@ class BaseMarionetteTestRunner(object):
             return self._capabilities
 
         self.marionette.start_session()
         self._capabilities = self.marionette.session_capabilities
         self.marionette.delete_session()
         return self._capabilities
 
     @property
+    def appinfo(self):
+        if self._appinfo:
+            return self._appinfo
+
+        self.marionette.start_session()
+        with self.marionette.using_context('chrome'):
+            self._appinfo = self.marionette.execute_script("""
+            try {
+              return Services.appinfo;
+            } catch (e) {
+              return null;
+            }""")
+        self.marionette.delete_session()
+        self._appinfo = self._appinfo or {}
+        return self._appinfo
+
+    @property
     def device(self):
         if self._device:
             return self._device
 
         self._device = self.capabilities.get('device')
         return self._device
 
     @property
@@ -977,21 +995,23 @@ setReq.onerror = function() {
 
         if file_ext == '.ini':
             manifest = TestManifest()
             manifest.read(filepath)
 
             filters = []
             if self.test_tags:
                 filters.append(tags(self.test_tags))
+            e10s = self.appinfo.get('browserTabsRemoteAutostart', False)
             manifest_tests = manifest.active_tests(exists=False,
                                                    disabled=True,
                                                    filters=filters,
                                                    device=self.device,
                                                    app=self.appName,
+                                                   e10s=e10s,
                                                    **mozinfo.info)
             if len(manifest_tests) == 0:
                 self.logger.error("no tests to run using specified "
                                   "combination of filters: {}".format(
                                        manifest.fmt_filters()))
 
             unfiltered_tests = []
             for test in manifest_tests: