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

Unified Diff: fuzzer/go/fuzzer-fe/main.go

Issue 1676593002: Remove old count and overview fuzzer elements (Closed) Base URL: https://skia.googlesource.com/buildbot@filter-ui
Patch Set: merged in above 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/go/frontend/data/report_test.go ('k') | fuzzer/res/imp/fuzzer-count-sk.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fuzzer/go/fuzzer-fe/main.go
diff --git a/fuzzer/go/fuzzer-fe/main.go b/fuzzer/go/fuzzer-fe/main.go
index a0a049fc7c42b215a84e146fec59386b621eeca9..1e5c1bdf327468401aa0f39643d3dc4f3429d153 100644
--- a/fuzzer/go/fuzzer-fe/main.go
+++ b/fuzzer/go/fuzzer-fe/main.go
@@ -47,11 +47,8 @@ const (
var (
// indexTemplate is the main index.html page we serve.
indexTemplate *template.Template = nil
- // detailsTemplate is used for /category/foo, which displays the number of
- // fuzzes by file/function/line
- overviewTemplate *template.Template = nil
- // detailsTemplate is used for /details, which displays the information from
- // overview as well as the stacktraces and fuzzes.
+ // detailsTemplate is used for /category, which displays the count of fuzzes in various files
+ // as well as the stacktraces.
detailsTemplate *template.Template = nil
storageClient *storage.Client = nil
@@ -98,10 +95,6 @@ func reloadTemplates() {
filepath.Join(*resourcesDir, "templates/index.html"),
filepath.Join(*resourcesDir, "templates/header.html"),
))
- overviewTemplate = template.Must(template.ParseFiles(
- filepath.Join(*resourcesDir, "templates/overview.html"),
- filepath.Join(*resourcesDir, "templates/header.html"),
- ))
detailsTemplate = template.New("details.html")
// Allows this template to have Polymer binding in it and go template markup. The go templates
// have been changed to be {%.Thing%} instead of {{.Thing}}
@@ -227,7 +220,6 @@ func runServer() {
r.HandleFunc("/json/status", statusJSONHandler)
r.HandleFunc(`/fuzz/{category:[a-z_]+}/{name:[0-9a-f]+}`, fuzzHandler)
r.HandleFunc(`/metadata/{category:[a-z_]+}/{name:[0-9a-f]+_(debug|release)\.(err|dump|asan)}`, metadataHandler)
- r.HandleFunc("/fuzz_count", fuzzCountHandler)
r.HandleFunc("/newBug", newBugHandler)
rootHandler := login.ForceAuth(util.LoggingGzipRequestResponse(r), OAUTH2_CALLBACK_PATH)
@@ -265,23 +257,6 @@ func detailsPageHandler(w http.ResponseWriter, r *http.Request) {
}
}
-func summaryPageHandler(w http.ResponseWriter, r *http.Request) {
- if *local {
- reloadTemplates()
- }
- w.Header().Set("Content-Type", "text/html")
-
- var cat = struct {
- Category string
- }{
- Category: mux.Vars(r)["category"],
- }
-
- if err := overviewTemplate.Execute(w, cat); err != nil {
- glog.Errorf("Failed to expand template: %v", err)
- }
-}
-
type countSummary struct {
Category string `json:"category"`
CategoryDisplay string `json:"categoryDisplay"`
@@ -293,21 +268,16 @@ type countSummary struct {
}
func summaryJSONHandler(w http.ResponseWriter, r *http.Request) {
- var overview interface{}
- if cat := r.FormValue("category"); cat != "" {
- overview = data.CategoryOverview(cat)
- } else {
- overview = getOverview()
- }
+ summary := getSummary()
- if err := json.NewEncoder(w).Encode(overview); err != nil {
+ if err := json.NewEncoder(w).Encode(summary); err != nil {
glog.Errorf("Failed to write or encode output: %v", err)
return
}
}
-func getOverview() []countSummary {
- overviews := make([]countSummary, 0, len(fcommon.FUZZ_CATEGORIES))
+func getSummary() []countSummary {
+ counts := make([]countSummary, 0, len(fcommon.FUZZ_CATEGORIES))
for _, cat := range fcommon.FUZZ_CATEGORIES {
o := countSummary{
CategoryDisplay: fcommon.PrettifyCategory(cat),
@@ -326,9 +296,9 @@ func getOverview() []countSummary {
o.ThisBad = c.ThisBad
o.TotalGrey = c.TotalGrey
o.ThisGrey = c.ThisGrey
- overviews = append(overviews, o)
+ counts = append(counts, o)
}
- return overviews
+ return counts
}
func detailsJSONHandler(w http.ResponseWriter, r *http.Request) {
@@ -474,22 +444,6 @@ func statusJSONHandler(w http.ResponseWriter, r *http.Request) {
}
}
-func fuzzCountHandler(w http.ResponseWriter, r *http.Request) {
- c := syncer.FuzzCount{
- TotalBad: -1,
- TotalGrey: -1,
- ThisBad: -1,
- ThisGrey: -1,
- }
- if fuzzSyncer != nil {
- c = fuzzSyncer.LastCount(r.FormValue("category"))
- }
- if err := json.NewEncoder(w).Encode(c); err != nil {
- glog.Errorf("Failed to write or encode output: %s", err)
- return
- }
-}
-
type newBug struct {
Category string
PrettyCategory string
« no previous file with comments | « fuzzer/go/frontend/data/report_test.go ('k') | fuzzer/res/imp/fuzzer-count-sk.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698