Add devtools_http.DevToolsClientConnectionError to did_browser_crash.

Use did_browser_crash everywhere since telemetry exceptions seem to be growing.

BUG=chromium:450278
TEST=manual

Change-Id: I5b18a9c30880a2a1b89333af88d181beeb1596a5
Reviewed-on: https://chromium-review.googlesource.com/243398
Tested-by: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Achuith Bhandarkar <achuith@chromium.org>
diff --git a/client/common_lib/cros/chrome.py b/client/common_lib/cros/chrome.py
index b83f565..740be8c 100644
--- a/client/common_lib/cros/chrome.py
+++ b/client/common_lib/cros/chrome.py
@@ -6,6 +6,7 @@
 
 from telemetry.core import browser_finder, browser_options, exceptions
 from telemetry.core import extension_to_load, util
+from telemetry.core.backends.chrome_inspector import devtools_http
 
 
 class Chrome(object):
@@ -154,26 +155,8 @@
         return self._browser_type
 
 
-    def wait_for_browser_to_come_up(self):
-        """Waits for the browser to come up. This should only be called after a
-        browser crash.
-        """
-        def _BrowserReady(cr):
-            try:
-                tab = cr.browser.tabs.New()
-            except (exceptions.BrowserGoneException,
-                    exceptions.BrowserConnectionGoneException):
-                return False
-            try:
-                tab.Close()
-            except (util.TimeoutException):
-                # crbug.com/350941
-                logging.error('Timed out closing tab')
-            return True
-        util.WaitFor(lambda: _BrowserReady(self), timeout=10)
-
-
-    def did_browser_crash(self, func):
+    @staticmethod
+    def did_browser_crash(func):
         """Runs func, returns True if the browser crashed, False otherwise.
 
         @param func: function to run.
@@ -181,12 +164,30 @@
         """
         try:
             func()
-        except (exceptions.BrowserGoneException,
-                exceptions.BrowserConnectionGoneException):
+        except (exceptions.AppCrashException,
+                devtools_http.DevToolsClientConnectionError):
             return True
         return False
 
 
+    def wait_for_browser_to_come_up(self):
+        """Waits for the browser to come up. This should only be called after a
+        browser crash.
+        """
+        def _BrowserReady(cr):
+            tabs = []  # Wrapper for pass by reference.
+            if self.did_browser_crash(
+                    lambda: tabs.append(cr.browser.tabs.New())):
+                return False
+            try:
+                tabs[0].Close()
+            except (util.TimeoutException):
+                # crbug.com/350941
+                logging.error('Timed out closing tab')
+            return True
+        util.WaitFor(lambda: _BrowserReady(self), timeout=10)
+
+
     def close(self):
         """Closes the browser."""
         self._browser.Close()