| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 import collections | 6 import collections |
| 7 import glob | 7 import glob |
| 8 import multiprocessing | 8 import multiprocessing |
| 9 import os | 9 import os |
| 10 import shutil | 10 import shutil |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 'ChromiumTestShellTest', | 57 'ChromiumTestShellTest', |
| 58 'chrome:chrome/test/data/android/device_files', | 58 'chrome:chrome/test/data/android/device_files', |
| 59 constants.CHROMIUM_TEST_SHELL_HOST_DRIVEN_DIR), | 59 constants.CHROMIUM_TEST_SHELL_HOST_DRIVEN_DIR), |
| 60 I('AndroidWebView', | 60 I('AndroidWebView', |
| 61 'AndroidWebView.apk', | 61 'AndroidWebView.apk', |
| 62 'org.chromium.android_webview.shell', | 62 'org.chromium.android_webview.shell', |
| 63 'AndroidWebViewTest', | 63 'AndroidWebViewTest', |
| 64 'webview:android_webview/test/data/device_files'), | 64 'webview:android_webview/test/data/device_files'), |
| 65 ]) | 65 ]) |
| 66 | 66 |
| 67 VALID_TESTS = set(['chromedriver', 'ui', 'unit', 'webkit', 'webkit_layout']) | 67 VALID_TESTS = set(['chromedriver', 'ui', 'unit', 'webkit', 'webkit_layout', |
| 68 'webrtc']) |
| 68 | 69 |
| 69 RunCmd = bb_utils.RunCmd | 70 RunCmd = bb_utils.RunCmd |
| 70 | 71 |
| 71 | 72 |
| 72 # multiprocessing map_async requires a top-level function for pickle library. | 73 # multiprocessing map_async requires a top-level function for pickle library. |
| 73 def RebootDeviceSafe(device): | 74 def RebootDeviceSafe(device): |
| 74 """Reboot a device, wait for it to start, and squelch timeout exceptions.""" | 75 """Reboot a device, wait for it to start, and squelch timeout exceptions.""" |
| 75 try: | 76 try: |
| 76 android_commands.AndroidCommands(device).Reboot(True) | 77 android_commands.AndroidCommands(device).Reboot(True) |
| 77 except errors.DeviceUnresponsiveError as e: | 78 except errors.DeviceUnresponsiveError as e: |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 def RunInstrumentationTests(options): | 271 def RunInstrumentationTests(options): |
| 271 for test in INSTRUMENTATION_TESTS.itervalues(): | 272 for test in INSTRUMENTATION_TESTS.itervalues(): |
| 272 RunInstrumentationSuite(options, test) | 273 RunInstrumentationSuite(options, test) |
| 273 | 274 |
| 274 | 275 |
| 275 def RunWebkitTests(options): | 276 def RunWebkitTests(options): |
| 276 RunTestSuites(options, ['webkit_unit_tests']) | 277 RunTestSuites(options, ['webkit_unit_tests']) |
| 277 RunWebkitLint(options.target) | 278 RunWebkitLint(options.target) |
| 278 | 279 |
| 279 | 280 |
| 281 def RunWebRTCTests(options): |
| 282 RunTestSuites(options, gtest_config.WEBRTC_TEST_SUITES) |
| 283 |
| 284 |
| 280 def GetTestStepCmds(): | 285 def GetTestStepCmds(): |
| 281 return [ | 286 return [ |
| 282 ('chromedriver', RunChromeDriverTests), | 287 ('chromedriver', RunChromeDriverTests), |
| 283 ('unit', RunUnitTests), | 288 ('unit', RunUnitTests), |
| 284 ('ui', RunInstrumentationTests), | 289 ('ui', RunInstrumentationTests), |
| 285 ('webkit', RunWebkitTests), | 290 ('webkit', RunWebkitTests), |
| 286 ('webkit_layout', RunWebkitLayoutTests) | 291 ('webkit_layout', RunWebkitLayoutTests), |
| 292 ('webrtc', RunWebRTCTests), |
| 287 ] | 293 ] |
| 288 | 294 |
| 289 | 295 |
| 290 def LogcatDump(options): | 296 def LogcatDump(options): |
| 291 # Print logcat, kill logcat monitor | 297 # Print logcat, kill logcat monitor |
| 292 bb_annotations.PrintNamedStep('logcat_dump') | 298 bb_annotations.PrintNamedStep('logcat_dump') |
| 293 logcat_file = os.path.join(CHROME_SRC, 'out', options.target, 'full_log') | 299 logcat_file = os.path.join(CHROME_SRC, 'out', options.target, 'full_log') |
| 294 with open(logcat_file, 'w') as f: | 300 with open(logcat_file, 'w') as f: |
| 295 RunCmd([ | 301 RunCmd([ |
| 296 os.path.join(CHROME_SRC, 'build', 'android', 'adb_logcat_printer.py'), | 302 os.path.join(CHROME_SRC, 'build', 'android', 'adb_logcat_printer.py'), |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 if unknown_tests: | 378 if unknown_tests: |
| 373 return sys.exit('Unknown tests %s' % list(unknown_tests)) | 379 return sys.exit('Unknown tests %s' % list(unknown_tests)) |
| 374 | 380 |
| 375 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 381 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
| 376 | 382 |
| 377 MainTestWrapper(options) | 383 MainTestWrapper(options) |
| 378 | 384 |
| 379 | 385 |
| 380 if __name__ == '__main__': | 386 if __name__ == '__main__': |
| 381 sys.exit(main(sys.argv)) | 387 sys.exit(main(sys.argv)) |
| OLD | NEW |