OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Runs a monkey test on a single device.""" | 5 """Runs a monkey test on a single device.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import random | 8 import random |
9 | 9 |
| 10 from devil.android import device_errors |
| 11 from devil.android.sdk import intent |
10 from pylib import constants | 12 from pylib import constants |
11 from pylib.base import base_test_result | 13 from pylib.base import base_test_result |
12 from pylib.base import base_test_runner | 14 from pylib.base import base_test_runner |
13 from pylib.device import device_errors | |
14 from pylib.device import intent | |
15 | 15 |
16 _CHROME_PACKAGE = constants.PACKAGE_INFO['chrome'].package | 16 _CHROME_PACKAGE = constants.PACKAGE_INFO['chrome'].package |
17 | 17 |
18 class TestRunner(base_test_runner.BaseTestRunner): | 18 class TestRunner(base_test_runner.BaseTestRunner): |
19 """A TestRunner instance runs a monkey test on a single device.""" | 19 """A TestRunner instance runs a monkey test on a single device.""" |
20 | 20 |
21 def __init__(self, test_options, device, _): | 21 def __init__(self, test_options, device, _): |
22 super(TestRunner, self).__init__(device, None) | 22 super(TestRunner, self).__init__(device, None) |
23 self._options = test_options | 23 self._options = test_options |
24 self._package = constants.PACKAGE_INFO[self._options.package].package | 24 self._package = constants.PACKAGE_INFO[self._options.package].package |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 activity='%s.crash.MinidumpUploadService' % _CHROME_PACKAGE) | 101 activity='%s.crash.MinidumpUploadService' % _CHROME_PACKAGE) |
102 try: | 102 try: |
103 self.device.RunShellCommand( | 103 self.device.RunShellCommand( |
104 ['am', 'startservice'] + minidump_intent.am_args, | 104 ['am', 'startservice'] + minidump_intent.am_args, |
105 as_root=True, check_return=True) | 105 as_root=True, check_return=True) |
106 except device_errors.CommandFailedError: | 106 except device_errors.CommandFailedError: |
107 logging.exception('Failed to start MinidumpUploadService') | 107 logging.exception('Failed to start MinidumpUploadService') |
108 | 108 |
109 results.AddResult(result) | 109 results.AddResult(result) |
110 return results, False | 110 return results, False |
OLD | NEW |