Chromium Code Reviews| Index: build/android/run_monkey_test.py |
| diff --git a/build/android/run_monkey_test.py b/build/android/run_monkey_test.py |
| index 7bae4c2623d16a23ec6a408e31742af3ce65da88..a2f4424642c190b9769201f0442fd23ac42a721b 100755 |
| --- a/build/android/run_monkey_test.py |
| +++ b/build/android/run_monkey_test.py |
| @@ -8,19 +8,17 @@ import logging |
| import optparse |
| import random |
| import sys |
| -import time |
| from pylib import android_commands |
| -from pylib.base import test_result |
| +from pylib.base import base_test_result |
| from pylib.host_driven import python_test_base |
| from pylib.host_driven import python_test_sharder |
| +from pylib.utils import report_results |
| from pylib.utils import test_options_parser |
| class MonkeyTest(python_test_base.PythonTestBase): |
| def testMonkey(self): |
| - start_ms = int(time.time()) * 1000 |
| - |
| # Launch and wait for Chrome to launch. |
| self.adb.StartActivity(self.options.package_name, |
| self.options.activity_name, |
| @@ -34,22 +32,21 @@ class MonkeyTest(python_test_base.PythonTestBase): |
| # Run the test. |
| output = '' |
| - duration_ms = 0 |
| if before_pids: |
| output = '\n'.join(self._LaunchMonkeyTest()) |
| - duration_ms = int(time.time()) * 1000 - start_ms |
| after_pids = self.adb.ExtractPid(self.options.package_name) |
| crashed = (not before_pids or not after_pids |
| or after_pids[0] != before_pids[0]) |
| - result = test_result.SingleTestResult(self.qualified_name, start_ms, |
| - duration_ms, log=output) |
| - results = test_result.TestResults() |
| + results = base_test_result.TestRunResults() |
| if 'Monkey finished' in output and not crashed: |
| - results.ok = [result] |
| + result = base_test_result.BaseTestResult( |
| + self.qualified_name, base_test_result.TestType.PASS, log=output) |
| else: |
| - results.crashed = [result] |
| + result = base_test_result.BaseTestResult( |
| + self.qualified_name, base_test_result.TestType.FAIL, log=output) |
| + results.AddResult(result) |
|
craigdh
2013/03/25 19:08:45
nit: no blank line
frankf
2013/03/25 22:37:39
Done.
|
| return results |
| @@ -107,12 +104,13 @@ def DispatchPythonTests(options): |
| options.ensure_value('shard_retries', 1) |
| sharder = python_test_sharder.PythonTestSharder( |
| attached_devices, available_tests, options) |
| - result = sharder.RunShardedTests() |
| - result.LogFull( |
| + results = sharder.RunShardedTests() |
| + report_results.LogFull( |
| + results=results, |
| test_type='Monkey', |
| test_package='Monkey', |
| build_type=options.build_type) |
| - result.PrintAnnotation() |
| + report_results.PrintAnnotation(results) |
| def main(): |