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

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

Issue 400863002: [Telemetry] Allow the Monsoon to power the device under test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/telemetry/telemetry/core/platform/power_monitor/monsoon_power_monitor.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_finder.py
diff --git a/tools/telemetry/telemetry/core/backends/chrome/android_browser_finder.py b/tools/telemetry/telemetry/core/backends/chrome/android_browser_finder.py
index f0a5ae53e4fac7ee0ed366b63671f7474d5ecd84..7c23ea4881b3aa646a43a7e97444dcdd228305ac 100644
--- a/tools/telemetry/telemetry/core/backends/chrome/android_browser_finder.py
+++ b/tools/telemetry/telemetry/core/backends/chrome/android_browser_finder.py
@@ -18,6 +18,7 @@ from telemetry.core import util
from telemetry.core.backends import adb_commands
from telemetry.core.backends.chrome import android_browser_backend
from telemetry.core.platform import android_platform_backend
+from telemetry.core.platform.profiler import monsoon
CHROME_PACKAGE_NAMES = {
@@ -176,6 +177,7 @@ def CanFindAvailableBrowsers(logging=real_logging):
adb_works = False
return adb_works
+
def FindAllAvailableBrowsers(finder_options, logging=real_logging):
"""Finds all the desktop browsers available on this machine."""
if not CanFindAvailableBrowsers(logging=logging):
@@ -183,15 +185,38 @@ def FindAllAvailableBrowsers(finder_options, logging=real_logging):
'Will not try searching for Android browsers.')
return []
- device = None
- if finder_options.android_device:
- devices = [finder_options.android_device]
- else:
- devices = adb_commands.GetAttachedDevices()
+ def _GetDevices():
+ if finder_options.android_device:
+ return [finder_options.android_device]
+ else:
+ return adb_commands.GetAttachedDevices()
- if len(devices) == 0:
- logging.info('No android devices found.')
- return []
+ devices = _GetDevices()
+
+ if not devices:
+ try:
+ m = monsoon.Monsoon(wait=False)
+ m.SetUsbPassthrough(1)
+ m.SetVoltage(3.8)
qsr 2014/07/23 08:27:40 We are using 4V in the profiler. Any reason not to
+ m.SetMaxCurrent(8)
+ logging.warn("""
+Monsoon power monitor detected, but no Android devices.
+
+The Monsoon's power output has been enabled. Please now ensure that:
+
+ 1. The Monsoon's front and back USB are connected to the host.
+ 2. The Device is connected to the Monsoon's main and USB channels.
+ 3. The Device is turned on.
+
+Waiting for device...
+""")
+ util.WaitFor(_GetDevices, 600)
+ devices = _GetDevices()
+ if not devices:
+ raise IOError()
+ except IOError:
+ logging.info('No android devices found.')
+ return []
if len(devices) > 1:
logging.warn(
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/platform/power_monitor/monsoon_power_monitor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698