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

Unified Diff: build/android/pylib/gtest/test_runner.py

Issue 221823011: [Android] Change object types from AndroidCommands to DeviceUtils in build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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
« no previous file with comments | « build/android/pylib/gtest/test_package_exe.py ('k') | build/android/pylib/host_driven/test_case.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/gtest/test_runner.py
diff --git a/build/android/pylib/gtest/test_runner.py b/build/android/pylib/gtest/test_runner.py
index 9013668221de0b057caaf015276b6ffaf0b1ef3e..51248612a1726a74da32f934d0830b88e094d676 100644
--- a/build/android/pylib/gtest/test_runner.py
+++ b/build/android/pylib/gtest/test_runner.py
@@ -6,11 +6,11 @@ import logging
import os
import re
-from pylib import android_commands
from pylib import constants
from pylib import pexpect
from pylib.base import base_test_result
from pylib.base import base_test_runner
+from pylib.device import adb_wrapper
from pylib.perf import perf_control
@@ -53,24 +53,24 @@ class TestRunner(base_test_runner.BaseTestRunner):
self._timeout = timeout * self.tool.GetTimeoutScale()
if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name):
- self._perf_controller = perf_control.PerfControl(self.adb)
+ self._perf_controller = perf_control.PerfControl(self.device)
#override
def InstallTestPackage(self):
- self.test_package.Install(self.adb)
+ self.test_package.Install(self.device)
#override
def PushDataDeps(self):
- self.adb.WaitForSdCardReady(20)
+ self.device.old_interface.WaitForSdCardReady(20)
self.tool.CopyFiles()
if os.path.exists(constants.ISOLATE_DEPS_DIR):
- device_dir = self.adb.GetExternalStorage()
+ device_dir = self.device.old_interface.GetExternalStorage()
# TODO(frankf): linux_dumper_unittest_helper needs to be in the same dir
# as breakpad_unittests exe. Find a better way to do this.
if self.test_package.suite_name == 'breakpad_unittests':
device_dir = constants.TEST_EXECUTABLE_DIR
for p in os.listdir(constants.ISOLATE_DEPS_DIR):
- self.adb.PushIfNeeded(
+ self.device.old_interface.PushIfNeeded(
os.path.join(constants.ISOLATE_DEPS_DIR, p),
os.path.join(device_dir, p))
@@ -128,9 +128,9 @@ class TestRunner(base_test_runner.BaseTestRunner):
logging.error('Test terminated - EOF')
# We're here because either the device went offline, or the test harness
# crashed without outputting the CRASHED marker (crbug.com/175538).
- if not self.adb.IsOnline():
- raise android_commands.errors.DeviceUnresponsiveError(
- 'Device %s went offline.' % self.device)
+ if not self.device.old_interface.IsOnline():
+ raise adb_wrapper.DeviceUnreachableError(
+ 'Device %s went offline.' % self.device.old_interface.GetDevice())
if full_test_name:
results.AddResult(base_test_result.BaseTestResult(
full_test_name, base_test_result.ResultType.CRASH,
@@ -145,7 +145,7 @@ class TestRunner(base_test_runner.BaseTestRunner):
finally:
p.close()
- ret_code = self.test_package.GetGTestReturnCode(self.adb)
+ ret_code = self.test_package.GetGTestReturnCode(self.device)
if ret_code:
logging.critical(
'gtest exit code: %d\npexpect.before: %s\npexpect.after: %s',
@@ -160,11 +160,11 @@ class TestRunner(base_test_runner.BaseTestRunner):
return test_results, None
try:
- self.test_package.ClearApplicationState(self.adb)
+ self.test_package.ClearApplicationState(self.device)
self.test_package.CreateCommandLineFileOnDevice(
- self.adb, test, self._test_arguments)
+ self.device, test, self._test_arguments)
test_results = self._ParseTestOutput(
- self.test_package.SpawnTestProcess(self.adb))
+ self.test_package.SpawnTestProcess(self.device))
finally:
self.CleanupSpawningServerState()
# Calculate unknown test results.
@@ -192,6 +192,6 @@ class TestRunner(base_test_runner.BaseTestRunner):
"""Cleans up the test enviroment for the test suite."""
if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name):
self._perf_controller.RestoreOriginalPerfMode()
- self.test_package.ClearApplicationState(self.adb)
+ self.test_package.ClearApplicationState(self.device)
self.tool.CleanUpEnvironment()
super(TestRunner, self).TearDown()
« no previous file with comments | « build/android/pylib/gtest/test_package_exe.py ('k') | build/android/pylib/host_driven/test_case.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698