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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 def RunInstrumentationTests(options): | 280 def RunInstrumentationTests(options): |
280 for test in INSTRUMENTATION_TESTS.itervalues(): | 281 for test in INSTRUMENTATION_TESTS.itervalues(): |
281 RunInstrumentationSuite(options, test) | 282 RunInstrumentationSuite(options, test) |
282 | 283 |
283 | 284 |
284 def RunWebkitTests(options): | 285 def RunWebkitTests(options): |
285 RunTestSuites(options, [gtest_config.Apk('webkit_unit_tests')]) | 286 RunTestSuites(options, [gtest_config.Apk('webkit_unit_tests')]) |
286 RunWebkitLint(options.target) | 287 RunWebkitLint(options.target) |
287 | 288 |
288 | 289 |
290 def RunWebRTCTests(options): | |
291 RunTestSuites(options, gtest_config.WEBRTC_TEST_SUITES) | |
292 | |
289 def GetTestStepCmds(): | 293 def GetTestStepCmds(): |
Isaac (away)
2013/07/31 21:49:09
2 newlines between top-level functions
kjellander_chromium
2013/08/05 11:24:03
Done.
| |
290 return [ | 294 return [ |
291 ('chromedriver', RunChromeDriverTests), | 295 ('chromedriver', RunChromeDriverTests), |
292 ('unit', RunUnitTests), | 296 ('unit', RunUnitTests), |
293 ('ui', RunInstrumentationTests), | 297 ('ui', RunInstrumentationTests), |
294 ('webkit', RunWebkitTests), | 298 ('webkit', RunWebkitTests), |
295 ('webkit_layout', RunWebkitLayoutTests) | 299 ('webkit_layout', RunWebkitLayoutTests), |
300 ('webrtc', RunWebRTCTests), | |
296 ] | 301 ] |
297 | 302 |
298 | 303 |
299 def LogcatDump(options): | 304 def LogcatDump(options): |
300 # Print logcat, kill logcat monitor | 305 # Print logcat, kill logcat monitor |
301 bb_annotations.PrintNamedStep('logcat_dump') | 306 bb_annotations.PrintNamedStep('logcat_dump') |
302 logcat_file = os.path.join(CHROME_SRC, 'out', options.target, 'full_log') | 307 logcat_file = os.path.join(CHROME_SRC, 'out', options.target, 'full_log') |
303 with open(logcat_file, 'w') as f: | 308 with open(logcat_file, 'w') as f: |
304 RunCmd([ | 309 RunCmd([ |
305 os.path.join(CHROME_SRC, 'build', 'android', 'adb_logcat_printer.py'), | 310 os.path.join(CHROME_SRC, 'build', 'android', 'adb_logcat_printer.py'), |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
383 return sys.exit('Unknown tests %s' % list(unknown_tests)) | 388 return sys.exit('Unknown tests %s' % list(unknown_tests)) |
384 | 389 |
385 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 390 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
386 | 391 |
387 MainTestWrapper(options) | 392 MainTestWrapper(options) |
388 provision_devices.KillHostHeartbeat() | 393 provision_devices.KillHostHeartbeat() |
389 | 394 |
390 | 395 |
391 if __name__ == '__main__': | 396 if __name__ == '__main__': |
392 sys.exit(main(sys.argv)) | 397 sys.exit(main(sys.argv)) |
OLD | NEW |