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

Unified Diff: tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py

Issue 536343003: Kill old browser rather than close (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: apply change that caused conflict Created 6 years, 3 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 | « build/android/pylib/device/device_utils_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py b/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
index abe17a9e70b0132d94b3fbea2214873c5fcf8e31..8be729edcd83188fbeec9fac3b02e4cdb83109ca 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
@@ -205,7 +205,7 @@ class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
self._adb.device().SetProp('socket.relaxsslcheck', 'yes')
# Kill old browser.
- self._adb.device().ForceStop(self._backend_settings.package)
+ self._KillBrowser()
if self._adb.device().old_interface.CanAccessProtectedFileContents():
if self.browser_options.profile_dir:
@@ -229,6 +229,13 @@ class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
self._adb.device().RunShellCommand(
'am set-debug-app --persistent %s' % self._backend_settings.package)
+ def _KillBrowser(self):
+ # We use KillAll rather than ForceStop for efficiency reasons.
+ try:
+ self._adb.device().KillAll(self._backend_settings.package, retries=0)
+ except device_errors.CommandFailedError:
+ pass
+
def _SetUpCommandLine(self):
def QuoteIfNeeded(arg):
# Escape 'key=valueA valueB' to 'key="valueA valueB"'
@@ -373,7 +380,7 @@ class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
def Close(self):
super(AndroidBrowserBackend, self).Close()
- self._adb.device().ForceStop(self._backend_settings.package)
+ self._KillBrowser()
# Restore android.net SSL check
if self._backend_settings.relax_ssl_check:
« no previous file with comments | « build/android/pylib/device/device_utils_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698