[Android] Fixes for instrumentation in platform mode.

https://codereview.chromium.org/794923003/ had a few problems:
 - it broke uiautomator test output parsing
 - it had a typo in InstrumentationTestInstance
 - it had an error in how it handles instrumentation's test dict objects

BUG=428729

Review URL: https://codereview.chromium.org/854733002

Cr-Original-Commit-Position: refs/heads/master@{#311575}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a4dac37b42fa1aa2e02073e00dc55e70159268d0
This commit is contained in:
jbudorick 2015-01-14 15:52:47 -08:00 коммит произвёл Commit bot
Родитель 16b77fd59b
Коммит 9aac76f946
3 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -152,7 +152,7 @@ class InstrumentationTestInstance(test_instance.TestInstance):
self._test_package = None
self._test_runner = None
self._test_support_apk = None
self.__inititalizeApkAttributes(args, error_func)
self.__initializeApkAttributes(args, error_func)
self._data_deps = None
self._isolate_abs_path = None

Просмотреть файл

@ -321,6 +321,10 @@ class TestRunner(base_test_runner.BaseTestRunner):
'%s/%s' % (self.test_pkg.GetPackageName(), self.options.test_runner),
raw=True, extras=extras, timeout=timeout, retries=0)
def _GenerateTestResult(self, test, instr_statuses, start_ms, duration_ms):
return instrumentation_test_instance.GenerateTestResult(
test, instr_statuses, start_ms, duration_ms)
#override
def RunTest(self, test):
results = base_test_result.TestRunResults()
@ -344,8 +348,7 @@ class TestRunner(base_test_runner.BaseTestRunner):
# Parse the test output
_, _, statuses = (
instrumentation_test_instance.ParseAmInstrumentRawOutput(raw_output))
result = instrumentation_test_instance.GenerateTestResult(
test, statuses, start_ms, duration_ms)
result = self._GenerateTestResult(test, statuses, start_ms, duration_ms)
if local_device_instrumentation_test_run.DidPackageCrashOnDevice(
self.test_pkg.GetPackageName(), self.device):
result.SetType(base_test_result.ResultType.CRASH)

Просмотреть файл

@ -58,7 +58,7 @@ class LocalDeviceTestRun(test_run.TestRun):
all_fail_results[result.GetName()] = result
results_names = set(r.GetName() for r in results.GetAll())
tests = [t for t in tests if t not in results_names]
tests = [t for t in tests if self._GetTestName(t) not in results_names]
tries += 1
all_unknown_test_names = set(tests)
@ -85,6 +85,9 @@ class LocalDeviceTestRun(test_run.TestRun):
def _CreateShards(self, tests):
raise NotImplementedError
def _GetTestName(self, test):
return test
def _GetTests(self):
raise NotImplementedError