OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 """ | 3 """ |
4 Copyright 2014 Google Inc. | 4 Copyright 2014 Google Inc. |
5 | 5 |
6 Use of this source code is governed by a BSD-style license that can be | 6 Use of this source code is governed by a BSD-style license that can be |
7 found in the LICENSE file. | 7 found in the LICENSE file. |
8 | 8 |
9 Test the render_pictures binary. | 9 Test the render_pictures binary. |
10 """ | 10 """ |
11 | 11 |
12 # System-level imports | 12 # System-level imports |
13 import json | 13 import json |
14 import os | 14 import os |
15 import shutil | 15 import shutil |
16 import tempfile | 16 import tempfile |
17 | 17 |
18 # Imports from within Skia | 18 # Imports from within Skia |
19 import base_unittest | 19 import base_unittest |
20 | 20 |
21 # Maximum length of text diffs to show when tests fail | 21 # Maximum length of text diffs to show when tests fail |
22 MAX_DIFF_LENGTH = 30000 | 22 MAX_DIFF_LENGTH = 30000 |
23 | 23 |
| 24 EXPECTED_HEADER_CONTENTS = { |
| 25 "type" : "ChecksummedImages", |
| 26 "revision" : 1, |
| 27 } |
| 28 |
24 | 29 |
25 class RenderPicturesTest(base_unittest.TestCase): | 30 class RenderPicturesTest(base_unittest.TestCase): |
26 | 31 |
27 def setUp(self): | 32 def setUp(self): |
28 self._input_skp_dir = tempfile.mkdtemp() | 33 self._input_skp_dir = tempfile.mkdtemp() |
29 self._temp_dir = tempfile.mkdtemp() | 34 self._temp_dir = tempfile.mkdtemp() |
30 self.maxDiff = MAX_DIFF_LENGTH | 35 self.maxDiff = MAX_DIFF_LENGTH |
31 | 36 |
32 def tearDown(self): | 37 def tearDown(self): |
33 shutil.rmtree(self._input_skp_dir) | 38 shutil.rmtree(self._input_skp_dir) |
34 shutil.rmtree(self._temp_dir) | 39 shutil.rmtree(self._temp_dir) |
35 | 40 |
36 def test_tiled_whole_image(self): | 41 def test_tiled_whole_image(self): |
37 """Run render_pictures with tiles and --writeWholeImage flag.""" | 42 """Run render_pictures with tiles and --writeWholeImage flag.""" |
38 output_json_path = os.path.join(self._temp_dir, 'output.json') | 43 output_json_path = os.path.join(self._temp_dir, 'output.json') |
39 self._generate_skps() | 44 self._generate_skps() |
40 # TODO(epoger): I noticed that when this is run without --writePath being | 45 # TODO(epoger): I noticed that when this is run without --writePath being |
41 # specified, this test writes red.png and green.png to the current working | 46 # specified, this test writes red_skp.png and green_skp.png to the current |
42 # directory. We should fix that... if --writePath is not specified, this | 47 # directory. We should fix that... if --writePath is not specified, this |
43 # probably shouldn't write out red.png and green.png at all! | 48 # probably shouldn't write out red_skp.png and green_skp.png at all! |
44 self._run_render_pictures(['-r', self._input_skp_dir, | 49 self._run_render_pictures(['-r', self._input_skp_dir, |
45 '--bbh', 'grid', '256', '256', | 50 '--bbh', 'grid', '256', '256', |
46 '--mode', 'tile', '256', '256', | 51 '--mode', 'tile', '256', '256', |
47 '--writeJsonSummaryPath', output_json_path, | 52 '--writeJsonSummaryPath', output_json_path, |
48 '--writePath', self._temp_dir, | 53 '--writePath', self._temp_dir, |
49 '--writeWholeImage']) | 54 '--writeWholeImage']) |
50 expected_summary_dict = { | 55 expected_summary_dict = { |
| 56 "header" : EXPECTED_HEADER_CONTENTS, |
51 "actual-results" : { | 57 "actual-results" : { |
52 "no-comparison" : { | 58 "red.skp": { |
53 # Manually verified: 640x400 red rectangle with black border | 59 # Manually verified: 640x400 red rectangle with black border |
54 "red.png" : [ "bitmap-64bitMD5", 11092453015575919668 ], | 60 "whole-image": { |
| 61 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 62 "checksumValue" : 11092453015575919668, |
| 63 "comparisonResult" : "no-comparison", |
| 64 "filepath" : "red_skp.png", |
| 65 }, |
| 66 }, |
| 67 "green.skp": { |
55 # Manually verified: 640x400 green rectangle with black border | 68 # Manually verified: 640x400 green rectangle with black border |
56 "green.png" : [ "bitmap-64bitMD5", 8891695120562235492 ], | 69 "whole-image": { |
| 70 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 71 "checksumValue" : 8891695120562235492, |
| 72 "comparisonResult" : "no-comparison", |
| 73 "filepath" : "green_skp.png", |
| 74 }, |
57 } | 75 } |
58 } | 76 } |
59 } | 77 } |
60 self._assert_json_contents(output_json_path, expected_summary_dict) | 78 self._assert_json_contents(output_json_path, expected_summary_dict) |
61 self._assert_directory_contents( | 79 self._assert_directory_contents( |
62 self._temp_dir, ['red.png', 'green.png', 'output.json']) | 80 self._temp_dir, ['red_skp.png', 'green_skp.png', 'output.json']) |
63 | 81 |
64 def test_untiled(self): | 82 def test_untiled(self): |
65 """Run without tiles.""" | 83 """Run without tiles.""" |
66 output_json_path = os.path.join(self._temp_dir, 'output.json') | 84 output_json_path = os.path.join(self._temp_dir, 'output.json') |
67 self._generate_skps() | 85 self._generate_skps() |
68 self._run_render_pictures(['-r', self._input_skp_dir, | 86 self._run_render_pictures(['-r', self._input_skp_dir, |
69 '--writePath', self._temp_dir, | 87 '--writePath', self._temp_dir, |
70 '--writeJsonSummaryPath', output_json_path]) | 88 '--writeJsonSummaryPath', output_json_path]) |
| 89 # TODO(epoger): These expectations are the same as for above unittest. |
| 90 # Define the expectations once, and share them. |
71 expected_summary_dict = { | 91 expected_summary_dict = { |
| 92 "header" : EXPECTED_HEADER_CONTENTS, |
72 "actual-results" : { | 93 "actual-results" : { |
73 "no-comparison" : { | 94 "red.skp": { |
74 # Manually verified: 640x400 red rectangle with black border | 95 # Manually verified: 640x400 red rectangle with black border |
75 "red.png" : ["bitmap-64bitMD5", 11092453015575919668], | 96 "whole-image": { |
| 97 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 98 "checksumValue" : 11092453015575919668, |
| 99 "comparisonResult" : "no-comparison", |
| 100 "filepath" : "red_skp.png", |
| 101 }, |
| 102 }, |
| 103 "green.skp": { |
76 # Manually verified: 640x400 green rectangle with black border | 104 # Manually verified: 640x400 green rectangle with black border |
77 "green.png" : ["bitmap-64bitMD5", 8891695120562235492], | 105 "whole-image": { |
| 106 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 107 "checksumValue" : 8891695120562235492, |
| 108 "comparisonResult" : "no-comparison", |
| 109 "filepath" : "green_skp.png", |
| 110 }, |
78 } | 111 } |
79 } | 112 } |
80 } | 113 } |
81 self._assert_json_contents(output_json_path, expected_summary_dict) | 114 self._assert_json_contents(output_json_path, expected_summary_dict) |
82 self._assert_directory_contents( | 115 self._assert_directory_contents( |
83 self._temp_dir, ['red.png', 'green.png', 'output.json']) | 116 self._temp_dir, ['red_skp.png', 'green_skp.png', 'output.json']) |
84 | 117 |
85 def test_untiled_writeChecksumBasedFilenames(self): | 118 def test_untiled_writeChecksumBasedFilenames(self): |
86 """Same as test_untiled, but with --writeChecksumBasedFilenames.""" | 119 """Same as test_untiled, but with --writeChecksumBasedFilenames.""" |
87 output_json_path = os.path.join(self._temp_dir, 'output.json') | 120 output_json_path = os.path.join(self._temp_dir, 'output.json') |
88 self._generate_skps() | 121 self._generate_skps() |
89 self._run_render_pictures(['-r', self._input_skp_dir, | 122 self._run_render_pictures(['-r', self._input_skp_dir, |
90 '--writeChecksumBasedFilenames', | 123 '--writeChecksumBasedFilenames', |
91 '--writePath', self._temp_dir, | 124 '--writePath', self._temp_dir, |
92 '--writeJsonSummaryPath', output_json_path]) | 125 '--writeJsonSummaryPath', output_json_path]) |
93 expected_summary_dict = { | 126 expected_summary_dict = { |
| 127 "header" : EXPECTED_HEADER_CONTENTS, |
94 "actual-results" : { | 128 "actual-results" : { |
95 "no-comparison" : { | 129 "red.skp": { |
96 # Manually verified: 640x400 red rectangle with black border | 130 # Manually verified: 640x400 red rectangle with black border |
97 "red.png" : ["bitmap-64bitMD5", 11092453015575919668], | 131 "whole-image": { |
| 132 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 133 "checksumValue" : 11092453015575919668, |
| 134 "comparisonResult" : "no-comparison", |
| 135 "filepath" : "red_skp/bitmap-64bitMD5_11092453015575919668.p
ng", |
| 136 }, |
| 137 }, |
| 138 "green.skp": { |
98 # Manually verified: 640x400 green rectangle with black border | 139 # Manually verified: 640x400 green rectangle with black border |
99 "green.png" : ["bitmap-64bitMD5", 8891695120562235492], | 140 "whole-image": { |
| 141 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 142 "checksumValue" : 8891695120562235492, |
| 143 "comparisonResult" : "no-comparison", |
| 144 "filepath" : "green_skp/bitmap-64bitMD5_8891695120562235492.
png", |
| 145 }, |
100 } | 146 } |
101 } | 147 } |
102 } | 148 } |
103 self._assert_json_contents(output_json_path, expected_summary_dict) | 149 self._assert_json_contents(output_json_path, expected_summary_dict) |
| 150 self._assert_directory_contents(self._temp_dir, [ |
| 151 'red_skp', 'green_skp', 'output.json']) |
104 self._assert_directory_contents( | 152 self._assert_directory_contents( |
105 self._temp_dir, ['bitmap-64bitMD5_11092453015575919668.png', | 153 os.path.join(self._temp_dir, 'red_skp'), |
106 'bitmap-64bitMD5_8891695120562235492.png', | 154 ['bitmap-64bitMD5_11092453015575919668.png']) |
107 'output.json']) | 155 self._assert_directory_contents( |
| 156 os.path.join(self._temp_dir, 'green_skp'), |
| 157 ['bitmap-64bitMD5_8891695120562235492.png']) |
108 | 158 |
109 def test_untiled_validate(self): | 159 def test_untiled_validate(self): |
110 """Same as test_untiled, but with --validate. | 160 """Same as test_untiled, but with --validate. |
111 | 161 |
112 TODO(epoger): This test generates undesired results! The call | 162 TODO(epoger): This test generates undesired results! The call |
113 to render_pictures should succeed, and generate the same output as | 163 to render_pictures should succeed, and generate the same output as |
114 test_untiled. | 164 test_untiled. |
115 See https://code.google.com/p/skia/issues/detail?id=2044 ('render_pictures: | 165 See https://code.google.com/p/skia/issues/detail?id=2044 ('render_pictures: |
116 --validate fails') | 166 --validate fails') |
117 """ | 167 """ |
(...skipping 10 matching lines...) Expand all Loading... |
128 | 178 |
129 TODO(epoger): This test generates undesired results! | 179 TODO(epoger): This test generates undesired results! |
130 See https://code.google.com/p/skia/issues/detail?id=2043 ('render_pictures: | 180 See https://code.google.com/p/skia/issues/detail?id=2043 ('render_pictures: |
131 --writeJsonSummaryPath fails unless --writePath is specified') | 181 --writeJsonSummaryPath fails unless --writePath is specified') |
132 """ | 182 """ |
133 output_json_path = os.path.join(self._temp_dir, 'output.json') | 183 output_json_path = os.path.join(self._temp_dir, 'output.json') |
134 self._generate_skps() | 184 self._generate_skps() |
135 self._run_render_pictures(['-r', self._input_skp_dir, | 185 self._run_render_pictures(['-r', self._input_skp_dir, |
136 '--writeJsonSummaryPath', output_json_path]) | 186 '--writeJsonSummaryPath', output_json_path]) |
137 expected_summary_dict = { | 187 expected_summary_dict = { |
138 "actual-results" : { | 188 "header" : EXPECTED_HEADER_CONTENTS, |
139 "no-comparison" : None, | 189 "actual-results" : None, |
140 } | |
141 } | 190 } |
142 self._assert_json_contents(output_json_path, expected_summary_dict) | 191 self._assert_json_contents(output_json_path, expected_summary_dict) |
143 | 192 |
144 def test_tiled(self): | 193 def test_tiled(self): |
145 """Generate individual tiles.""" | 194 """Generate individual tiles.""" |
146 output_json_path = os.path.join(self._temp_dir, 'output.json') | 195 output_json_path = os.path.join(self._temp_dir, 'output.json') |
147 self._generate_skps() | 196 self._generate_skps() |
148 self._run_render_pictures(['-r', self._input_skp_dir, | 197 self._run_render_pictures(['-r', self._input_skp_dir, |
149 '--bbh', 'grid', '256', '256', | 198 '--bbh', 'grid', '256', '256', |
150 '--mode', 'tile', '256', '256', | 199 '--mode', 'tile', '256', '256', |
151 '--writePath', self._temp_dir, | 200 '--writePath', self._temp_dir, |
152 '--writeJsonSummaryPath', output_json_path]) | 201 '--writeJsonSummaryPath', output_json_path]) |
153 expected_summary_dict = { | 202 expected_summary_dict = { |
| 203 "header" : EXPECTED_HEADER_CONTENTS, |
154 "actual-results" : { | 204 "actual-results" : { |
155 "no-comparison" : { | 205 "red.skp": { |
156 # Manually verified these 6 images, all 256x256 tiles, | 206 # Manually verified these 6 images, all 256x256 tiles, |
157 # consistent with a tiled version of the 640x400 red rect | 207 # consistent with a tiled version of the 640x400 red rect |
158 # with black borders. | 208 # with black borders. |
159 "red0.png" : ["bitmap-64bitMD5", 5815827069051002745], | 209 "tiled-images": [{ |
160 "red1.png" : ["bitmap-64bitMD5", 9323613075234140270], | 210 "checksumAlgorithm" : "bitmap-64bitMD5", |
161 "red2.png" : ["bitmap-64bitMD5", 16670399404877552232], | 211 "checksumValue" : 5815827069051002745, |
162 "red3.png" : ["bitmap-64bitMD5", 2507897274083364964], | 212 "comparisonResult" : "no-comparison", |
163 "red4.png" : ["bitmap-64bitMD5", 7325267995523877959], | 213 "filepath" : "red_skp-tile0.png", |
164 "red5.png" : ["bitmap-64bitMD5", 2181381724594493116], | 214 }, { |
| 215 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 216 "checksumValue" : 9323613075234140270, |
| 217 "comparisonResult" : "no-comparison", |
| 218 "filepath" : "red_skp-tile1.png", |
| 219 }, { |
| 220 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 221 "checksumValue" : 16670399404877552232, |
| 222 "comparisonResult" : "no-comparison", |
| 223 "filepath" : "red_skp-tile2.png", |
| 224 }, { |
| 225 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 226 "checksumValue" : 2507897274083364964, |
| 227 "comparisonResult" : "no-comparison", |
| 228 "filepath" : "red_skp-tile3.png", |
| 229 }, { |
| 230 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 231 "checksumValue" : 7325267995523877959, |
| 232 "comparisonResult" : "no-comparison", |
| 233 "filepath" : "red_skp-tile4.png", |
| 234 }, { |
| 235 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 236 "checksumValue" : 2181381724594493116, |
| 237 "comparisonResult" : "no-comparison", |
| 238 "filepath" : "red_skp-tile5.png", |
| 239 }], |
| 240 }, |
| 241 "green.skp": { |
165 # Manually verified these 6 images, all 256x256 tiles, | 242 # Manually verified these 6 images, all 256x256 tiles, |
166 # consistent with a tiled version of the 640x400 green rect | 243 # consistent with a tiled version of the 640x400 green rect |
167 # with black borders. | 244 # with black borders. |
168 "green0.png" : ["bitmap-64bitMD5", 12587324416545178013], | 245 "tiled-images": [{ |
169 "green1.png" : ["bitmap-64bitMD5", 7624374914829746293], | 246 "checksumAlgorithm" : "bitmap-64bitMD5", |
170 "green2.png" : ["bitmap-64bitMD5", 5686489729535631913], | 247 "checksumValue" : 12587324416545178013, |
171 "green3.png" : ["bitmap-64bitMD5", 7980646035555096146], | 248 "comparisonResult" : "no-comparison", |
172 "green4.png" : ["bitmap-64bitMD5", 17817086664365875131], | 249 "filepath" : "green_skp-tile0.png", |
173 "green5.png" : ["bitmap-64bitMD5", 10673669813016809363], | 250 }, { |
| 251 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 252 "checksumValue" : 7624374914829746293, |
| 253 "comparisonResult" : "no-comparison", |
| 254 "filepath" : "green_skp-tile1.png", |
| 255 }, { |
| 256 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 257 "checksumValue" : 5686489729535631913, |
| 258 "comparisonResult" : "no-comparison", |
| 259 "filepath" : "green_skp-tile2.png", |
| 260 }, { |
| 261 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 262 "checksumValue" : 7980646035555096146, |
| 263 "comparisonResult" : "no-comparison", |
| 264 "filepath" : "green_skp-tile3.png", |
| 265 }, { |
| 266 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 267 "checksumValue" : 17817086664365875131, |
| 268 "comparisonResult" : "no-comparison", |
| 269 "filepath" : "green_skp-tile4.png", |
| 270 }, { |
| 271 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 272 "checksumValue" : 10673669813016809363, |
| 273 "comparisonResult" : "no-comparison", |
| 274 "filepath" : "green_skp-tile5.png", |
| 275 }], |
174 } | 276 } |
175 } | 277 } |
176 } | 278 } |
177 self._assert_json_contents(output_json_path, expected_summary_dict) | 279 self._assert_json_contents(output_json_path, expected_summary_dict) |
178 self._assert_directory_contents( | 280 self._assert_directory_contents( |
179 self._temp_dir, | 281 self._temp_dir, |
180 ['red0.png', 'red1.png', 'red2.png', 'red3.png', 'red4.png', 'red5.png', | 282 ['red_skp-tile0.png', 'red_skp-tile1.png', 'red_skp-tile2.png', |
181 'green0.png', 'green1.png', 'green2.png', 'green3.png', 'green4.png', | 283 'red_skp-tile3.png', 'red_skp-tile4.png', 'red_skp-tile5.png', |
182 'green5.png', 'output.json']) | 284 'green_skp-tile0.png', 'green_skp-tile1.png', 'green_skp-tile2.png', |
| 285 'green_skp-tile3.png', 'green_skp-tile4.png', 'green_skp-tile5.png', |
| 286 'output.json']) |
183 | 287 |
184 def test_tiled_writeChecksumBasedFilenames(self): | 288 def test_tiled_writeChecksumBasedFilenames(self): |
185 """Same as test_tiled, but with --writeChecksumBasedFilenames.""" | 289 """Same as test_tiled, but with --writeChecksumBasedFilenames.""" |
186 output_json_path = os.path.join(self._temp_dir, 'output.json') | 290 output_json_path = os.path.join(self._temp_dir, 'output.json') |
187 self._generate_skps() | 291 self._generate_skps() |
188 self._run_render_pictures(['-r', self._input_skp_dir, | 292 self._run_render_pictures(['-r', self._input_skp_dir, |
189 '--bbh', 'grid', '256', '256', | 293 '--bbh', 'grid', '256', '256', |
190 '--mode', 'tile', '256', '256', | 294 '--mode', 'tile', '256', '256', |
191 '--writeChecksumBasedFilenames', | 295 '--writeChecksumBasedFilenames', |
192 '--writePath', self._temp_dir, | 296 '--writePath', self._temp_dir, |
193 '--writeJsonSummaryPath', output_json_path]) | 297 '--writeJsonSummaryPath', output_json_path]) |
194 expected_summary_dict = { | 298 expected_summary_dict = { |
| 299 "header" : EXPECTED_HEADER_CONTENTS, |
195 "actual-results" : { | 300 "actual-results" : { |
196 "no-comparison" : { | 301 "red.skp": { |
197 # Manually verified these 6 images, all 256x256 tiles, | 302 # Manually verified these 6 images, all 256x256 tiles, |
198 # consistent with a tiled version of the 640x400 red rect | 303 # consistent with a tiled version of the 640x400 red rect |
199 # with black borders. | 304 # with black borders. |
200 "red0.png" : ["bitmap-64bitMD5", 5815827069051002745], | 305 "tiled-images": [{ |
201 "red1.png" : ["bitmap-64bitMD5", 9323613075234140270], | 306 "checksumAlgorithm" : "bitmap-64bitMD5", |
202 "red2.png" : ["bitmap-64bitMD5", 16670399404877552232], | 307 "checksumValue" : 5815827069051002745, |
203 "red3.png" : ["bitmap-64bitMD5", 2507897274083364964], | 308 "comparisonResult" : "no-comparison", |
204 "red4.png" : ["bitmap-64bitMD5", 7325267995523877959], | 309 "filepath" : "red_skp/bitmap-64bitMD5_5815827069051002745.pn
g", |
205 "red5.png" : ["bitmap-64bitMD5", 2181381724594493116], | 310 }, { |
| 311 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 312 "checksumValue" : 9323613075234140270, |
| 313 "comparisonResult" : "no-comparison", |
| 314 "filepath" : "red_skp/bitmap-64bitMD5_9323613075234140270.pn
g", |
| 315 }, { |
| 316 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 317 "checksumValue" : 16670399404877552232, |
| 318 "comparisonResult" : "no-comparison", |
| 319 "filepath" : "red_skp/bitmap-64bitMD5_16670399404877552232.p
ng", |
| 320 }, { |
| 321 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 322 "checksumValue" : 2507897274083364964, |
| 323 "comparisonResult" : "no-comparison", |
| 324 "filepath" : "red_skp/bitmap-64bitMD5_2507897274083364964.pn
g", |
| 325 }, { |
| 326 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 327 "checksumValue" : 7325267995523877959, |
| 328 "comparisonResult" : "no-comparison", |
| 329 "filepath" : "red_skp/bitmap-64bitMD5_7325267995523877959.pn
g", |
| 330 }, { |
| 331 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 332 "checksumValue" : 2181381724594493116, |
| 333 "comparisonResult" : "no-comparison", |
| 334 "filepath" : "red_skp/bitmap-64bitMD5_2181381724594493116.pn
g", |
| 335 }], |
| 336 }, |
| 337 "green.skp": { |
206 # Manually verified these 6 images, all 256x256 tiles, | 338 # Manually verified these 6 images, all 256x256 tiles, |
207 # consistent with a tiled version of the 640x400 green rect | 339 # consistent with a tiled version of the 640x400 green rect |
208 # with black borders. | 340 # with black borders. |
209 "green0.png" : ["bitmap-64bitMD5", 12587324416545178013], | 341 "tiled-images": [{ |
210 "green1.png" : ["bitmap-64bitMD5", 7624374914829746293], | 342 "checksumAlgorithm" : "bitmap-64bitMD5", |
211 "green2.png" : ["bitmap-64bitMD5", 5686489729535631913], | 343 "checksumValue" : 12587324416545178013, |
212 "green3.png" : ["bitmap-64bitMD5", 7980646035555096146], | 344 "comparisonResult" : "no-comparison", |
213 "green4.png" : ["bitmap-64bitMD5", 17817086664365875131], | 345 "filepath" : "green_skp/bitmap-64bitMD5_12587324416545178013
.png", |
214 "green5.png" : ["bitmap-64bitMD5", 10673669813016809363], | 346 }, { |
| 347 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 348 "checksumValue" : 7624374914829746293, |
| 349 "comparisonResult" : "no-comparison", |
| 350 "filepath" : "green_skp/bitmap-64bitMD5_7624374914829746293.
png", |
| 351 }, { |
| 352 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 353 "checksumValue" : 5686489729535631913, |
| 354 "comparisonResult" : "no-comparison", |
| 355 "filepath" : "green_skp/bitmap-64bitMD5_5686489729535631913.
png", |
| 356 }, { |
| 357 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 358 "checksumValue" : 7980646035555096146, |
| 359 "comparisonResult" : "no-comparison", |
| 360 "filepath" : "green_skp/bitmap-64bitMD5_7980646035555096146.
png", |
| 361 }, { |
| 362 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 363 "checksumValue" : 17817086664365875131, |
| 364 "comparisonResult" : "no-comparison", |
| 365 "filepath" : "green_skp/bitmap-64bitMD5_17817086664365875131
.png", |
| 366 }, { |
| 367 "checksumAlgorithm" : "bitmap-64bitMD5", |
| 368 "checksumValue" : 10673669813016809363, |
| 369 "comparisonResult" : "no-comparison", |
| 370 "filepath" : "green_skp/bitmap-64bitMD5_10673669813016809363
.png", |
| 371 }], |
215 } | 372 } |
216 } | 373 } |
217 } | 374 } |
218 self._assert_json_contents(output_json_path, expected_summary_dict) | 375 self._assert_json_contents(output_json_path, expected_summary_dict) |
| 376 self._assert_directory_contents(self._temp_dir, [ |
| 377 'red_skp', 'green_skp', 'output.json']) |
219 self._assert_directory_contents( | 378 self._assert_directory_contents( |
220 self._temp_dir, | 379 os.path.join(self._temp_dir, 'red_skp'), |
221 ['bitmap-64bitMD5_5815827069051002745.png', | 380 ['bitmap-64bitMD5_5815827069051002745.png', |
222 'bitmap-64bitMD5_9323613075234140270.png', | 381 'bitmap-64bitMD5_9323613075234140270.png', |
223 'bitmap-64bitMD5_16670399404877552232.png', | 382 'bitmap-64bitMD5_16670399404877552232.png', |
224 'bitmap-64bitMD5_2507897274083364964.png', | 383 'bitmap-64bitMD5_2507897274083364964.png', |
225 'bitmap-64bitMD5_7325267995523877959.png', | 384 'bitmap-64bitMD5_7325267995523877959.png', |
226 'bitmap-64bitMD5_2181381724594493116.png', | 385 'bitmap-64bitMD5_2181381724594493116.png']) |
227 'bitmap-64bitMD5_12587324416545178013.png', | 386 self._assert_directory_contents( |
| 387 os.path.join(self._temp_dir, 'green_skp'), |
| 388 ['bitmap-64bitMD5_12587324416545178013.png', |
228 'bitmap-64bitMD5_7624374914829746293.png', | 389 'bitmap-64bitMD5_7624374914829746293.png', |
229 'bitmap-64bitMD5_5686489729535631913.png', | 390 'bitmap-64bitMD5_5686489729535631913.png', |
230 'bitmap-64bitMD5_7980646035555096146.png', | 391 'bitmap-64bitMD5_7980646035555096146.png', |
231 'bitmap-64bitMD5_17817086664365875131.png', | 392 'bitmap-64bitMD5_17817086664365875131.png', |
232 'bitmap-64bitMD5_10673669813016809363.png', | 393 'bitmap-64bitMD5_10673669813016809363.png']) |
233 'output.json']) | |
234 | 394 |
235 def _run_render_pictures(self, args): | 395 def _run_render_pictures(self, args): |
236 binary = self.find_path_to_program('render_pictures') | 396 binary = self.find_path_to_program('render_pictures') |
237 return self.run_command([binary, | 397 return self.run_command([binary, |
238 '--clone', '1', | 398 '--clone', '1', |
239 '--config', '8888', | 399 '--config', '8888', |
240 ] + args) | 400 ] + args) |
241 | 401 |
242 def _generate_skps(self): | 402 def _generate_skps(self): |
243 """Runs the skpmaker binary to generate files in self._input_skp_dir.""" | 403 """Runs the skpmaker binary to generate files in self._input_skp_dir.""" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 actual_dict = json.loads(file_contents) | 458 actual_dict = json.loads(file_contents) |
299 self.assertEqual(actual_dict, expected_dict) | 459 self.assertEqual(actual_dict, expected_dict) |
300 | 460 |
301 | 461 |
302 def main(): | 462 def main(): |
303 base_unittest.main(RenderPicturesTest) | 463 base_unittest.main(RenderPicturesTest) |
304 | 464 |
305 | 465 |
306 if __name__ == '__main__': | 466 if __name__ == '__main__': |
307 main() | 467 main() |
OLD | NEW |