OLD | NEW |
1 # Copyright (C) 2012 Google Inc. All rights reserved. | 1 # Copyright (C) 2012 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 # Avoid initializing the adb path [worker count]+1 times by storing it as a
static member. | 405 # Avoid initializing the adb path [worker count]+1 times by storing it as a
static member. |
406 _adb_path = None | 406 _adb_path = None |
407 | 407 |
408 SUPPORTED_VERSIONS = ('android') | 408 SUPPORTED_VERSIONS = ('android') |
409 | 409 |
410 FALLBACK_PATHS = {'icecreamsandwich': ['android'] + linux.LinuxPort.latest_p
latform_fallback_path()} | 410 FALLBACK_PATHS = {'icecreamsandwich': ['android'] + linux.LinuxPort.latest_p
latform_fallback_path()} |
411 | 411 |
412 # Android has aac and mp3 codecs built in. | 412 # Android has aac and mp3 codecs built in. |
413 PORT_HAS_AUDIO_CODECS_BUILT_IN = True | 413 PORT_HAS_AUDIO_CODECS_BUILT_IN = True |
414 | 414 |
415 BUILD_REQUIREMENTS_URL = 'https://code.google.com/p/chromium/wiki/AndroidBui
ldInstructions' | 415 BUILD_REQUIREMENTS_URL = 'https://www.chromium.org/developers/how-tos/androi
d-build-instructions' |
416 | 416 |
417 def __init__(self, host, port_name, **kwargs): | 417 def __init__(self, host, port_name, **kwargs): |
418 super(AndroidPort, self).__init__(host, port_name, **kwargs) | 418 super(AndroidPort, self).__init__(host, port_name, **kwargs) |
419 | 419 |
420 self._operating_system = 'android' | 420 self._operating_system = 'android' |
421 self._version = 'icecreamsandwich' | 421 self._version = 'icecreamsandwich' |
422 | 422 |
423 self._host_port = factory.PortFactory(host).get('chromium', **kwargs) | 423 self._host_port = factory.PortFactory(host).get('chromium', **kwargs) |
424 self._server_process_constructor = self._android_server_process_construc
tor | 424 self._server_process_constructor = self._android_server_process_construc
tor |
425 | 425 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 if not pids: | 509 if not pids: |
510 _log.error("The adb daemon does not appear to be running.") | 510 _log.error("The adb daemon does not appear to be running.") |
511 return False | 511 return False |
512 | 512 |
513 for pid in pids: | 513 for pid in pids: |
514 self._executive.run_command(['taskset', '-p', '-c', '0', str
(pid)]) | 514 self._executive.run_command(['taskset', '-p', '-c', '0', str
(pid)]) |
515 | 515 |
516 if not result: | 516 if not result: |
517 _log.error('For complete Android build requirements, please see:') | 517 _log.error('For complete Android build requirements, please see:') |
518 _log.error('') | 518 _log.error('') |
519 _log.error(' http://code.google.com/p/chromium/wiki/AndroidBuildI
nstructions') | 519 _log.error(' https://www.chromium.org/developers/how-tos/android-
build-instructions') |
520 return test_run_results.UNEXPECTED_ERROR_EXIT_STATUS | 520 return test_run_results.UNEXPECTED_ERROR_EXIT_STATUS |
521 | 521 |
522 return self._check_devices(printer) | 522 return self._check_devices(printer) |
523 | 523 |
524 def _check_devices(self, printer): | 524 def _check_devices(self, printer): |
525 # Printer objects aren't threadsafe, so we need to protect calls to them
. | 525 # Printer objects aren't threadsafe, so we need to protect calls to them
. |
526 lock = threading.Lock() | 526 lock = threading.Lock() |
527 pool = None | 527 pool = None |
528 | 528 |
529 # Push the executables and other files to the devices; doing this now | 529 # Push the executables and other files to the devices; doing this now |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1286 return command | 1286 return command |
1287 | 1287 |
1288 def _read_prompt(self, deadline): | 1288 def _read_prompt(self, deadline): |
1289 last_char = '' | 1289 last_char = '' |
1290 while True: | 1290 while True: |
1291 current_char = self._server_process.read_stdout(deadline, 1) | 1291 current_char = self._server_process.read_stdout(deadline, 1) |
1292 if current_char == ' ': | 1292 if current_char == ' ': |
1293 if last_char in ('#', '$'): | 1293 if last_char in ('#', '$'): |
1294 return | 1294 return |
1295 last_char = current_char | 1295 last_char = current_char |
OLD | NEW |