| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 if not usable_devices: | 357 if not usable_devices: |
| 358 raise test_run_results.TestRunException(test_run_results.NO_DEVICES_
EXIT_STATUS, | 358 raise test_run_results.TestRunException(test_run_results.NO_DEVICES_
EXIT_STATUS, |
| 359 "Unable to find any attached
Android devices.") | 359 "Unable to find any attached
Android devices.") |
| 360 return len(usable_devices) | 360 return len(usable_devices) |
| 361 | 361 |
| 362 def max_drivers_per_process(self): | 362 def max_drivers_per_process(self): |
| 363 # Android falls over when we try to run multiple content_shells per work
er. | 363 # Android falls over when we try to run multiple content_shells per work
er. |
| 364 # See https://codereview.chromium.org/1158323009/ | 364 # See https://codereview.chromium.org/1158323009/ |
| 365 return 1 | 365 return 1 |
| 366 | 366 |
| 367 def check_wdiff(self, more_logging=True): | |
| 368 return self._host_port.check_wdiff(more_logging) | |
| 369 | |
| 370 def check_build(self, needs_http, printer): | 367 def check_build(self, needs_http, printer): |
| 371 exit_status = super(AndroidPort, self).check_build(needs_http, printer) | 368 exit_status = super(AndroidPort, self).check_build(needs_http, printer) |
| 372 if exit_status: | 369 if exit_status: |
| 373 return exit_status | 370 return exit_status |
| 374 | 371 |
| 375 return self._check_devices(printer) | 372 return self._check_devices(printer) |
| 376 | 373 |
| 377 def _check_devices(self, printer): | 374 def _check_devices(self, printer): |
| 378 # Printer objects aren't threadsafe, so we need to protect calls to them
. | 375 # Printer objects aren't threadsafe, so we need to protect calls to them
. |
| 379 lock = threading.Lock() | 376 lock = threading.Lock() |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 | 489 |
| 493 def path_to_apache_config_file(self): | 490 def path_to_apache_config_file(self): |
| 494 return self._host_port.path_to_apache_config_file() | 491 return self._host_port.path_to_apache_config_file() |
| 495 | 492 |
| 496 def _path_to_driver(self, target=None): | 493 def _path_to_driver(self, target=None): |
| 497 return self._build_path_with_target(target, self._driver_details.apk_nam
e()) | 494 return self._build_path_with_target(target, self._driver_details.apk_nam
e()) |
| 498 | 495 |
| 499 def _path_to_image_diff(self): | 496 def _path_to_image_diff(self): |
| 500 return self._host_port._path_to_image_diff() | 497 return self._host_port._path_to_image_diff() |
| 501 | 498 |
| 502 def _path_to_wdiff(self): | |
| 503 return self._host_port._path_to_wdiff() | |
| 504 | |
| 505 def _shut_down_http_server(self, pid): | 499 def _shut_down_http_server(self, pid): |
| 506 return self._host_port._shut_down_http_server(pid) | 500 return self._host_port._shut_down_http_server(pid) |
| 507 | 501 |
| 508 def _driver_class(self): | 502 def _driver_class(self): |
| 509 return ChromiumAndroidDriver | 503 return ChromiumAndroidDriver |
| 510 | 504 |
| 511 # Local private methods. | 505 # Local private methods. |
| 512 | 506 |
| 513 @staticmethod | 507 @staticmethod |
| 514 def _android_server_process_constructor(port, server_name, cmd_line, env=Non
e, more_logging=False): | 508 def _android_server_process_constructor(port, server_name, cmd_line, env=Non
e, more_logging=False): |
| (...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1143 return command | 1137 return command |
| 1144 | 1138 |
| 1145 def _read_prompt(self, deadline): | 1139 def _read_prompt(self, deadline): |
| 1146 last_char = '' | 1140 last_char = '' |
| 1147 while True: | 1141 while True: |
| 1148 current_char = self._server_process.read_stdout(deadline, 1) | 1142 current_char = self._server_process.read_stdout(deadline, 1) |
| 1149 if current_char == ' ': | 1143 if current_char == ' ': |
| 1150 if last_char in ('#', '$'): | 1144 if last_char in ('#', '$'): |
| 1151 return | 1145 return |
| 1152 last_char = current_char | 1146 last_char = current_char |
| OLD | NEW |