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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 if base: | 876 if base: |
877 driver_input = copy.copy(driver_input) | 877 driver_input = copy.copy(driver_input) |
878 driver_input.args = self._port.lookup_virtual_test_args(driver_input
.test_name) | 878 driver_input.args = self._port.lookup_virtual_test_args(driver_input
.test_name) |
879 driver_input.test_name = base | 879 driver_input.test_name = base |
880 return super(ChromiumAndroidDriver, self).run_test(driver_input, stop_wh
en_done) | 880 return super(ChromiumAndroidDriver, self).run_test(driver_input, stop_wh
en_done) |
881 | 881 |
882 def start(self, pixel_tests, per_test_args): | 882 def start(self, pixel_tests, per_test_args): |
883 # We override the default start() so that we can call _android_driver_cm
d_line() | 883 # We override the default start() so that we can call _android_driver_cm
d_line() |
884 # instead of cmd_line(). | 884 # instead of cmd_line(). |
885 new_cmd_line = self._android_driver_cmd_line(pixel_tests, per_test_args) | 885 new_cmd_line = self._android_driver_cmd_line(pixel_tests, per_test_args) |
886 if new_cmd_line != self._current_cmd_line: | 886 |
| 887 # Since _android_driver_cmd_line() is different than cmd_line() we need
to provide |
| 888 # our own mechanism for detecting when the process should be stopped. |
| 889 if self._current_cmd_line is None: |
| 890 self._current_android_cmd_line = None |
| 891 if new_cmd_line != self._current_android_cmd_line: |
887 self.stop() | 892 self.stop() |
| 893 self._current_android_cmd_line = new_cmd_line |
| 894 |
888 super(ChromiumAndroidDriver, self).start(pixel_tests, per_test_args) | 895 super(ChromiumAndroidDriver, self).start(pixel_tests, per_test_args) |
889 | 896 |
890 def _start(self, pixel_tests, per_test_args): | 897 def _start(self, pixel_tests, per_test_args): |
891 self._setup_test() | 898 self._setup_test() |
892 | 899 |
893 for retries in range(3): | 900 for retries in range(3): |
894 if self._start_once(pixel_tests, per_test_args): | 901 if self._start_once(pixel_tests, per_test_args): |
895 return | 902 return |
896 self._log_error('Failed to start the content_shell application. Retr
ies=%d. Log:%s' % (retries, self._get_logcat())) | 903 self._log_error('Failed to start the content_shell application. Retr
ies=%d. Log:%s' % (retries, self._get_logcat())) |
897 self.stop() | 904 self.stop() |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 return command | 1022 return command |
1016 | 1023 |
1017 def _read_prompt(self, deadline): | 1024 def _read_prompt(self, deadline): |
1018 last_char = '' | 1025 last_char = '' |
1019 while True: | 1026 while True: |
1020 current_char = self._server_process.read_stdout(deadline, 1) | 1027 current_char = self._server_process.read_stdout(deadline, 1) |
1021 if current_char == ' ': | 1028 if current_char == ' ': |
1022 if last_char in ('#', '$'): | 1029 if last_char in ('#', '$'): |
1023 return | 1030 return |
1024 last_char = current_char | 1031 last_char = current_char |
OLD | NEW |