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

Unified Diff: build/android/pylib/local/device/local_device_environment.py

Issue 788753002: [Android] Implement gtest and local in platform mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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: build/android/pylib/local/device/local_device_environment.py
diff --git a/build/android/pylib/local/device/local_device_environment.py b/build/android/pylib/local/device/local_device_environment.py
new file mode 100644
index 0000000000000000000000000000000000000000..c0151ae4a9735c75565faf6ce1051a6348d3c9ee
--- /dev/null
+++ b/build/android/pylib/local/device/local_device_environment.py
@@ -0,0 +1,51 @@
+# 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.
+
+from pylib.base import environment
+from pylib.device import adb_wrapper
+from pylib.device import device_errors
+from pylib.device import device_utils
+from pylib.utils import parallelizer
+
+
+class LocalDeviceEnvironment(environment.Environment):
+
+ def __init__(self, args, _error_func):
+ super(LocalDeviceEnvironment, self).__init__()
+ self._device = args.test_device
+ self._devices = []
+ self._max_tries = 1 + args.num_retries
+
+ #override
+ def SetUp(self):
+ # TODO(jbudorick) This can be refined to support filters etc.
klundberg 2014/12/09 02:30:47 : after (jbudorick)
+ available_devices = adb_wrapper.AdbWrapper.GetDevices()
+ if not available_devices:
+ raise device_errors.NoDevicesError
+ if self._device:
+ if self._device not in available_devices:
+ raise device_errors.DeviceUnreachableError(
+ 'Could not find device %r' % self._device)
+ self._devices = [device_utils.DeviceUtils(self._device)]
+ else:
+ self._devices = [
+ device_utils.DeviceUtils(s)
+ for s in available_devices]
+
+ @property
+ def devices(self):
+ return self._devices
+
+ @property
+ def parallel_devices(self):
+ return parallelizer.SyncParallelizer(self._devices)
+
+ @property
+ def max_tries(self):
+ return self._max_tries
+
+ #override
+ def TearDown(self):
+ pass
+

Powered by Google App Engine
This is Rietveld 408576698