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

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

Issue 338353004: [Android] Switch KillAll, StartActivity, and BroadcastIntent to DeviceUtils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: appeasing windows Created 6 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 | « tools/android/mempressure.py ('k') | tools/telemetry/telemetry/core/platform/android_platform_backend.py » ('j') | 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 3ead0bf9ff7a6e4b51b3035a9d09833821883091..e2bd23cb4aebbd005da0a6a8c1a970632695c949 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py
@@ -17,6 +17,8 @@ from telemetry.core.backends import browser_backend
from telemetry.core.backends.chrome import chrome_browser_backend
from telemetry.core.forwarders import android_forwarder
+from pylib.device import intent
+
class AndroidBrowserBackendSettings(object):
@@ -34,10 +36,11 @@ class AndroidBrowserBackendSettings(object):
def RemoveProfile(self):
files = self.adb.device().RunShellCommand(
- 'ls "%s"' % self.profile_dir, root=True)
+ 'ls "%s"' % self.profile_dir, as_root=True)
# Don't delete lib, since it is created by the installer.
paths = ['"%s/%s"' % (self.profile_dir, f) for f in files if f != 'lib']
- self.adb.device().RunShellCommand('rm -r %s' % ' '.join(paths), root=True)
+ self.adb.device().RunShellCommand('rm -r %s' % ' '.join(paths),
+ as_root=True)
def PushProfile(self, _):
logging.critical('Profiles cannot be overriden with current configuration')
@@ -97,7 +100,7 @@ class ChromeBackendSettings(AndroidBrowserBackendSettings):
id_line = next(line for line in dumpsys if 'userId=' in line)
uid = re.search('\d+', id_line).group()
files = self.adb.device().RunShellCommand(
- 'ls "%s"' % self.profile_dir, root=True)
+ 'ls "%s"' % self.profile_dir, as_root=True)
files.remove('lib')
paths = ['%s/%s' % (self.profile_dir, f) for f in files]
for path in paths:
@@ -285,12 +288,11 @@ class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
# startup with the NTP can lead to race conditions with Telemetry
url = 'about:blank'
self._adb.device().old_interface.DismissCrashDialogIfNeeded()
- self._adb.StartActivity(self._backend_settings.package,
- self._backend_settings.activity,
- True,
- None,
- None,
- url)
+ self._adb.device().StartActivity(
+ intent.Intent(package=self._backend_settings.package,
+ activity=self._backend_settings.activity,
+ action=None, data=url, category=None),
+ blocking=True)
self._adb.Forward('tcp:%d' % self._port,
self._backend_settings.GetDevtoolsRemotePort())
« no previous file with comments | « tools/android/mempressure.py ('k') | tools/telemetry/telemetry/core/platform/android_platform_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698