| OLD | NEW |
| 1 # Copyright (C) 2011 Google Inc. All rights reserved. | 1 # Copyright (C) 2011 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 def __init__(self, test_name, timeout, image_hash, should_run_pixel_test, ar
gs): | 48 def __init__(self, test_name, timeout, image_hash, should_run_pixel_test, ar
gs): |
| 49 self.test_name = test_name | 49 self.test_name = test_name |
| 50 self.timeout = timeout # in ms | 50 self.timeout = timeout # in ms |
| 51 self.image_hash = image_hash | 51 self.image_hash = image_hash |
| 52 self.should_run_pixel_test = should_run_pixel_test | 52 self.should_run_pixel_test = should_run_pixel_test |
| 53 self.args = args | 53 self.args = args |
| 54 | 54 |
| 55 | 55 |
| 56 class DriverOutput(object): | 56 class DriverOutput(object): |
| 57 """Groups information about a output from driver for easy passing | 57 """Groups information about a output from driver for easy passing |
| 58 and post-processing of data.""" | 58 and post-processing of data. |
| 59 """ |
| 59 | 60 |
| 60 def __init__(self, text, image, image_hash, audio, crash=False, | 61 def __init__(self, text, image, image_hash, audio, crash=False, |
| 61 test_time=0, measurements=None, timeout=False, error='', crashe
d_process_name='??', | 62 test_time=0, measurements=None, timeout=False, error='', crashe
d_process_name='??', |
| 62 crashed_pid=None, crash_log=None, leak=False, leak_log=None, pi
d=None): | 63 crashed_pid=None, crash_log=None, leak=False, leak_log=None, pi
d=None): |
| 63 # FIXME: Args could be renamed to better clarify what they do. | 64 # FIXME: Args could be renamed to better clarify what they do. |
| 64 self.text = text | 65 self.text = text |
| 65 self.image = image # May be empty-string if the test crashes. | 66 self.image = image # May be empty-string if the test crashes. |
| 66 self.image_hash = image_hash | 67 self.image_hash = image_hash |
| 67 self.image_diff = None # image_diff gets filled in after construction. | 68 self.image_diff = None # image_diff gets filled in after construction. |
| 68 self.audio = audio # Binary format is port-dependent. | 69 self.audio = audio # Binary format is port-dependent. |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 if "/https/" in test_name or ".https." in test_name: | 260 if "/https/" in test_name or ".https." in test_name: |
| 260 return "https://%s:%d/%s" % (hostname, secure_port, relative_path) | 261 return "https://%s:%d/%s" % (hostname, secure_port, relative_path) |
| 261 return "http://%s:%d/%s" % (hostname, insecure_port, relative_path) | 262 return "http://%s:%d/%s" % (hostname, insecure_port, relative_path) |
| 262 | 263 |
| 263 def uri_to_test(self, uri): | 264 def uri_to_test(self, uri): |
| 264 """Return the base layout test name for a given URI. | 265 """Return the base layout test name for a given URI. |
| 265 | 266 |
| 266 This returns the test name for a given URI, e.g., if you passed in | 267 This returns the test name for a given URI, e.g., if you passed in |
| 267 "file:///src/LayoutTests/fast/html/keygen.html" it would return | 268 "file:///src/LayoutTests/fast/html/keygen.html" it would return |
| 268 "fast/html/keygen.html". | 269 "fast/html/keygen.html". |
| 269 | |
| 270 """ | 270 """ |
| 271 | 271 |
| 272 # This looks like a bit of a hack, since the uri is used instead of test
name. | 272 # This looks like a bit of a hack, since the uri is used instead of test
name. |
| 273 hostname, insecure_port, secure_port = self._get_http_host_and_ports_for
_test(uri) | 273 hostname, insecure_port, secure_port = self._get_http_host_and_ports_for
_test(uri) |
| 274 | 274 |
| 275 if uri.startswith("file:///"): | 275 if uri.startswith("file:///"): |
| 276 prefix = path.abspath_to_uri(self._port.host.platform, self._port.la
yout_tests_dir()) | 276 prefix = path.abspath_to_uri(self._port.host.platform, self._port.la
yout_tests_dir()) |
| 277 if not prefix.endswith('/'): | 277 if not prefix.endswith('/'): |
| 278 prefix += '/' | 278 prefix += '/' |
| 279 return uri[len(prefix):] | 279 return uri[len(prefix):] |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 self.decoded_content = None | 541 self.decoded_content = None |
| 542 self.malloc = None | 542 self.malloc = None |
| 543 self.js_heap = None | 543 self.js_heap = None |
| 544 self.stdin_path = None | 544 self.stdin_path = None |
| 545 | 545 |
| 546 def decode_content(self): | 546 def decode_content(self): |
| 547 if self.encoding == 'base64' and self.content is not None: | 547 if self.encoding == 'base64' and self.content is not None: |
| 548 self.decoded_content = base64.b64decode(self.content) | 548 self.decoded_content = base64.b64decode(self.content) |
| 549 else: | 549 else: |
| 550 self.decoded_content = self.content | 550 self.decoded_content = self.content |
| OLD | NEW |