logging_AsanCrashTelemetry.

BUG=chromium:266476

TEST=trybot run

Change-Id: I09d5d5e8b2cc454262c5a4b93dd09374f64f5e5a
Reviewed-on: https://gerrit.chromium.org/gerrit/66121
Commit-Queue: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
Tested-by: Achuith Bhandarkar <achuith@chromium.org>
diff --git a/client/common_lib/cros/chrome.py b/client/common_lib/cros/chrome.py
index b55363a..6c3a382 100644
--- a/client/common_lib/cros/chrome.py
+++ b/client/common_lib/cros/chrome.py
@@ -79,6 +79,16 @@
         util.WaitFor(lambda: _BrowserReady(self), poll_interval=1, timeout=10)
 
 
+    def did_browser_crash(self, func):
+        """Runs func, returns True if the browser crashed, False otherwise."""
+        try:
+            func()
+        except (exceptions.BrowserGoneException,
+                exceptions.BrowserConnectionGoneException):
+            return True
+        return False
+
+
     def is_logged_in(self):
         """Returns true iff logged in."""
         # TODO(achuith): Do this better.