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 5ae5712ce099
parent 491355 92fead125b51
child 491357 f5a40dea5902
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersjmaher
bugs1495903
milestone65.0a1
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
testing/raptor/raptor/raptor.py
--- 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)
         self.profile.addons.install(raptor_webext)
 
         # add test specific preferences
         if test.get("preferences", None) is not None:
             if self.config['app'] == "firefox":
                 self.profile.set_preferences(json.loads(test['preferences']))
@@ -253,21 +255,24 @@ class Raptor(object):
                 except NotImplementedError:  # not implemented for Chrome
                     pass
             # TODO: if on geckoview is there some cleanup here i.e. check for crashes?
 
         if self.playback is not None:
             self.playback.stop()
 
         # 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)
             self.profile.addons.remove_addon(webext_id)
 
+        # 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():
                 self.runner.stop()
         # 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