[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:
Родитель
16b77fd59b
Коммит
9aac76f946
|
@ -152,7 +152,7 @@ class InstrumentationTestInstance(test_instance.TestInstance):
|
||||||
self._test_package = None
|
self._test_package = None
|
||||||
self._test_runner = None
|
self._test_runner = None
|
||||||
self._test_support_apk = None
|
self._test_support_apk = None
|
||||||
self.__inititalizeApkAttributes(args, error_func)
|
self.__initializeApkAttributes(args, error_func)
|
||||||
|
|
||||||
self._data_deps = None
|
self._data_deps = None
|
||||||
self._isolate_abs_path = 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),
|
'%s/%s' % (self.test_pkg.GetPackageName(), self.options.test_runner),
|
||||||
raw=True, extras=extras, timeout=timeout, retries=0)
|
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
|
#override
|
||||||
def RunTest(self, test):
|
def RunTest(self, test):
|
||||||
results = base_test_result.TestRunResults()
|
results = base_test_result.TestRunResults()
|
||||||
|
@ -344,8 +348,7 @@ class TestRunner(base_test_runner.BaseTestRunner):
|
||||||
# Parse the test output
|
# Parse the test output
|
||||||
_, _, statuses = (
|
_, _, statuses = (
|
||||||
instrumentation_test_instance.ParseAmInstrumentRawOutput(raw_output))
|
instrumentation_test_instance.ParseAmInstrumentRawOutput(raw_output))
|
||||||
result = instrumentation_test_instance.GenerateTestResult(
|
result = self._GenerateTestResult(test, statuses, start_ms, duration_ms)
|
||||||
test, statuses, start_ms, duration_ms)
|
|
||||||
if local_device_instrumentation_test_run.DidPackageCrashOnDevice(
|
if local_device_instrumentation_test_run.DidPackageCrashOnDevice(
|
||||||
self.test_pkg.GetPackageName(), self.device):
|
self.test_pkg.GetPackageName(), self.device):
|
||||||
result.SetType(base_test_result.ResultType.CRASH)
|
result.SetType(base_test_result.ResultType.CRASH)
|
||||||
|
|
|
@ -58,7 +58,7 @@ class LocalDeviceTestRun(test_run.TestRun):
|
||||||
all_fail_results[result.GetName()] = result
|
all_fail_results[result.GetName()] = result
|
||||||
|
|
||||||
results_names = set(r.GetName() for r in results.GetAll())
|
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
|
tries += 1
|
||||||
|
|
||||||
all_unknown_test_names = set(tests)
|
all_unknown_test_names = set(tests)
|
||||||
|
@ -85,6 +85,9 @@ class LocalDeviceTestRun(test_run.TestRun):
|
||||||
def _CreateShards(self, tests):
|
def _CreateShards(self, tests):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def _GetTestName(self, test):
|
||||||
|
return test
|
||||||
|
|
||||||
def _GetTests(self):
|
def _GetTests(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче