Merge m-c to m-i
authorPhil Ringnalda <philringnalda@gmail.com>
Wed, 06 Jul 2016 19:34:49 -0700
changeset 384977 00c32030641b728ffb7a1ea4779f3340ad40650d
parent 384976 24ec7aba60e708ca69e7dbe149e8f822794db4a3 (current diff)
parent 384778 09221c72fcb03a7c2b4ab27c75304eae3247e3d1 (diff)
child 384978 7df4e14a35ea30cf39fc2372fcfd62447b9a28ae
push id22385
push userbmo:wpan@mozilla.com
push dateThu, 07 Jul 2016 12:18:17 +0000
milestone50.0a1
Merge m-c to m-i
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -675,17 +675,17 @@ class Marionette(object):
                     data["parameters"] = params
                 self.client.send(data)
                 msg = self.client.receive()
 
             else:
                 msg = self.client.request(name, params)
 
         except IOError:
-            if self.instance:
+            if self.instance and not hasattr(self.instance, 'detached'):
                 # If we've launched the binary we've connected to, wait
                 # for it to shut down.
                 returncode = self.instance.runner.wait(timeout=self.DEFAULT_STARTUP_TIMEOUT)
                 raise IOError("process died with returncode %s" % returncode)
             raise
 
         except socket.timeout:
             self.session = None
@@ -1032,30 +1032,27 @@ class Marionette(object):
                 raise ValueError
             # Values here correspond to constants in nsIAppStartup.
             # See http://mzl.la/1X0JZsC
             restart_flags = [
                 "eForceQuit",
                 "eRestart",
             ]
             self._send_message("quitApplication", {"flags": restart_flags})
-            self.delete_session()
+            self.client.close()
+            # The instance is restarting itself; we will no longer be able to
+            # track it by pid, so mark it as 'detached'.
+            self.instance.detached = True
         else:
             self.delete_session()
             self.instance.restart(clean=clean)
-
         self.raise_for_port(self.wait_for_port())
         self.start_session(session_id=self.session_id)
         self._reset_timeouts()
 
-        if in_app:
-            # In some cases Firefox restarts itself by spawning into a new process group. As long as
-            # mozrprocess cannot track that (bug 1176758) we assist by checking the new process id.
-            self.instance.runner.process_handler.check_for_detached(self.session['processId'])
-
     def absolute_url(self, relative_url):
         '''
         Returns an absolute url for files served from Marionette's www directory.
 
         :param relative_url: The url of a static file, relative to Marionette's www directory.
         '''
         return "%s%s" % (self.baseurl, relative_url)
 
--- a/testing/marionette/client/requirements.txt
+++ b/testing/marionette/client/requirements.txt
@@ -1,1 +1,1 @@
-mozrunner >= 6.12
+mozrunner >= 6.9