| OLD | NEW |
| 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """A Thread object for running the test shell and processing URLs from a | 5 """A Thread object for running the test shell and processing URLs from a |
| 6 shared queue. | 6 shared queue. |
| 7 | 7 |
| 8 Each thread runs a separate instance of the test_shell binary and validates | 8 Each thread runs a separate instance of the test_shell binary and validates |
| 9 the output. When there are no more URLs to process in the shared queue, the | 9 the output. When there are no more URLs to process in the shared queue, the |
| 10 thread exits. | 10 thread exits. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 elif line.startswith("#TEST_TIMED_OUT"): | 73 elif line.startswith("#TEST_TIMED_OUT"): |
| 74 # Test timed out, but we still need to read until #EOF. | 74 # Test timed out, but we still need to read until #EOF. |
| 75 crash_or_timeout = True | 75 crash_or_timeout = True |
| 76 failures.append(test_failures.FailureTimeout()) | 76 failures.append(test_failures.FailureTimeout()) |
| 77 else: | 77 else: |
| 78 outlines.append(line) | 78 outlines.append(line) |
| 79 line = proc.stdout.readline() | 79 line = proc.stdout.readline() |
| 80 | 80 |
| 81 # If we had any stderr output, append that. This is not ideal, but at least | 81 # If we had any stderr output, append that. This is not ideal, but at least |
| 82 # it'll catch errors. | 82 # it'll catch errors. |
| 83 line = proc.stderr.readline() | 83 # line = proc.stderr.readline() |
| 84 while line.rstrip() != "#EOF": | 84 # while line.rstrip() != "#EOF": |
| 85 # TODO(pamg): We suppress this stderr message temporarily so we can run | 85 # # TODO(pamg): We suppress this stderr message temporarily so we can run |
| 86 # the tests deterministically until someone has a chance to fix the | 86 # # the tests deterministically until someone has a chance to fix the |
| 87 # underlying problem. | 87 # # underlying problem. |
| 88 # See http://code.google.com/p/chromium/issues/detail?id=4285 | 88 # # See http://code.google.com/p/chromium/issues/detail?id=4285 |
| 89 if (line != '' and | 89 # if (line != '' and |
| 90 not line.endswith('alias ISO-8859-8-I maps to ISO-8859-8-I already, ' | 90 # not line.endswith('alias ISO-8859-8-I maps to ISO-8859-8-I already, ' |
| 91 'but someone is trying to make it map to ' | 91 # 'but someone is trying to make it map to ' |
| 92 'ISO-8859-8')): | 92 # 'ISO-8859-8')): |
| 93 outlines.append(line) | 93 # outlines.append(line) |
| 94 line = proc.stderr.readline() | 94 # line = proc.stderr.readline() |
| 95 | 95 |
| 96 # Check the output and save the results. | 96 # Check the output and save the results. |
| 97 for test_type in test_types: | 97 for test_type in test_types: |
| 98 new_failures = test_type.CompareOutput(filename, proc, | 98 new_failures = test_type.CompareOutput(filename, proc, |
| 99 ''.join(outlines), | 99 ''.join(outlines), |
| 100 local_test_args) | 100 local_test_args) |
| 101 # Don't add any more failures if we already have a crash or timeout, so | 101 # Don't add any more failures if we already have a crash or timeout, so |
| 102 # we don't double-report those tests. | 102 # we don't double-report those tests. |
| 103 if not crash_or_timeout: | 103 if not crash_or_timeout: |
| 104 failures.extend(new_failures) | 104 failures.extend(new_failures) |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 287 |
| 288 def _KillTestShell(self): | 288 def _KillTestShell(self): |
| 289 """Kill the test shell process if it's running.""" | 289 """Kill the test shell process if it's running.""" |
| 290 if self._test_shell_proc: | 290 if self._test_shell_proc: |
| 291 self._test_shell_proc.stdin.close() | 291 self._test_shell_proc.stdin.close() |
| 292 self._test_shell_proc.stdout.close() | 292 self._test_shell_proc.stdout.close() |
| 293 if self._test_shell_proc.stderr: | 293 if self._test_shell_proc.stderr: |
| 294 self._test_shell_proc.stderr.close() | 294 self._test_shell_proc.stderr.close() |
| 295 self._test_shell_proc = None | 295 self._test_shell_proc = None |
| 296 | 296 |
| OLD | NEW |