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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 def __init__(self): | 78 def __init__(self): |
79 self.tests = {} | 79 self.tests = {} |
80 | 80 |
81 def add(self, name, **kwargs): | 81 def add(self, name, **kwargs): |
82 test = TestInstance(name) | 82 test = TestInstance(name) |
83 for key, value in kwargs.items(): | 83 for key, value in kwargs.items(): |
84 test.__dict__[key] = value | 84 test.__dict__[key] = value |
85 self.tests[name] = test | 85 self.tests[name] = test |
86 | 86 |
87 def add_reftest(self, name, reference_name, same_image, crash=False): | 87 def add_reftest(self, name, reference_name, same_image, crash=False): |
88 self.add(name, actual_checksum='xxx', actual_image='XXX', is_reftest=Tru
e, crash=crash) | 88 self.add(name, actual_text='reftest', actual_checksum='xxx', actual_imag
e='XXX', is_reftest=True, crash=crash) |
89 if same_image: | 89 if same_image: |
90 self.add(reference_name, actual_checksum='xxx', actual_image='XXX',
is_reftest=True) | 90 self.add(reference_name, actual_checksum='xxx', actual_image='XXX',
is_reftest=True) |
91 else: | 91 else: |
92 self.add(reference_name, actual_checksum='yyy', actual_image='YYY',
is_reftest=True) | 92 self.add(reference_name, actual_checksum='yyy', actual_image='YYY',
is_reftest=True) |
93 | 93 |
94 def keys(self): | 94 def keys(self): |
95 return self.tests.keys() | 95 return self.tests.keys() |
96 | 96 |
97 def __contains__(self, item): | 97 def __contains__(self, item): |
98 return item in self.tests | 98 return item in self.tests |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 else: | 658 else: |
659 image = test.actual_image | 659 image = test.actual_image |
660 return DriverOutput(actual_text, image, test.actual_checksum, audio, | 660 return DriverOutput(actual_text, image, test.actual_checksum, audio, |
661 crash=(crash or web_process_crash), crashed_process_
name=crashed_process_name, | 661 crash=(crash or web_process_crash), crashed_process_
name=crashed_process_name, |
662 crashed_pid=crashed_pid, crash_log=crash_log, | 662 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, | 663 test_time=time.time() - start_time, timeout=test.tim
eout, error=test.error, pid=self.pid, |
664 leak=test.leak) | 664 leak=test.leak) |
665 | 665 |
666 def stop(self): | 666 def stop(self): |
667 self.started = False | 667 self.started = False |
OLD | NEW |