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

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: fix findbugs + move log parsing up to GtestTestInstance 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..72acb6e2ec44e71ce1922b88225888035123a68d
--- /dev/null
+++ b/build/android/pylib/local/device/local_device_environment.py
@@ -0,0 +1,56 @@
+# 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
+ self._tool_name = args.tool
+
+ #override
+ def SetUp(self):
+ # TODO(jbudorick): This can be refined to support filters etc.
+ 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
+
+ @property
+ def tool(self):
+ return self._tool_name
+
+ #override
+ def TearDown(self):
+ pass
+
« no previous file with comments | « build/android/pylib/local/device/__init__.py ('k') | build/android/pylib/local/device/local_device_test_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698