Chromium Code Reviews| 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 """Launches Android Virtual Devices with a set configuration for testing Chrome. | 6 """Launches Android Virtual Devices with a set configuration for testing Chrome. |
| 7 | 7 |
| 8 The script will launch a specified number of Android Virtual Devices (AVD's). | 8 The script will launch a specified number of Android Virtual Devices (AVD's). |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 run_parser.add_argument('--partition-size', dest='partition_size', | 51 run_parser.add_argument('--partition-size', dest='partition_size', |
| 52 default=emulator.DEFAULT_STORAGE_SIZE, | 52 default=emulator.DEFAULT_STORAGE_SIZE, |
| 53 help='Default internal storage size' | 53 help='Default internal storage size' |
| 54 ' e.g. --partition-size=1024M') | 54 ' e.g. --partition-size=1024M') |
| 55 run_parser.add_argument('--launch-without-kill', action='store_false', | 55 run_parser.add_argument('--launch-without-kill', action='store_false', |
| 56 dest='kill_and_launch', default=True, | 56 dest='kill_and_launch', default=True, |
| 57 help='Kill all emulators at launch') | 57 help='Kill all emulators at launch') |
| 58 run_parser.add_argument('--enable-kvm', action='store_true', | 58 run_parser.add_argument('--enable-kvm', action='store_true', |
| 59 dest='enable_kvm', default=False, | 59 dest='enable_kvm', default=False, |
| 60 help='Enable kvm for faster x86 emulator run') | 60 help='Enable kvm for faster x86 emulator run') |
| 61 run_parser.add_argument('--on-bot', action='store_true', | |
|
jbudorick
2016/01/27 15:58:42
this should probably be --headless
Yoland Yan(Google)
2016/01/27 17:57:14
Done.
| |
| 62 dest='on_bot', default=False, | |
| 63 help='Running emulator on a bot through ssh, launch ' | |
| 64 'emulator with no ui') | |
| 61 | 65 |
| 62 arguments = arg_parser.parse_args(argv[1:]) | 66 arguments = arg_parser.parse_args(argv[1:]) |
| 63 | 67 |
| 64 logging.root.setLevel(logging.INFO) | 68 logging.root.setLevel(logging.INFO) |
| 65 | 69 |
| 66 devil_chromium.Initialize() | 70 devil_chromium.Initialize() |
| 67 | 71 |
| 68 if arguments.command == 'kill': | 72 if arguments.command == 'kill': |
| 69 logging.info('Killing all existing emulator and existing the program') | 73 logging.info('Killing all existing emulator and existing the program') |
| 70 emulator.KillAllEmulators() | 74 emulator.KillAllEmulators() |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 'Run install_emulator_deps.py.') | 117 'Run install_emulator_deps.py.') |
| 114 return 1 | 118 return 1 |
| 115 | 119 |
| 116 if arguments.name: | 120 if arguments.name: |
| 117 emulator.LaunchEmulator( | 121 emulator.LaunchEmulator( |
| 118 arguments.name, | 122 arguments.name, |
| 119 arguments.abi, | 123 arguments.abi, |
| 120 enable_kvm=arguments.enable_kvm, | 124 enable_kvm=arguments.enable_kvm, |
| 121 kill_and_launch=arguments.reset_and_launch, | 125 kill_and_launch=arguments.reset_and_launch, |
| 122 sdcard_size=arguments.sdcard_size, | 126 sdcard_size=arguments.sdcard_size, |
| 123 storage_size=arguments.partition_size | 127 storage_size=arguments.partition_size, |
| 128 on_bot=arguments.on_bot | |
| 124 ) | 129 ) |
| 125 else: | 130 else: |
| 126 emulator.LaunchTempEmulators( | 131 emulator.LaunchTempEmulators( |
| 127 arguments.emulator_count, | 132 arguments.emulator_count, |
| 128 arguments.abi, | 133 arguments.abi, |
| 129 arguments.api_level, | 134 arguments.api_level, |
| 130 enable_kvm=arguments.enable_kvm, | 135 enable_kvm=arguments.enable_kvm, |
| 131 kill_and_launch=arguments.kill_and_launch, | 136 kill_and_launch=arguments.kill_and_launch, |
| 132 sdcard_size=arguments.sdcard_size, | 137 sdcard_size=arguments.sdcard_size, |
| 133 storage_size=arguments.partition_size, | 138 storage_size=arguments.partition_size, |
| 134 wait_for_boot=True | 139 wait_for_boot=True, |
| 140 on_bot=arguments.on_bot | |
| 135 ) | 141 ) |
| 136 | 142 |
| 137 if __name__ == '__main__': | 143 if __name__ == '__main__': |
| 138 sys.exit(main(sys.argv)) | 144 sys.exit(main(sys.argv)) |
| OLD | NEW |