| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Runs the Monkey tests on one or more devices.""" | 6 """Runs the Monkey tests on one or more devices.""" |
| 7 import logging | 7 import logging |
| 8 import optparse | 8 import optparse |
| 9 import random | 9 import random |
| 10 import sys | 10 import sys |
| 11 import time | 11 import time |
| 12 | 12 |
| 13 from pylib import android_commands | 13 from pylib import android_commands |
| 14 from pylib import python_test_base | |
| 15 from pylib import python_test_sharder | |
| 16 from pylib import test_options_parser | 14 from pylib import test_options_parser |
| 17 from pylib import test_result | 15 from pylib import test_result |
| 16 from pylib.host_driven import python_test_base |
| 17 from pylib.host_driven import python_test_sharder |
| 18 | 18 |
| 19 | 19 |
| 20 class MonkeyTest(python_test_base.PythonTestBase): | 20 class MonkeyTest(python_test_base.PythonTestBase): |
| 21 def testMonkey(self): | 21 def testMonkey(self): |
| 22 start_ms = int(time.time()) * 1000 | 22 start_ms = int(time.time()) * 1000 |
| 23 | 23 |
| 24 # Launch and wait for Chrome to launch. | 24 # Launch and wait for Chrome to launch. |
| 25 self.adb.StartActivity(self.options.package_name, | 25 self.adb.StartActivity(self.options.package_name, |
| 26 self.options.activity_name, | 26 self.options.activity_name, |
| 27 wait_for_completion=True, | 27 wait_for_completion=True, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 parser.error('Missing package name') | 149 parser.error('Missing package name') |
| 150 | 150 |
| 151 if options.category: | 151 if options.category: |
| 152 options.category = options.category.split(',') | 152 options.category = options.category.split(',') |
| 153 | 153 |
| 154 DispatchPythonTests(options) | 154 DispatchPythonTests(options) |
| 155 | 155 |
| 156 | 156 |
| 157 if __name__ == '__main__': | 157 if __name__ == '__main__': |
| 158 main() | 158 main() |
| OLD | NEW |