| OLD | NEW |
| 1 # Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged | 1 # Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged |
| 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 | 4 # modification, are permitted provided that the following conditions |
| 5 # are met: | 5 # are met: |
| 6 # 1. Redistributions of source code must retain the above copyright | 6 # 1. Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # 2. Redistributions in binary form must reproduce the above copyright | 8 # 2. Redistributions in binary form must reproduce the above copyright |
| 9 # notice, this list of conditions and the following disclaimer in the | 9 # notice, this list of conditions and the following disclaimer in the |
| 10 # documentation and/or other materials provided with the distribution. | 10 # documentation and/or other materials provided with the distribution. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 self._file_path = file_path | 39 self._file_path = file_path |
| 40 self._handle_style_error = handle_style_error | 40 self._handle_style_error = handle_style_error |
| 41 self._host = host or SystemHost() | 41 self._host = host or SystemHost() |
| 42 self._fs = self._host.filesystem | 42 self._fs = self._host.filesystem |
| 43 | 43 |
| 44 def check(self, inline=None): | 44 def check(self, inline=None): |
| 45 if self._fs.exists(self._file_path) and self._file_path.endswith("-expec
ted.png"): | 45 if self._fs.exists(self._file_path) and self._file_path.endswith("-expec
ted.png"): |
| 46 with self._fs.open_binary_file_for_reading(self._file_path) as fileh
andle: | 46 with self._fs.open_binary_file_for_reading(self._file_path) as fileh
andle: |
| 47 if not read_checksum_from_png.read_checksum(filehandle): | 47 if not read_checksum_from_png.read_checksum(filehandle): |
| 48 self._handle_style_error( | 48 self._handle_style_error( |
| 49 0, 'image/png', 5, "Image lacks a checksum. Generate png
s using run-webkit-tests to ensure they have a checksum.") | 49 0, 'image/png', 5, |
| 50 "Image lacks a checksum. Generate pngs using run-webkit-
tests to ensure they have a checksum.") |
| OLD | NEW |