| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 def virtual_test_suites(self): | 562 def virtual_test_suites(self): |
| 563 return [ | 563 return [ |
| 564 VirtualTestSuite(prefix='virtual_passes', base='passes', args=['--vi
rtual-arg']), | 564 VirtualTestSuite(prefix='virtual_passes', base='passes', args=['--vi
rtual-arg']), |
| 565 VirtualTestSuite(prefix='skipped', base='failures/expected', args=['
--virtual-arg2']), | 565 VirtualTestSuite(prefix='skipped', base='failures/expected', args=['
--virtual-arg2']), |
| 566 VirtualTestSuite(prefix='references_use_default_args', base='passes/
reftest.html', | 566 VirtualTestSuite(prefix='references_use_default_args', base='passes/
reftest.html', |
| 567 args=['--virtual-arg'], references_use_default_args
=True), | 567 args=['--virtual-arg'], references_use_default_args
=True), |
| 568 ] | 568 ] |
| 569 | 569 |
| 570 | 570 |
| 571 class TestDriver(Driver): | 571 class TestDriver(Driver): |
| 572 |
| 572 """Test/Dummy implementation of the driver interface.""" | 573 """Test/Dummy implementation of the driver interface.""" |
| 573 next_pid = 1 | 574 next_pid = 1 |
| 574 | 575 |
| 575 def __init__(self, *args, **kwargs): | 576 def __init__(self, *args, **kwargs): |
| 576 super(TestDriver, self).__init__(*args, **kwargs) | 577 super(TestDriver, self).__init__(*args, **kwargs) |
| 577 self.started = False | 578 self.started = False |
| 578 self.pid = 0 | 579 self.pid = 0 |
| 579 | 580 |
| 580 def cmd_line(self, pixel_tests, per_test_args): | 581 def cmd_line(self, pixel_tests, per_test_args): |
| 581 pixel_tests_flag = '-p' if pixel_tests else '' | 582 pixel_tests_flag = '-p' if pixel_tests else '' |
| 582 return [self._port._path_to_driver()] + [pixel_tests_flag] + self._port.
get_option('additional_driver_flag', []) + per_test_args | 583 return [self._port._path_to_driver()] + [pixel_tests_flag] + \ |
| 584 self._port.get_option('additional_driver_flag', []) + per_test_args |
| 583 | 585 |
| 584 def run_test(self, driver_input, stop_when_done): | 586 def run_test(self, driver_input, stop_when_done): |
| 585 if not self.started: | 587 if not self.started: |
| 586 self.started = True | 588 self.started = True |
| 587 self.pid = TestDriver.next_pid | 589 self.pid = TestDriver.next_pid |
| 588 TestDriver.next_pid += 1 | 590 TestDriver.next_pid += 1 |
| 589 | 591 |
| 590 start_time = time.time() | 592 start_time = time.time() |
| 591 test_name = driver_input.test_name | 593 test_name = driver_input.test_name |
| 592 test_args = driver_input.args or [] | 594 test_args = driver_input.args or [] |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 else: | 660 else: |
| 659 image = test.actual_image | 661 image = test.actual_image |
| 660 return DriverOutput(actual_text, image, test.actual_checksum, audio, | 662 return DriverOutput(actual_text, image, test.actual_checksum, audio, |
| 661 crash=(crash or web_process_crash), crashed_process_
name=crashed_process_name, | 663 crash=(crash or web_process_crash), crashed_process_
name=crashed_process_name, |
| 662 crashed_pid=crashed_pid, crash_log=crash_log, | 664 crashed_pid=crashed_pid, crash_log=crash_log, |
| 663 test_time=time.time() - start_time, timeout=test.tim
eout, error=test.error, pid=self.pid, | 665 test_time=time.time() - start_time, timeout=test.tim
eout, error=test.error, pid=self.pid, |
| 664 leak=test.leak) | 666 leak=test.leak) |
| 665 | 667 |
| 666 def stop(self): | 668 def stop(self): |
| 667 self.started = False | 669 self.started = False |
| OLD | NEW |