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

Unified Diff: tools/telemetry/telemetry/core/device_finder.py

Issue 760653002: Telemetry --device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/device_finder.py
diff --git a/tools/telemetry/telemetry/core/device_finder.py b/tools/telemetry/telemetry/core/device_finder.py
new file mode 100644
index 0000000000000000000000000000000000000000..6b67c9b1d86c1f9009a2cbd183e9e71f59d25093
--- /dev/null
+++ b/tools/telemetry/telemetry/core/device_finder.py
@@ -0,0 +1,42 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Finds devices that can be controlled by telemetry."""
+
+from telemetry.core.platform import android_device
+from telemetry.core.platform import cros_device
+from telemetry.core.platform import desktop_device
+from telemetry.core.platform import ios_device
+from telemetry.core.platform import trybot_device
+from telemetry.core.platform import webdriver_desktop_device
+
+DEVICES = [
+ android_device,
+ cros_device,
+ desktop_device,
+ ios_device,
+ trybot_device,
+ webdriver_desktop_device,
+]
+
+
+def GetAllAvailableDevices(options):
+ """Returns a list of available devices.
+ """
+ devices = []
+ for device in DEVICES:
+ devices.extend(device.FindAllAvailableDevices(options))
+
+ return devices
+
+
+def GetAllAvailableDeviceNames(options):
+ """Returns a list of available device names.
+ """
+ device_names = []
+ devices = GetAllAvailableDevices(options)
+ for device in devices:
+ device_names.append(device.name)
+
+ return device_names

Powered by Google App Engine
This is Rietveld 408576698