Index: build/android/pylib/remote/device/remote_device_gtest_run.py |
diff --git a/build/android/pylib/remote/device/remote_device_gtest_run.py b/build/android/pylib/remote/device/remote_device_gtest_run.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e4a03726a5f290f53362d3cf679b772ae37c42a1 |
--- /dev/null |
+++ b/build/android/pylib/remote/device/remote_device_gtest_run.py |
@@ -0,0 +1,68 @@ |
+# 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. |
+ |
+"""Run specific test on specific environment.""" |
+ |
+import logging |
+import os |
+import sys |
+ |
+from pylib import constants |
+from pylib.base.base_test_result import TestRunResults |
jbudorick
2014/12/05 01:01:46
import base_test_result, not TestRunResults
rnephew (Reviews Here)
2014/12/05 15:45:40
Done.
|
+from pylib.remote.device import remote_device_test_run |
+from pylib.remote.device import remote_device_helper |
+ |
+ |
+sys.path.append(os.path.join( |
+ constants.DIR_SOURCE_ROOT, 'third_party', 'appurify-python', 'src')) |
+import appurify.api |
+import appurify.utils |
+ |
+class RemoteDeviceGtestRun(remote_device_test_run.RemoteDeviceTestRun): |
+ """Run gtests and uirobot tests on a remote device.""" |
+ |
+ DEFAULT_RUNNER_TYPE = 'robotium' |
+ DEFAULT_RUNNER_PACKAGE = ( |
+ 'org.chromium.native_test.ChromiumNativeTestInstrumentationTestRunner') |
+ |
+ def __init__(self, env, test_instance): |
jbudorick
2014/12/05 01:01:46
If this is just calling the base class constructor
rnephew (Reviews Here)
2014/12/05 15:45:40
Done.
|
+ """Constructor. |
+ |
+ Args: |
+ env: Environment the tests will run in. |
+ test_instance: The test that will be run. |
+ """ |
+ super(RemoteDeviceGtestRun, self).__init__(env, test_instance) |
+ |
+ def TestPackage(self): |
+ pass |
+ |
+ #override |
+ def SetUp(self): |
+ """Setup the test run.""" |
+ if self._env.trigger: |
+ self._app_id = self._UploadAppToDevice(self._test_instance.apk) |
+ |
+ if not self._env.runner_type: |
+ runner_type = self.DEFAULT_RUNNER_TYPE |
+ logging.debug('Using default runner type: %s', self.DEFAULT_RUNNER_TYPE) |
+ else: |
+ runner_type = self._env.runner_type |
+ |
+ if not self._env.runner_package: |
+ runner_package = self.DEFAULT_RUNNER_PACKAGE |
+ logging.debug('Using default runner package: %s', |
+ self.DEFAULT_RUNNER_TYPE) |
+ else: |
+ runner_package = self._env.runner_package |
+ |
+ self._test_id = self._UploadTestToDevice(runner_type) |
+ config_body = {'runner': runner_package} |
+ self._SetTestConfig(runner_type, config_body) |
+ |
+ #override |
+ def _ParseTestResults(self): |
+ #TODO(rnephew): Populate test results object. |
jbudorick
2014/12/05 01:01:46
nit: space after TODO
rnephew (Reviews Here)
2014/12/05 15:45:40
Done.
|
+ results = TestRunResults() |
+ return results |