Bug 1495903 - When running raptor on chromium, remove the webext from the cmd line after each test is finished; r=jmaher
authorRob Wood <rwood@mozilla.com>
Wed, 24 Oct 2018 20:18:41 +0000
changeset 491356 5ae5712ce099da176f05073382c2e1a7144237cf
parent 491355 92fead125b516cd99911599ff6d716f69dbc009f
child 491357 f5a40dea590259a0ac9bb2c79190f8245b16b6eb
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
Bug 1495903 - When running raptor on chromium, remove the webext from the cmd line after each test is finished; r=jmaher Differential Revision: https://phabricator.services.mozilla.com/D9709
--- a/testing/raptor/raptor/raptor.py
+++ b/testing/raptor/raptor/raptor.py
@@ -145,16 +145,18 @@ class Raptor(object):
         # for android we must make the benchmarks server available to the device
         if self.config['app'] == "geckoview":
             self.log.info("making the raptor benchmarks server port available to device")
             _tcp_port = "tcp:%s" % benchmark_port
             self.device.create_socket_connection('reverse', _tcp_port, _tcp_port)
         # must intall raptor addon each time because we dynamically update some content
+        # note: for chrome the addon is just a list of paths that ultimately are added
+        # to the chromium command line '--load-extension' argument
         raptor_webext = os.path.join(webext_dir, 'raptor')
         self.log.info("installing webext %s" % raptor_webext)
         # add test specific preferences
         if test.get("preferences", None) is not None:
             if self.config['app'] == "firefox":
@@ -253,21 +255,24 @@ class Raptor(object):
                 except NotImplementedError:  # not implemented for Chrome
             # TODO: if on geckoview is there some cleanup here i.e. check for crashes?
         if self.playback is not None:
         # remove the raptor webext; as it must be reloaded with each subtest anyway
-        # applies to firefox only; chrome the addon is actually just cmd line arg
+        self.log.info("removing webext %s" % raptor_webext)
         if self.config['app'] in ["firefox", "geckoview"]:
-            self.log.info("removing webext %s" % raptor_webext)
+        # for chrome the addon is just a list (appended to cmd line)
+        if self.config['app'] in ["chrome", "chrome-android"]:
+            self.profile.addons.remove(raptor_webext)
         if self.config['app'] != "geckoview":
             if self.runner.is_running():
         # TODO the geckoview app should have been shutdown by this point by the
         # control server, but we can double-check here to make sure
     def process_results(self):
         # when running locally output results in build/raptor.json; when running