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

Unified Diff: fuzzer/res/imp/fuzzer-collapse-function-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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fuzzer/res/imp/fuzzer-collapse-file-sk.html ('k') | fuzzer/res/imp/fuzzer-collapse-function-sk-demo.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fuzzer/res/imp/fuzzer-collapse-function-sk.html
diff --git a/fuzzer/res/imp/fuzzer-collapse-function-sk.html b/fuzzer/res/imp/fuzzer-collapse-function-sk.html
new file mode 100644
index 0000000000000000000000000000000000000000..317a807ba71b61d75b9bda9fb0dc6f7b2717d234
--- /dev/null
+++ b/fuzzer/res/imp/fuzzer-collapse-function-sk.html
@@ -0,0 +1,149 @@
+<!--
+ The fuzzer/res/fuzzer.js file must be included before this file.
+
+ This in an HTML Import-able file that contains the definition
+ of the following elements:
+
+ <fuzzer-collapse-function-sk>
+
+ To use this file import it:
+
+ <link href="/res/imp/fuzzer-collapse-function-sk.html" rel="import" />
+
+ Usage:
+
+ <fuzzer-collapse-function-sk></fuzzer-collapse-function-sk>
+
+ Properties:
+ func - The FunctionDetails object. Expected to have the following attributes:
+ functionName: String,
+ count: Number,
+ byLineNumber: Array of Detail objects. See fuzzer-collapse-details-sk.html for schema.
+
+ detailsBase: String, the base url for details (should include file name)
+ expand: String, which should be "true" if the gui should start expanded
+ numReports: Number, the dynamically computed sum of all child line counts. This is exposed
+ as its own variable to make dynamically summing the file easier.
+ exclude: Array of String, all fuzzes that have one or more of these strings as a flag will not
+ be shown. This array must be sorted lexographically.
+ include: Array of String, all fuzzes must have one or more of these strings as a flag to be
+ shown. This array must be sorted lexographically.
+
+ Methods:
+ setFunc(func) - Programmatically set the FunctionDetails object.
+
+ Events:
+ None.
+-->
+<link rel="import" href="/res/common/imp/9/details-summary.html">
+<link rel="import" href="/res/imp/bower_components/iron-collapse/iron-collapse.html">
+<link rel="import" href="/res/imp/bower_components/iron-icons/iron-icons.html">
+<link rel="import" href="fuzzer-collapse-details-sk.html">
+<dom-module id="fuzzer-collapse-function-sk">
+ <template>
+ <style>
+ .func {
+ padding: 20px;
+ border-radius: 10px;
+ background-color: #E5E5E5;
+ color: #000000;
+ display:block;
+ }
+
+ ul {
+ list-style-type: none;
+ }
+ </style>
+ <details-sk id="func" class="func" open="[[expand]]" >
+ <summary-sk>
+ <span>
+ <a href$="{{_getDetailsLink(detailsBase, func)}}">Function {{func.functionName}}</a>
+ -- {{numReports}} crash-causing fuzzes
+ </span>
+ </summary-sk>
+ <ul>
+ <template is="dom-repeat" items="{{func.byLineNumber}}" as="lineNumber">
+ <fuzzer-collapse-details-sk class="line-group"
+ details="[[lineNumber]]"
+ details-base="[[_getDetailsLink(detailsBase, func)]]"
+ expand="[[_expandFirst(index)]]"
+ exclude="[[exclude]]"
+ include="[[include]]"
+ on-dom-change="_recount">
+ </fuzzer-collapse-details-sk>
+ </template>
+ </ul>
+ </div>
+ </template>
+ <script>
+ Polymer({
+ is: 'fuzzer-collapse-function-sk',
+
+ properties: {
+ func: {
+ type: Object,
+ value: function() {
+ return {};
+ },
+ },
+ detailsBase: {
+ type: String,
+ value: ""
+ },
+ expand: {
+ type: Boolean,
+ value: false
+ },
+ exclude: {
+ type: Array,
+ value: function() {
+ return [];
+ },
+ },
+ include: {
+ type: Array,
+ value: function() {
+ return [];
+ },
+ },
+ numReports: {
+ type: Number,
+ value: 1,
+ notify: true,
+ }
+ },
+
+ _recount: function() {
+ this.debounce("recount-function", function(){
+ var lines = $$(".line-group", this.$.func);
+ var sum = 0;
+ lines.forEach(function(a){
+ sum += a.numReports;
+ });
+ // Allows the parent file to easily add up functions.
+ this.set("numReports", sum);
+ // Allows the functions to be sorted.
+ this.set("func.count", sum);
+ }.bind(this), 10);
+
+ },
+
+ setFunc: function(func){
+ this.func = func;
+ this._recount();
+ },
+
+ _expandFirst: function(index) {
+ return index === 0;
+ },
+
+ _getDetailsLink: function(detailsBase, func) {
+ if (!file) {
+ return "#";
+ }
+ return fuzzer.getLinkToDetails(detailsBase, "func", func.functionName);
+ },
+
+ });
+ </script>
+</dom-module>
« no previous file with comments | « fuzzer/res/imp/fuzzer-collapse-file-sk.html ('k') | fuzzer/res/imp/fuzzer-collapse-function-sk-demo.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698