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

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

Issue 541693004: Move remote platform creation logic from cros_browser_finders to platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address achuith's comments 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
Index: tools/telemetry/telemetry/core/platform/device.py
diff --git a/tools/telemetry/telemetry/core/platform/device.py b/tools/telemetry/telemetry/core/platform/device.py
new file mode 100644
index 0000000000000000000000000000000000000000..5c0730165cb2dcaf123e4fbd69a71908155b247c
--- /dev/null
+++ b/tools/telemetry/telemetry/core/platform/device.py
@@ -0,0 +1,33 @@
+# 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.
+import logging as real_logging
+
+
+class Device(object):
+ """ A base class of devices.
+ A device instance contains all the necessary information for constructing
+ a platform backend object for remote platforms.
+
+ Attributes:
+ name: A device name string in human-understandable term.
+ device_id: A unique id of the device. Subclass of device must specify this
+ id properly so that device objects to a same actual device must have same
+ device_id.
+ """
+
+ def __init__(self, name, device_id):
+ self._name = name
+ self._device_id = device_id
+
+ @property
+ def name(self):
+ return self._name
+
+ @property
+ def device_id(self):
+ return self._device_id
+
+ @classmethod
+ def GetAllConnectedDevices(cls, logging=real_logging):
+ raise NotImplementedError()

Powered by Google App Engine
This is Rietveld 408576698