Chromium Code Reviews| Index: tools/android/loading/controller.py |
| diff --git a/tools/android/loading/controller.py b/tools/android/loading/controller.py |
| index 452b548395201a64578ddfccc4c0d9a22d66335c..e6ac299dd8040c9a4d176552ec4c69b2c4cb475d 100644 |
| --- a/tools/android/loading/controller.py |
| +++ b/tools/android/loading/controller.py |
| @@ -115,6 +115,10 @@ class ChromeControllerError(Exception): |
| """Returns whether the error is an known intermittent error.""" |
| return self.error_type in self._INTERMITTENT_WHITE_LIST |
| + def RaiseOriginal(self): |
| + """Raises the original exception that has caused <self>.""" |
| + raise self.error_type, self.error_value, self.error_traceback |
| + |
| class ChromeControllerBase(object): |
| """Base class for all controllers. |
| @@ -326,6 +330,7 @@ class RemoteChromeController(ChromeControllerBase): |
| subprocess.list2cmdline(chrome_args))) |
| with device_setup.FlagReplacer( |
| self._device, command_line_path, self._GetChromeArguments()): |
| + self._DismissCrashDialogIfNeeded() |
| start_intent = intent.Intent( |
| package=package_info.package, activity=package_info.activity, |
| data='about:blank') |
| @@ -362,6 +367,7 @@ class RemoteChromeController(ChromeControllerBase): |
| raise ChromeControllerError(log=logcat) |
| finally: |
| self._device.ForceStop(package_info.package) |
| + self._DismissCrashDialogIfNeeded() |
| def ResetBrowserState(self): |
| """Override resetting Chrome local state.""" |
| @@ -402,6 +408,11 @@ class RemoteChromeController(ChromeControllerBase): |
| yield |
| self._wpr_attributes = None |
| + def _DismissCrashDialogIfNeeded(self): |
| + for _ in xrange(10): |
| + if not self._device.DismissCrashDialogIfNeeded(): |
| + break |
|
gabadie
2016/06/06 13:40:37
FYI: copy pasted from https://cs.chromium.org/chro
pasko
2016/06/06 13:58:52
Thanks for the pointer. Ugh.
|
| + |
| class LocalChromeController(ChromeControllerBase): |
| """Controller for a local (desktop) chrome instance.""" |