def _GetDevToolsClient(self):
    # If the agent does not appear to be ready, it could be because we got the
    # details of an older agent that no longer exists. It's thus important to
    # re-read and update the port and target on each retry.
    try:
      devtools_port, browser_target = self._FindDevToolsPortAndTarget()
    except EnvironmentError:
      return None  # Port information not ready, will retry.

    return devtools_client_backend.GetDevToolsBackEndIfReady(
        devtools_port=devtools_port,
        app_backend=self,
        browser_target=browser_target)
Exemple #2
0
 def _UpdateDevToolsClient(self):
     if self._devtools_client is None:
         self._devtools_client = devtools_client_backend.GetDevToolsBackEndIfReady(
             devtools_port=self._remote_devtools_port,
             app_backend=self._app_backend)