Changeset 118884 in webkit
- Timestamp:
- May 29, 2012, 8:15:25 PM (14 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
- 2 moved
-
ChangeLog (modified) (1 diff)
-
Scripts/read-checksum-from-png (modified) (1 diff)
-
Scripts/webkitpy/common/read_checksum_from_png.py (moved) (moved from trunk/Tools/Scripts/webkitpy/layout_tests/read_checksum_from_png.py )
-
Scripts/webkitpy/common/read_checksum_from_png_unittest.py (moved) (moved from trunk/Tools/Scripts/webkitpy/layout_tests/read_checksum_from_png_unittest.py ) (1 diff)
-
Scripts/webkitpy/layout_tests/port/base.py (modified) (1 diff)
-
Scripts/webkitpy/style/checkers/png.py (modified) (2 diffs)
-
Scripts/webkitpy/style/checkers/png_unittest.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r118860 r118884 1 2012-05-29 Ojan Vafai <ojan@chromium.org> 2 3 Add a linter error for pngs that lack an embedded checksum 4 https://bugs.webkit.org/show_bug.cgi?id=87793 5 6 Reviewed by Dirk Pranke. 7 8 * Scripts/read-checksum-from-png: 9 * Scripts/webkitpy/common/read_checksum_from_png.py: Renamed from Tools/Scripts/webkitpy/layout_tests/read_checksum_from_png.py. 10 (read_checksum): 11 * Scripts/webkitpy/common/read_checksum_from_png_unittest.py: Renamed from Tools/Scripts/webkitpy/layout_tests/read_checksum_from_png_unittest.py. 12 (ReadChecksumFromPngTest): 13 (ReadChecksumFromPngTest.test_read_checksum): 14 * Scripts/webkitpy/layout_tests/port/base.py: 15 * Scripts/webkitpy/style/checkers/png.py: 16 (PNGChecker.check): 17 * Scripts/webkitpy/style/checkers/png_unittest.py: 18 (PNGCheckerTest.test_check): 19 1 20 2012-05-29 Stephanie Lewis <slewis@apple.com> 2 21 -
trunk/Tools/Scripts/read-checksum-from-png
r82279 r118884 31 31 import sys 32 32 33 from webkitpy. layout_testsimport read_checksum_from_png33 from webkitpy.common import read_checksum_from_png 34 34 35 35 -
trunk/Tools/Scripts/webkitpy/common/read_checksum_from_png_unittest.py
r118883 r118884 25 25 import StringIO 26 26 import unittest 27 from webkitpy. layout_testsimport read_checksum_from_png27 from webkitpy.common import read_checksum_from_png 28 28 29 29 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py
r118408 r118884 37 37 import re 38 38 39 from webkitpy.common import find_files 40 from webkitpy.common import read_checksum_from_png 39 41 from webkitpy.common.memoized import memoized 40 42 from webkitpy.common.system import path 41 from webkitpy.common import find_files42 43 from webkitpy.common.system import logutils 43 44 from webkitpy.common.system.executive import ScriptError 44 45 from webkitpy.common.system.systemhost import SystemHost 45 from webkitpy.layout_tests import read_checksum_from_png46 46 from webkitpy.layout_tests.models.test_configuration import TestConfiguration 47 47 from webkitpy.layout_tests.port import config as port_config -
trunk/Tools/Scripts/webkitpy/style/checkers/png.py
r116947 r118884 28 28 import re 29 29 30 from webkitpy.common import read_checksum_from_png 30 31 from webkitpy.common.system.systemhost import SystemHost 31 32 from webkitpy.common.checkout.scm.detection import SCMDetector 32 33 33 34 34 class PNGChecker(object): … … 48 48 config_file_path = "" 49 49 detection = self._detector.display_name() 50 51 if self._fs.exists(self._file_path): 52 with self._fs.open_binary_file_for_reading(self._file_path) as filehandle: 53 if not read_checksum_from_png.read_checksum(filehandle): 54 self._handle_style_error(0, 'image/png', 5, "Image lacks a checksum. Generate pngs using run-webkit-tests to ensure they have a checksum.") 50 55 51 56 if detection == "git": -
trunk/Tools/Scripts/webkitpy/style/checkers/png_unittest.py
r115900 r118884 114 114 self.assertEquals(len(errors), 1) 115 115 116 file_path = "foo.png" 117 fs.write_binary_file(file_path, "Dummy binary data") 118 scm = MockSCMDetector('git') 119 errors = [] 120 checker = PNGChecker(file_path, mock_handle_style_error, scm, MockSystemHost(os_name='linux', filesystem=fs)) 121 checker.check() 122 self.assertEquals(len(errors), 2) 123 self.assertEquals(errors[0], (0, 'image/png', 5, 'Image lacks a checksum. Generate pngs using run-webkit-tests to ensure they have a checksum.')) 116 124 117 125 if __name__ == '__main__':
Note:
See TracChangeset
for help on using the changeset viewer.