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

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

Issue 471033003: Fixing broken images (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 'arcofzorro/13786535001616823825.png', 82 'arcofzorro/13786535001616823825.png',
83 None, 83 None,
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-arcof zorro_13786535001616823825_png_png.png',
93 'whiteDiffUrl': 'arcofzorro_16206093933823793653_png_png-vs- arcofzorro_13786535001616823825_png_png.png',
epoger 2014/08/14 18:06:35 Maybe in a followup CL, we could replace the repea
stephana 2014/08/14 18:28:22 Agreed. The repeated 'png' actually broke the fron
92 }, 94 },
93 'imageAUrl': 'arcofzorro/16206093933823793653.png', 95 'imageAUrl': 'arcofzorro/16206093933823793653.png',
94 'imageBUrl': 'arcofzorro/13786535001616823825.png', 96 'imageBUrl': 'arcofzorro/13786535001616823825.png',
95 'isDifferent': True, 97 'isDifferent': True,
96 }, 98 },
97 ], 99 ],
98 100
99 [ 101 [
100 # inputs: 102 # inputs:
101 'gradients_degenerate_2pt/10552995703607727960.png', 103 'gradients_degenerate_2pt/10552995703607727960.png',
102 'gradients_degenerate_2pt/11198253335583713230.png', 104 'gradients_degenerate_2pt/11198253335583713230.png',
103 { 105 {
104 'ignoreFailure': True, 106 'ignoreFailure': True,
105 'bugs': [1001, 1002], 107 'bugs': [1001, 1002],
106 }, 108 },
107 { 109 {
108 'builder': 'MyBuilder', 110 'builder': 'MyBuilder',
109 'test': 'MyTest', 111 'test': 'MyTest',
110 }, 112 },
111 # expected output: 113 # expected output:
112 { 114 {
113 'differenceData': { 115 'differenceData': {
114 'maxDiffPerChannel': [255, 0, 255], 116 'maxDiffPerChannel': [255, 0, 255],
115 'numDifferingPixels': 102400, 117 'numDifferingPixels': 102400,
116 'percentDifferingPixels': 100.00, 118 'percentDifferingPixels': 100.00,
117 'perceptualDifference': 100.00, 119 'perceptualDifference': 100.00,
120 'diffUrl': 'gradients_degenerate_2pt_10552995703607727960_pn g_png-vs-gradients_degenerate_2pt_11198253335583713230_png_png.png',
121 'whiteDiffUrl': 'gradients_degenerate_2pt_105529957036077279 60_png_png-vs-gradients_degenerate_2pt_11198253335583713230_png_png.png'
118 }, 122 },
119 'expectations': { 123 'expectations': {
120 'bugs': [1001, 1002], 124 'bugs': [1001, 1002],
121 'ignoreFailure': True, 125 'ignoreFailure': True,
122 }, 126 },
123 'extraColumns': { 127 'extraColumns': {
124 'builder': 'MyBuilder', 128 'builder': 'MyBuilder',
125 'test': 'MyTest', 129 'test': 'MyTest',
126 }, 130 },
127 'imageAUrl': 131 'imageAUrl':
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 self.assertEqual(image_pair.as_dict(), selftest[4]) 197 self.assertEqual(image_pair.as_dict(), selftest[4])
194 198
195 199
196 def main(): 200 def main():
197 suite = unittest.TestLoader().loadTestsFromTestCase(ImagePairTest) 201 suite = unittest.TestLoader().loadTestsFromTestCase(ImagePairTest)
198 unittest.TextTestRunner(verbosity=2).run(suite) 202 unittest.TextTestRunner(verbosity=2).run(suite)
199 203
200 204
201 if __name__ == '__main__': 205 if __name__ == '__main__':
202 main() 206 main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698