Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(937)

Side by Side Diff: gm/rebaseline_server/imagepair_test.py

Issue 479613002: Add ability to output ImageBaseGSUrl to render_picture and use in rebaseline server (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix render_pictures_test after rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gm/rebaseline_server/imagepair.py ('k') | gm/rebaseline_server/imagepairset.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 imagepair.py 9 Test imagepair.py
10 """ 10 """
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 None, 84 None,
85 # expected output: 85 # expected output:
86 { 86 {
87 'differenceData': { 87 'differenceData': {
88 'maxDiffPerChannel': [255, 255, 247], 88 'maxDiffPerChannel': [255, 255, 247],
89 'numDifferingPixels': 662, 89 'numDifferingPixels': 662,
90 'percentDifferingPixels': 0.0662, 90 'percentDifferingPixels': 0.0662,
91 'perceptualDifference': 0.06620300000000157, 91 'perceptualDifference': 0.06620300000000157,
92 'diffUrl': 'arcofzorro_16206093933823793653_png_png-vs-' + 92 'diffUrl': 'arcofzorro_16206093933823793653_png_png-vs-' +
93 'arcofzorro_13786535001616823825_png_png.png', 93 'arcofzorro_13786535001616823825_png_png.png',
94 'whiteDiffUrl': 'arcofzorro_16206093933823793653_png_png' + 94 'whiteDiffUrl': 'arcofzorro_16206093933823793653_png_png' +
95 '-vs-arcofzorro_13786535001616823825_png_png.png', 95 '-vs-arcofzorro_13786535001616823825_png_png.png',
96 }, 96 },
97 'imageAUrl': 'arcofzorro/16206093933823793653.png', 97 'imageAUrl': 'arcofzorro/16206093933823793653.png',
98 'imageBUrl': 'arcofzorro/13786535001616823825.png', 98 'imageBUrl': 'arcofzorro/13786535001616823825.png',
99 'isDifferent': True, 99 'isDifferent': True,
100 }, 100 },
101 ], 101 ],
102 102
103 [ 103 [
104 # inputs: 104 # inputs:
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 'isDifferent': True, 188 'isDifferent': True,
189 }, 189 },
190 ], 190 ],
191 191
192 ] 192 ]
193 193
194 db = imagediffdb.ImageDiffDB(self.temp_dir) 194 db = imagediffdb.ImageDiffDB(self.temp_dir)
195 for selftest in selftests: 195 for selftest in selftests:
196 image_pair = imagepair.ImagePair( 196 image_pair = imagepair.ImagePair(
197 image_diff_db=db, 197 image_diff_db=db,
198 base_url=IMG_URL_BASE, 198 imageA_base_url=IMG_URL_BASE,
199 imageB_base_url=IMG_URL_BASE,
199 imageA_relative_url=selftest[0], 200 imageA_relative_url=selftest[0],
200 imageB_relative_url=selftest[1], 201 imageB_relative_url=selftest[1],
201 expectations=selftest[2], 202 expectations=selftest[2],
202 extra_columns=selftest[3], 203 extra_columns=selftest[3],
203 download_all_images=True) 204 download_all_images=True)
204 self.assertEqual(image_pair.as_dict(), selftest[4]) 205 self.assertEqual(image_pair.as_dict(), selftest[4])
205 206
206 207
207 def main(): 208 def main():
208 suite = unittest.TestLoader().loadTestsFromTestCase(ImagePairTest) 209 suite = unittest.TestLoader().loadTestsFromTestCase(ImagePairTest)
209 unittest.TextTestRunner(verbosity=2).run(suite) 210 unittest.TextTestRunner(verbosity=2).run(suite)
210 211
211 212
212 if __name__ == '__main__': 213 if __name__ == '__main__':
213 main() 214 main()
OLDNEW
« no previous file with comments | « gm/rebaseline_server/imagepair.py ('k') | gm/rebaseline_server/imagepairset.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698