| 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 """Installs deps for using SDK emulator for testing. | 6 """Installs deps for using SDK emulator for testing. |
| 7 | 7 |
| 8 The script will download the SDK and system images, if they are not present, and | 8 The script will download the SDK and system images, if they are not present, and |
| 9 install and enable KVM, if virtualization has been enabled in the BIOS. | 9 install and enable KVM, if virtualization has been enabled in the BIOS. |
| 10 """ | 10 """ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 from pylib.utils import run_tests_helper | 23 from pylib.utils import run_tests_helper |
| 24 | 24 |
| 25 # Android API level | 25 # Android API level |
| 26 DEFAULT_ANDROID_API_LEVEL = constants.ANDROID_SDK_VERSION | 26 DEFAULT_ANDROID_API_LEVEL = constants.ANDROID_SDK_VERSION |
| 27 | 27 |
| 28 # From the Android Developer's website. | 28 # From the Android Developer's website. |
| 29 # Keep this up to date; the user can install older API levels as necessary. | 29 # Keep this up to date; the user can install older API levels as necessary. |
| 30 SDK_BASE_URL = 'http://dl.google.com/android/adt' | 30 SDK_BASE_URL = 'http://dl.google.com/android/adt' |
| 31 SDK_ZIP = 'adt-bundle-linux-x86_64-20131030.zip' | 31 SDK_ZIP = 'adt-bundle-linux-x86_64-20131030.zip' |
| 32 | 32 |
| 33 # pylint: disable=C0301 |
| 33 # Android x86 system image from the Intel website: | 34 # Android x86 system image from the Intel website: |
| 34 # http://software.intel.com/en-us/articles/intel-eula-x86-android-4-2-jelly-bean
-bin | 35 # http://software.intel.com/en-us/articles/intel-eula-x86-android-4-2-jelly-bean
-bin |
| 35 # These don't exist prior to Android-15. | 36 # These don't exist prior to Android-15. |
| 36 # As of 08 Nov 2013, Android-19 is not yet available either. | 37 # As of 08 Nov 2013, Android-19 is not yet available either. |
| 37 X86_IMG_URLS = { | 38 X86_IMG_URLS = { |
| 38 15: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
5_r01.zip', | 39 15: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
5_r01.zip', |
| 39 16: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
6_r01.zip', | 40 16: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
6_r01.zip', |
| 40 17: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
7_r01.zip', | 41 17: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
7_r01.zip', |
| 41 18: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
8_r01.zip', | 42 18: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
8_r01.zip', |
| 42 19: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
9_r01.zip'} | 43 19: 'http://download-software.intel.com/sites/landingpage/android/sysimg_x86-1
9_r01.zip'} |
| 44 #pylint: enable=C0301 |
| 43 | 45 |
| 44 def CheckSDK(): | 46 def CheckSDK(): |
| 45 """Check if SDK is already installed. | 47 """Check if SDK is already installed. |
| 46 | 48 |
| 47 Returns: | 49 Returns: |
| 48 True if the emulator SDK directory (src/android_emulator_sdk/) exists. | 50 True if the emulator SDK directory (src/android_emulator_sdk/) exists. |
| 49 """ | 51 """ |
| 50 return os.path.exists(constants.EMULATOR_SDK_ROOT) | 52 return os.path.exists(constants.EMULATOR_SDK_ROOT) |
| 51 | 53 |
| 52 | 54 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 | 268 |
| 267 # Make sure KVM packages are installed and enabled. | 269 # Make sure KVM packages are installed and enabled. |
| 268 if CheckKVM(): | 270 if CheckKVM(): |
| 269 logging.info('KVM already installed and enabled.') | 271 logging.info('KVM already installed and enabled.') |
| 270 else: | 272 else: |
| 271 InstallKVM() | 273 InstallKVM() |
| 272 | 274 |
| 273 | 275 |
| 274 if __name__ == '__main__': | 276 if __name__ == '__main__': |
| 275 sys.exit(main(sys.argv)) | 277 sys.exit(main(sys.argv)) |
| OLD | NEW |