Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(757)

Unified Diff: tools/android/loading/controller.py

Issue 2040993002: sandwich: Uplift for production use. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/android/loading/sandwich.py » ('j') | tools/android/loading/sandwich_runner.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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."""
« no previous file with comments | « no previous file | tools/android/loading/sandwich.py » ('j') | tools/android/loading/sandwich_runner.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698