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

Side by Side Diff: fuzzer/res/imp/fuzzer-collapse-details-sk.html

Issue 1662373002: Add UI to filter fuzzes based on tags. (Closed) Base URL: https://skia.googlesource.com/buildbot@add-asan
Patch Set: remove conflicting status-sk elements Created 4 years, 10 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 | « fuzzer/res/imp/README.md ('k') | fuzzer/res/imp/fuzzer-collapse-details-sk-demo.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 The fuzzer/res/fuzzer.js file must be included before this file. 2 The fuzzer/res/fuzzer.js file must be included before this file.
3 3
4 This in an HTML Import-able file that contains the definition 4 This in an HTML Import-able file that contains the definition
5 of the following elements: 5 of the following elements:
6 6
7 <fuzzer-collapse-details-sk> 7 <fuzzer-collapse-details-sk>
8 8
9 To use this file import it: 9 To use this file import it:
10 10
11 <link href="/res/imp/fuzzer-collapse-details-sk.html" rel="import" /> 11 <link href="/res/imp/fuzzer-collapse-details-sk.html" rel="import" />
12 12
13 Usage: 13 Usage:
14 14
15 <fuzzer-collapse-details-sk></fuzzer-collapse-details-sk> 15 <fuzzer-collapse-details-sk></fuzzer-collapse-details-sk>
16 16
17 Properties: 17 Properties:
18 details - The details object. Expected to have the following attributes: 18 details - The details object. Expected to have the following attributes:
19 lineNumber: Number, 19 lineNumber: Number,
20 count: Number, 20 count: Number, The full number of reports.
21 reports: Array of Reports. If non-empty, 21 reports: Array of Reports. If non-empty,
22 an expandable details panel will be created containing representations o f the reports. 22 an expandable details panel will be created containing representations o f the reports.
23 If empty, just the summary will be shown. 23 If empty, just the summary will be shown.
24 Reports are objects and have the following attributes: 24 Reports are objects and have the following attributes:
25 - name: String, The name of the binary, likely an md5 hash 25 - name: String, The name of the binary, likely an md5 hash
26 - type: String, The type of the binary 26 - type: String, The type of the binary
27 - flags: Array of String, The flags associated with the run (e.g. DebugD umped) 27 - debugFlags: Array of String, Flags associated with the debug run (e.g. FailedGracefully)
28 - releaseFlags: Array of String, Flags associated with the release run ( e.g. ASANCrashed)
28 - debugStackTrace: Object (see fuzzer-stacktrace-sk.html for schema) 29 - debugStackTrace: Object (see fuzzer-stacktrace-sk.html for schema)
29 - releaseStackTrace: Object (see fuzzer-stacktrace-sk.html for schema) 30 - releaseStackTrace: Object (see fuzzer-stacktrace-sk.html for schema)
31 - category: String.
30 detailsBase: String, the base url for details (should include file and funct ion name) 32 detailsBase: String, the base url for details (should include file and funct ion name)
31 expand: Boolean, if this element should be auto expanded. 33 expand: Boolean, if this element should be auto expanded.
34 exclude: Array of String, all fuzzes that have one or more of these strings as a flag will not
35 be shown. This array must be sorted lexographically.
36 include: Array of String, all fuzzes must have one or more of these strings as a flag to be
37 shown. This array must be sorted lexographically.
32 38
33 Methods: 39 Methods:
34 setDetails(details) - Programmatically set the details object. 40 setDetails(details) - Programmatically set the details object.
35 showMore() - Programmatically show up to 6 more details panels. 41 showMore() - Programmatically show up to 6 more details panels.
36 showFewer() - Programmatically show up to 6 fewer details panels. 42 showFewer() - Programmatically show up to 6 fewer details panels.
37 toggleDetails() - Programmticaly hide/show the details panels.
38 43
39 Events: 44 Events:
40 None. 45 None.
41 --> 46 -->
42 <link rel="import" href="/res/common/imp/9/details-summary.html"> 47 <link rel="import" href="/res/common/imp/9/details-summary.html">
43 <link rel="import" href="/res/imp/bower_components/iron-flex-layout/iron-flex-la yout.html"> 48 <link rel="import" href="/res/imp/bower_components/iron-flex-layout/iron-flex-la yout.html">
44 <link rel="import" href="/res/imp/bower_components/iron-collapse/iron-collapse.h tml"> 49 <link rel="import" href="/res/imp/bower_components/iron-collapse/iron-collapse.h tml">
45 <link rel="import" href="/res/imp/bower_components/iron-icons/iron-icons.html"> 50 <link rel="import" href="/res/imp/bower_components/iron-icons/iron-icons.html">
46 <link rel="import" href="/res/imp/bower_components/paper-button/paper-button.htm l"> 51 <link rel="import" href="/res/imp/bower_components/paper-button/paper-button.htm l">
47 <link rel="import" href="fuzzer-stacktrace-sk.html"> 52 <link rel="import" href="fuzzer-stacktrace-sk.html">
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 .show-more-less-bar .status { 97 .show-more-less-bar .status {
93 @apply(--layout-horizontal); 98 @apply(--layout-horizontal);
94 @apply(--layout-flex); 99 @apply(--layout-flex);
95 } 100 }
96 101
97 .center { 102 .center {
98 margin: auto; 103 margin: auto;
99 } 104 }
100 </style> 105 </style>
101 <div id="wrapper"> 106 <div id="wrapper">
102 <template is="dom-if" if="{{!_hasDetails(details)}}"> 107 <li>
103 <li> 108 <details-sk open="[[expand]]">
104 <a href$="{{_getDetailsLink(detailsBase, details)}}">Line {{details.li neNumber}}</a> 109 <summary-sk>
105 -- {{details.count}} crash-causing fuzzes 110 <a href$="{{_getDetailsLink(detailsBase, details)}}">Line {{details. lineNumber}}</a>
106 </li> 111 -- {{numReports}} crash-causing fuzzes
107 </template> 112 </summary-sk>
108 <template is="dom-if" if="{{_hasDetails(details)}}"> 113 <div class="panel-container">
109 <li> 114 <template is="dom-repeat" items="{{_getSomeReports(filteredReports, toShow)}}" as="report">
110 <details-sk open="[[expand]]"> 115 <div class="panel">
111 <summary-sk> 116 <div class="title">
112 <a href$="{{_getDetailsLink(detailsBase, details)}}">Line {{detail s.lineNumber}}</a> 117 File:
113 -- {{details.count}} crash-causing fuzzes 118 <a href$="{{_getDownloadLink(report)}}">{{report.fuzzName}}</a>
114 </summary-sk> 119 &nbsp;
115 <div class="panel-container"> 120 <a href$="{{_getPermaLink(report)}}"><iron-icon icon="icons:link " title="permalink"></iron-icon></a>
116 <template is="dom-repeat" items="{{reports}}" as="report"> 121 &nbsp;
117 <div class="panel"> 122 <a href$="{{_getNewBugLink(report)}}" target="_blank"><iron-icon icon="icons:bug-report" title="file a bug about this fuzz"></iron-icon></a>
118 <div class="title">
119 File:
120 <a href$="{{_getDownloadLink(report)}}">{{report.fuzzName}}</a >
121 &nbsp;
122 <a href$="{{_getPermaLink(report)}}"><iron-icon icon="icons:li nk" title="permalink"></iron-icon></a>
123 &nbsp;
124 <a href$="{{_getNewBugLink(report)}}" target="_blank"><iron-ic on icon="icons:bug-report" title="file a bug about this fuzz"></iron-icon></a>
125 </div>
126 <div class="raw">
127 <a href$="{{_getMetaLink(report,'debug','err')}}">debug_err< /a>
128 <a href$="{{_getMetaLink(report,'release','err')}}">release_ err</a>
129 <a href$="{{_getMetaLink(report,'debug','dump')}}">debug_dum p</a>
130 <a href$="{{_getMetaLink(report,'release','dump')}}">release _dump</a>
131 </div>
132 <div>{{_getFlags(report)}}</div>
133 <h4>Debug Stack Trace</h4>
134 <fuzzer-stacktrace-sk trace="{{report.debugStackTrace}}"></fuz zer-stacktrace-sk>
135 <h4>Release Stack Trace</h4>
136 <fuzzer-stacktrace-sk trace="{{report.releaseStackTrace}}"></f uzzer-stacktrace-sk>
137 </div> 123 </div>
138 </template> 124 <div class="raw">
139 <div class="show-more-less-bar"> 125 <a href$="{{_getMetaLink(report,'debug','asan')}}">debug_asan< /a>
140 <paper-button disabled$="{{!hasFewer}}" on-click="showFewer">Sho w Fewer</paper-button> 126 <a href$="{{_getMetaLink(report,'release','asan')}}">release_a san</a>
141 <span class="status"> 127 <a href$="{{_getMetaLink(report,'debug','err')}}">debug_err</a >
142 <span class="center">Showing {{toShow}}/{{details.count}}</spa n> 128 <a href$="{{_getMetaLink(report,'release','err')}}">release_er r</a>
143 </span> 129 <a href$="{{_getMetaLink(report,'debug','dump')}}">debug_dump< /a>
144 <paper-button disabled$="{{!hasMore}}" on-click="showMore">Show More</paper-button> 130 <a href$="{{_getMetaLink(report,'release','dump')}}">release_d ump</a>
131 </div>
132 <div>{{_getFlags(report)}}</div>
133 <h4>Debug Stack Trace</h4>
134 <fuzzer-stacktrace-sk trace="{{report.debugStackTrace}}"></fuzze r-stacktrace-sk>
135 <h4>Release Stack Trace</h4>
136 <fuzzer-stacktrace-sk trace="{{report.releaseStackTrace}}"></fuz zer-stacktrace-sk>
145 </div> 137 </div>
138 </template>
139 <div class="show-more-less-bar">
140 <paper-button disabled$="{{!hasFewer}}" on-click="showFewer">Show Fewer</paper-button>
141 <span class="status">
142 <span class="center">Showing {{_min(toShow, numReports)}}/{{numR eports}}</span>
143 </span>
144 <paper-button disabled$="{{!hasMore}}" on-click="showMore">Show Mo re</paper-button>
146 </div> 145 </div>
147 </details-sk> 146 </div>
148 </li> 147 </details-sk>
149 </template> 148 </li>
150 </div> 149 </div>
151 </template> 150 </template>
152 <script> 151 <script>
153 Polymer({ 152 Polymer({
154 is: 'fuzzer-collapse-details-sk', 153 is: 'fuzzer-collapse-details-sk',
155 154
156 properties: { 155 properties: {
157 details: { // expected to be provided 156 details: { // expected to be provided
158 type: Object, 157 type: Object,
159 value: function() { 158 value: function() {
160 return {}; 159 return {};
161 } 160 }
162 }, 161 },
163 expand: { 162 expand: {
164 type: Boolean, 163 type: Boolean,
165 value: false, 164 value: false,
166 }, 165 },
167 // detailsBase is the base url to the details page for the parent element. 166 // detailsBase is the base url to the details page for the parent element.
168 // We will use fuzzer.getLinkToDetails() to append the line information to the link. 167 // We will use fuzzer.getLinkToDetails() to append the line information to the link.
169 detailsBase: { // expected to be provided 168 detailsBase: {
170 type: String, 169 type: String,
171 value: "" 170 value: ""
172 }, 171 },
173 // The number of detail panels to show 172 // The number of detail panels to show
174 toShow: { 173 toShow: {
175 type: Number, 174 type: Number,
176 value: 0, 175 value: 0,
177 readOnly: true, 176 readOnly: true,
178 }, 177 },
179 // Returns true if there are more detail panels to show 178 // Returns true if there are more detail panels to show
180 hasMore: { 179 hasMore: {
181 type: Boolean, 180 type: Boolean,
182 computed: "_hasMore(details, toShow)" 181 computed: "_hasMore(details, toShow)"
183 }, 182 },
184 // Returns true if there are not 0 detail panels currently displayed. 183 // Returns true if there are not 0 detail panels currently displayed.
185 hasFewer: { 184 hasFewer: {
186 type: Boolean, 185 type: Boolean,
187 computed: "_hasFewer(toShow)" 186 computed: "_hasFewer(toShow)"
188 }, 187 },
189 // Returns the amount of detail panels equal to 'toShow' 188 // Returns the amount of detail panels equal to 'toShow'
190 reports: { 189 filteredReports: {
191 type: Array, 190 type: Array,
192 computed: "_getSomeReports(details, toShow)", 191 computed: "_filterReports(details, exclude, include)",
193 }, 192 },
193 exclude: {
194 type: Array,
195 value: [],
196 },
197 include: {
198 type: Array,
199 value: [],
200 },
201 numReports: {
202 type: Number,
203 computed: "_getNumFiltered(filteredReports)",
204 reflectToAttribute: true,
205 notify: true,
206 }
194 }, 207 },
195 208
196 ready: function() { 209 ready: function() {
197 if (this.details.reports) { 210 if (this.details.reports) {
198 this._setToShow(Math.min(6, this.details.reports.length)); 211 this._setToShow(Math.min(6, this.details.reports.length));
199 } 212 }
200 }, 213 },
201 214
202 setDetails: function(details) { 215 setDetails: function(details) {
203 this.details = details; 216 this.details = details;
204 this._setToShow(Math.min(6, this.details.reports.length)); 217 this._setToShow(Math.min(6, this.details.reports.length));
205 }, 218 },
206 219
207 _hasDetails: function(details) {
208 return this.details.reports && this.details.reports.length > 0;
209 },
210
211 _getFlags: function(report) { 220 _getFlags: function(report) {
212 return report.flags.join(" | "); 221 if (!report.debugFlags) {
222 report.debugFlags = ["<none>"];
223 }
224 if (!report.releaseFlags) {
225 report.releaseFlags = ["<none>"];
226 }
227 return "[Debug] " + report.debugFlags.join(" | ") + " [Release] " +
228 report.releaseFlags.join(" | ");
213 }, 229 },
214 230
215 showMore: function() { 231 showMore: function() {
216 this._setToShow(Math.min(this.toShow + 6, this.details.reports.length)); 232 this._setToShow(Math.min(this.toShow + 6, this.details.reports.length));
217 }, 233 },
218 234
219 showFewer: function() { 235 showFewer: function() {
220 this._setToShow(Math.max(this.toShow - 6, 0)); 236 this._setToShow(Math.max(this.toShow - 6, 0));
221 }, 237 },
222 238
223 _hasMore: function(details, toShow) { 239 _hasMore: function(details, toShow) {
224 return details.reports && toShow < details.reports.length; 240 return details.reports && toShow < details.reports.length;
225 }, 241 },
226 242
227 _hasFewer: function(toShow) { 243 _hasFewer: function(toShow) {
228 return toShow > 0; 244 return toShow > 0;
229 }, 245 },
230 246
247 _min: function(a, b) {
248 return Math.min(a, b);
249 },
250
251 _filterReports: function(details, exclude, include) {
252 exclude = exclude || [];
253 include = include || [];
254 if (exclude.length === 0 && include.length === 0) {
255 return details.reports;
256 }
257
258 return details.reports.filter(function(report){
259 if (sk.sharesElement(exclude, report.debugFlags) ||
260 sk.sharesElement(exclude, report.releaseFlags)) {
261 return false;
262 }
263 if (include.length === 0) {
264 return true;
265 }
266 if (!sk.sharesElement(include, report.debugFlags) &&
267 !sk.sharesElement(include, report.releaseFlags)) {
268 return false;
269 }
270 return true;
271 });
272 },
273
231 // _getSomeReports returns up to {{toShow}} reports from details 274 // _getSomeReports returns up to {{toShow}} reports from details
232 _getSomeReports: function(details, toShow) { 275 _getSomeReports: function(filteredReports, toShow) {
233 if (!details.reports) { 276 if (!filteredReports) {
234 return []; 277 return [];
235 } 278 }
236 if (toShow > details.reports.length) { 279 if (toShow > filteredReports.length) {
237 return details.reports; 280 return filteredReports;
238 } 281 }
239 return details.reports.slice(0, toShow); 282 return filteredReports.slice(0, toShow);
240 }, 283 },
241 284
242 _getDownloadLink: function(report) { 285 _getDownloadLink: function(report) {
243 return "/fuzz/"+report.category+"/" + report.fuzzName; 286 return "/fuzz/"+report.category+"/" + report.fuzzName;
244 }, 287 },
245 288
246 _getMetaLink: function(report, build, extension) { 289 _getMetaLink: function(report, build, extension) {
247 var name = report.fuzzName +"_" + build +"." + extension; 290 var name = report.fuzzName +"_" + build +"." + extension;
248 return "/metadata/" + report.category +"/" + name; 291 return "/metadata/" + report.category +"/" + name;
249 }, 292 },
250 293
251 _getDetailsLink: function(detailsBase, details) { 294 _getDetailsLink: function(detailsBase, details) {
252 return fuzzer.getLinkToDetails(detailsBase, 'line', details.lineNumber); 295 return fuzzer.getLinkToDetails(detailsBase, 'line', details.lineNumber);
253 }, 296 },
254 297
255 _getPermaLink: function(report) { 298 _getPermaLink: function(report) {
256 return "/category/"+report.category + "/name/" + report.fuzzName; 299 return "/category/"+report.category + "/name/" + report.fuzzName;
257 }, 300 },
258 301
259 _getNewBugLink: function(report) { 302 _getNewBugLink: function(report) {
260 return "/newBug?name=" + report.fuzzName + "&category="+report.category; 303 return "/newBug?name=" + report.fuzzName + "&category="+report.category;
261 }, 304 },
305 _getNumFiltered: function(filteredReports) {
306 if (!filteredReports) {
307 return 0;
308 }
309 return filteredReports.length;
310 },
262 }); 311 });
263 </script> 312 </script>
264 </dom-module> 313 </dom-module>
OLDNEW
« no previous file with comments | « fuzzer/res/imp/README.md ('k') | fuzzer/res/imp/fuzzer-collapse-details-sk-demo.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698