1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
|
<!DOCTYPE html>
<html ng-app="Loader" ng-controller="Loader.Controller">
<head>
<title ng-bind="windowTitle"></title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.js"></script>
<script src="loader.js"></script>
<script src="diff_viewer.js"></script>
<link rel="stylesheet" href="view.css">
</head>
<body>
<h2>
Instructions, roadmap, etc. are at
<a href="http://tinyurl.com/SkiaRebaselineServer">
http://tinyurl.com/SkiaRebaselineServer
</a>
</h2>
<em>
{{loadingMessage}}
</em>
<div ng-hide="!categories"><!-- everything: hide until data is loaded -->
<div class="warning-div"
ng-hide="!(header.isEditable && header.isExported)">
WARNING! These results are editable and exported, so any user
who can connect to this server over the network can modify them.
</div>
<div ng-hide="!(header.timeUpdated)">
Results current as of {{localTimeString(header.timeUpdated)}}
</div>
<div><!-- tabs -->
<div class="tab-spacer" ng-repeat="tab in tabs">
<div class="tab-{{tab == viewingTab}}"
ng-click="setViewingTab(tab)">
{{tab}} ({{numResultsPerTab[tab]}})
</div>
<div class="tab-spacer">
</div>
</div>
</div><!-- tabs -->
<div class="tab-main"><!-- main display area of selected tab -->
<br>
<!-- We only show the filters/settings table on the Unfiled tab. -->
<table ng-hide="viewingTab != defaultTab" border="1">
<tr>
<th colspan="4">
Filters
</th>
<th>
Settings
</th>
</tr>
<tr valign="top">
<!-- TODO(epoger): make this an ng-repeat over resultType, config, etc? -->
<td>
resultType<br>
<label ng-repeat="(resultType, count) in categories['resultType'] track by $index">
<input type="checkbox"
name="resultTypes"
value="{{resultType}}"
ng-checked="!isValueInSet(resultType, hiddenResultTypes)"
ng-click="toggleValueInSet(resultType, hiddenResultTypes); setUpdatesPending(true)">
{{resultType}} ({{count}})<br>
</label>
<button ng-click="hiddenResultTypes = {}; updateResults()">
all
</button>
<button ng-click="hiddenResultTypes = {}; toggleValuesInSet(allResultTypes, hiddenResultTypes); updateResults()">
none
</button>
<button ng-click="toggleValuesInSet(allResultTypes, hiddenResultTypes); updateResults()">
toggle
</button>
</td>
<td ng-repeat="category in ['builder', 'test']">
{{category}}
<br>
<input type="text"
ng-model="categoryValueMatch[category]"
ng-change="setUpdatesPending(true)"/>
<br>
<button ng-click="setCategoryValueMatch(category, '')"
ng-disabled="('' == categoryValueMatch[category])">
clear (show all)
</button>
</td>
<td>
config<br>
<label ng-repeat="(config, count) in categories['config'] track by $index">
<input type="checkbox"
name="configs"
value="{{config}}"
ng-checked="!isValueInSet(config, hiddenConfigs)"
ng-click="toggleValueInSet(config, hiddenConfigs); setUpdatesPending(true)">
{{config}} ({{count}})<br>
</label>
<button ng-click="hiddenConfigs = {}; updateResults()">
all
</button>
<button ng-click="hiddenConfigs = {}; toggleValuesInSet(allConfigs, hiddenConfigs); updateResults()">
none
</button>
<button ng-click="toggleValuesInSet(allConfigs, hiddenConfigs); updateResults()">
toggle
</button>
</td>
<td><table>
<tr><td>
Image width
<input type="text" ng-model="imageSizePending"
ng-init="imageSizePending=100"
ng-change="areUpdatesPending = true"
maxlength="4"/>
</td></tr>
<tr><td>
Max records to display
<input type="text" ng-model="displayLimitPending"
ng-init="displayLimitPending=50"
ng-change="areUpdatesPending = true"
maxlength="4"/>
</td></tr>
<tr><td>
<button class="update-results-button"
ng-click="updateResults()"
ng-disabled="!areUpdatesPending">
Update Results
</button>
</td></tr>
</tr></table></td>
</tr>
</table>
<p>
<!-- Submission UI that we only show in the Pending Approval tab. -->
<div ng-hide="'Pending Approval' != viewingTab">
<div style="display:inline-block">
<button style="font-size:20px"
ng-click="submitApprovals(filteredTestData)"
ng-disabled="submitPending || (filteredTestData.length == 0)">
Update these {{filteredTestData.length}} expectations on the server
</button>
</div>
<div style="display:inline-block">
<div style="font-size:20px"
ng-hide="!submitPending">
Submitting, please wait...
</div>
</div>
<div>
Advanced settings...
<input type="checkbox" ng-model="showSubmitAdvancedSettings">
show
<ul ng-hide="!showSubmitAdvancedSettings">
<li ng-repeat="setting in ['reviewed-by-human', 'ignore-failure']">
{{setting}}
<input type="checkbox" ng-model="submitAdvancedSettings[setting]">
</li>
<li ng-repeat="setting in ['bug']">
{{setting}}
<input type="text" ng-model="submitAdvancedSettings[setting]">
</li>
</ul>
</div>
</div>
<p>
<table border="0"><tr><td> <!-- table holding results header + results table -->
<table border="0" width="100%"> <!-- results header -->
<tr>
<td>
Found {{filteredTestData.length}} matches;
<span ng-hide="filteredTestData.length <= limitedTestData.length">
displaying the first {{limitedTestData.length}}
</span>
<span ng-hide="filteredTestData.length > limitedTestData.length">
displaying them all
</span>
<br>
(click on the column header radio buttons to re-sort by that column)
</td>
<td align="right">
<div>
all tests shown:
<button ng-click="selectAllItems()">
select
</button>
<button ng-click="clearAllItems()">
clear
</button>
<button ng-click="toggleAllItems()">
toggle
</button>
</div>
<div ng-repeat="otherTab in tabs">
<button ng-click="moveSelectedItemsToTab(otherTab)"
ng-disabled="selectedItems.length == 0"
ng-hide="otherTab == viewingTab">
move {{selectedItems.length}} selected tests to {{otherTab}} tab
</button>
</div>
</td>
</tr>
</table> <!-- results header -->
</td></tr><tr><td>
<table border="1" ng-app="diff_viewer"> <!-- results -->
<tr>
<!-- Most column headers are displayed in a common fashion... -->
<th ng-repeat="categoryName in ['resultType', 'builder', 'test', 'config']">
<input type="radio"
name="sortColumnRadio"
value="{{categoryName}}"
ng-checked="(sortColumn == categoryName)"
ng-click="sortResultsBy(categoryName)">
{{categoryName}}
</th>
<!-- ... but there are a few columns where we display things differently. -->
<th>
<input type="radio"
name="sortColumnRadio"
value="bugs"
ng-checked="(sortColumn == 'bugs')"
ng-click="sortResultsBy('bugs')">
bugs
</th>
<th width="{{imageSize}}">
<input type="radio"
name="sortColumnRadio"
value="expectedHashDigest"
ng-checked="(sortColumn == 'expectedHashDigest')"
ng-click="sortResultsBy('expectedHashDigest')">
expected image
</th>
<th width="{{imageSize}}">
<input type="radio"
name="sortColumnRadio"
value="actualHashDigest"
ng-checked="(sortColumn == 'actualHashDigest')"
ng-click="sortResultsBy('actualHashDigest')">
actual image
</th>
<th width="{{imageSize}}">
<input type="radio"
name="sortColumnRadio"
value="percentDifferingPixels"
ng-checked="(sortColumn == 'percentDifferingPixels')"
ng-click="sortResultsBy('percentDifferingPixels')">
differing pixels in white
</th>
<th width="{{imageSize}}">
<input type="radio"
name="sortColumnRadio"
value="weightedDiffMeasure"
ng-checked="(sortColumn == 'weightedDiffMeasure')"
ng-click="sortResultsBy('weightedDiffMeasure')">
difference per pixel
<br>
<input type="range" ng-model="pixelDiffBgColorBrightness"
ng-init="pixelDiffBgColorBrightness=64; pixelDiffBgColor=brightnessStringToHexColor(pixelDiffBgColorBrightness)"
ng-change="pixelDiffBgColor=brightnessStringToHexColor(pixelDiffBgColorBrightness)"
title="image background brightness"
min="0" max="255"/>
</th>
<th>
<!-- item-selection checkbox column -->
</th>
</tr>
<tr ng-repeat="result in limitedTestData" ng-controller="ImageController">
<td>
{{result.resultType}}
<br>
<button class="show-only-button"
ng-hide="viewingTab != defaultTab"
ng-click="showOnlyResultType(result.resultType)"
title="show only results of type '{{result.resultType}}'">
show only
</button>
<br>
<button class="show-all-button"
ng-hide="viewingTab != defaultTab"
ng-disabled="0 == setSize(hiddenResultTypes)"
ng-click="showAllResultTypes()"
title="show results of all types">
show all
</button>
</td>
<td ng-repeat="categoryName in ['builder', 'test']">
{{result[categoryName]}}
<br>
<button class="show-only-button"
ng-hide="viewingTab != defaultTab"
ng-disabled="result[categoryName] == categoryValueMatch[categoryName]"
ng-click="setCategoryValueMatch(categoryName, result[categoryName])"
title="show only results of {{categoryName}} '{{result[categoryName]}}'">
show only
</button>
<br>
<button class="show-all-button"
ng-hide="viewingTab != defaultTab"
ng-disabled="'' == categoryValueMatch[categoryName]"
ng-click="setCategoryValueMatch(categoryName, '')"
title="show results of all {{categoryName}}s">
show all
</button>
</td>
<td>
{{result.config}}
<br>
<button class="show-only-button"
ng-hide="viewingTab != defaultTab"
ng-click="showOnlyConfig(result.config)"
title="show only results of config '{{result.config}}'">
show only
</button>
<br>
<button class="show-all-button"
ng-hide="viewingTab != defaultTab"
ng-disabled="0 == setSize(hiddenConfigs)"
ng-click="showAllConfigs()"
title="show results of all configs">
show all
</button>
</td>
<td>
<a ng-repeat="bug in result['bugs']"
href="https://code.google.com/p/skia/issues/detail?id={{bug}}"
target="_blank">
{{bug}}
</a>
</td>
<!-- expected image -->
<td valign="bottom" width="{{imageSize}}">
<a href="http://chromium-skia-gm.commondatastorage.googleapis.com/gm/{{result.expectedHashType}}/{{result.test}}/{{result.expectedHashDigest}}.png" target="_blank">View Image</a><br/>
<img-compare type="baseline" width="{{imageSize}}"
src="http://chromium-skia-gm.commondatastorage.googleapis.com/gm/{{result.expectedHashType}}/{{result.test}}/{{result.expectedHashDigest}}.png" />
</td>
<!-- actual image -->
<td valign="bottom" width="{{imageSize}}">
<a href="http://chromium-skia-gm.commondatastorage.googleapis.com/gm/{{result.actualHashType}}/{{result.test}}/{{result.actualHashDigest}}.png" target="_blank">View Image</a><br/>
<img-compare type="test" width="{{imageSize}}"
src="http://chromium-skia-gm.commondatastorage.googleapis.com/gm/{{result.actualHashType}}/{{result.test}}/{{result.actualHashDigest}}.png" />
</td>
<!-- whitediffs: every differing pixel shown in white -->
<td valign="bottom" width="{{imageSize}}">
<div ng-hide="result.expectedHashDigest == result.actualHashDigest"
title="{{result.numDifferingPixels | number:0}} of {{(100 * result.numDifferingPixels / result.percentDifferingPixels) | number:0}} pixels ({{result.percentDifferingPixels.toFixed(4)}}%) differ from expectation.">
{{result.percentDifferingPixels.toFixed(4)}}%
({{result.numDifferingPixels}})
<br/>
<a href="/static/generated-images/whitediffs/{{result.expectedHashDigest}}-vs-{{result.actualHashDigest}}.png" target="_blank">View Image</a><br/>
<img-compare type="differingPixelsInWhite" width="{{imageSize}}"
src="/static/generated-images/whitediffs/{{result.expectedHashDigest}}-vs-{{result.actualHashDigest}}.png" />
</div>
<div ng-hide="result.expectedHashDigest != result.actualHashDigest"
style="text-align:center">
–none–
</div>
</td>
<!-- diffs: per-channel RGB deltas -->
<td valign="bottom" width="{{imageSize}}">
<div ng-hide="result.expectedHashDigest == result.actualHashDigest"
title="Weighted difference measure is {{result.weightedDiffMeasure.toFixed(4)}}%. Maximum difference per channel: R={{result.maxDiffPerChannel[0]}}, G={{result.maxDiffPerChannel[1]}}, B={{result.maxDiffPerChannel[2]}}">
{{result.weightedDiffMeasure.toFixed(4)}}%
{{result.maxDiffPerChannel}}
<br/>
<a href="/static/generated-images/diffs/{{result.expectedHashDigest}}-vs-{{result.actualHashDigest}}.png" target="_blank">View Image</a><br/>
<img-compare ng-style="{backgroundColor: pixelDiffBgColor}"
type="differencePerPixel" width="{{imageSize}}"
src="/static/generated-images/diffs/{{result.expectedHashDigest}}-vs-{{result.actualHashDigest}}.png"
ng-mousedown="MagnifyDraw($event, true)"
ng-mousemove="MagnifyDraw($event, false)"
ng-mouseup="MagnifyEnd($event)"
ng-mouseleave="MagnifyEnd($event)" />
</div>
<div ng-hide="result.expectedHashDigest != result.actualHashDigest"
style="text-align:center">
–none–
</div>
</td>
<td>
<input type="checkbox"
name="rowSelect"
value="{{result.index}}"
ng-checked="isValueInArray(result.index, selectedItems)"
ng-click="toggleValueInArray(result.index, selectedItems)">
</tr>
</table> <!-- results -->
</td></tr></table> <!-- table holding results header + results table -->
</div><!-- main display area of selected tab -->
</div><!-- everything: hide until data is loaded -->
<!-- TODO(epoger): Can we get the base URLs (commondatastorage and
issues list) from
https://skia.googlesource.com/buildbot/+/master/site_config/global_variables.json ?
I tried importing the
http://skia.googlecode.com/svn/buildbot/skia_tools.js script and using
that to do so, but I got Access-Control-Allow-Origin errors.
-->
</body>
</html>
|