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

Unified Diff: tools/telemetry/telemetry/core/platform/android_action_runner.py

Issue 1141833003: [Android] Remove adb_commands from telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (last?) rebase Created 5 years, 7 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
Index: tools/telemetry/telemetry/core/platform/android_action_runner.py
diff --git a/tools/telemetry/telemetry/core/platform/android_action_runner.py b/tools/telemetry/telemetry/core/platform/android_action_runner.py
index c2f79b481a5760c13707fd4e665c8c9a5ada08b0..1e87445b85fd6f42a9ba6a9f1bf1f6b265d065f5 100644
--- a/tools/telemetry/telemetry/core/platform/android_action_runner.py
+++ b/tools/telemetry/telemetry/core/platform/android_action_runner.py
@@ -67,7 +67,7 @@ class AndroidActionRunner(object):
Args:
string: The string to send to the device.
"""
- self._platform_backend.adb.RunShellCommand('input text %s' % string)
+ self._platform_backend.device.RunShellCommand('input text %s' % string)
def InputKeyEvent(self, key):
"""Send a single key input to the device.
@@ -75,7 +75,7 @@ class AndroidActionRunner(object):
Args:
key: A key code number or name that will be sent to the device
"""
- self._platform_backend.adb.RunShellCommand('input keyevent %s' % key)
+ self._platform_backend.device.SendKeyEvent(key)
def InputTap(self, x_coord, y_coord):
"""Perform a tap input at the given coordinates.
@@ -84,8 +84,8 @@ class AndroidActionRunner(object):
x_coord: The x coordinate of the tap event.
y_coord: The y coordinate of the tap event.
"""
- self._platform_backend.adb.RunShellCommand('input tap %s %s' % (x_coord,
- y_coord))
+ self._platform_backend.device.RunShellCommand(
+ 'input tap %s %s' % (x_coord, y_coord))
def InputSwipe(self, left_start_coord, top_start_coord, left_end_coord,
top_end_coord, duration):
@@ -98,14 +98,14 @@ class AndroidActionRunner(object):
top_end_coord: The vertical ending coordinate of the gesture
duration: The length of time of the swipe in milliseconds
"""
- self._platform_backend.adb.RunShellCommand(
+ self._platform_backend.device.RunShellCommand(
'input swipe %s %s %s %s %s' % (left_start_coord, top_start_coord,
left_end_coord, top_end_coord,
duration))
def InputPress(self):
"""Perform a press input."""
- self._platform_backend.adb.RunShellCommand('input press')
+ self._platform_backend.device.RunShellCommand('input press')
def InputRoll(self, dx, dy):
"""Perform a roll input. This sends a simple zero-pressure move event.
@@ -114,7 +114,7 @@ class AndroidActionRunner(object):
dx: Change in the x coordinate due to move.
dy: Change in the y coordinate due to move.
"""
- self._platform_backend.adb.RunShellCommand('input roll %s %s' % (dx, dy))
+ self._platform_backend.device.RunShellCommand('input roll %s %s' % (dx, dy))
def EnsureScreenOn(self):
"""If device screen is off, turn screen on.
@@ -173,7 +173,7 @@ class AndroidActionRunner(object):
return not self._platform_backend.IsScreenLocked()
if self._platform_backend.IsScreenLocked():
- self._platform_backend.adb.RunShellCommand('input keyevent 82')
+ self._platform_backend.device.SendKeyEvent(82)
else:
logging.warning('Screen not locked when expected.')
return
@@ -181,4 +181,4 @@ class AndroidActionRunner(object):
util.WaitFor(is_screen_unlocked, 5)
def _ToggleScreenOn(self):
- self._platform_backend.adb.RunShellCommand('input keyevent 26')
+ self._platform_backend.device.SendKeyEvent(26)

Powered by Google App Engine
This is Rietveld 408576698