Fix travis-ci.appspost.com, report failed builds as such
am: f07c859525

Change-Id: Id206c3eb76e782379f5ac7aec06e622bd43e7223
diff --git a/infra/perfetto-ci.appspot.com/static/script.js b/infra/perfetto-ci.appspot.com/static/script.js
index 56003c0..041f94e 100644
--- a/infra/perfetto-ci.appspot.com/static/script.js
+++ b/infra/perfetto-ci.appspot.com/static/script.js
@@ -46,12 +46,15 @@
     let link = document.createElement('a');
     link.href = 'https://travis-ci.org/' + REPO + '/jobs/' + jobId;
     link.title = resp.state + ' [' + jobName + ']';
-    link.classList.add(resp.state);
-    if (resp.state == 'finished')
+    let jobState = resp.state;
+    if (resp.state == 'finished' && resp.result !== 0)
+      jobState = 'errored';
+    link.classList.add(jobState);
+    if (jobState == 'finished')
       link.innerHTML = '<i class="material-icons">check_circle</i>';
-    else if (resp.state == 'created')
+    else if (jobState == 'created')
       link.innerHTML = '<i class="material-icons">autorenew</i>';
-    else if (resp.state == 'errored' || resp.state == 'cancelled')
+    else if (jobState == 'errored' || jobState == 'cancelled')
       link.innerHTML = '<i class="material-icons">bug_report</i>';
     else
       link.innerHTML = '<i class="material-icons">hourglass_full</i>';