Bug 1302701 - Follow up: Align logic with Firefox. r=aceman a=jorgk
authorJorg K <jorgk@jorgk.com>
Wed, 14 Sep 2016 21:43:31 +0200
changeset 27474 b684b3927470f153c95a60c68cec095975aacd48
parent 27473 605c8d4bcecc9b5ac12a3ff106c58a627c501f50
child 27475 a8ddbce782b02d216bc23eaa21c67c22dab0e065
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman, jorgk
bugs1302701
Bug 1302701 - Follow up: Align logic with Firefox. r=aceman a=jorgk
mail/components/about-support/content/gfx.js
--- a/mail/components/about-support/content/gfx.js
+++ b/mail/components/about-support/content/gfx.js
@@ -205,57 +205,59 @@ function populateGraphicsSection() {
     for (var property in info) {
       pushLiteralInfoRow(trGraphicsProperties, property, info[property]);
     }
     appendChildren(graphics_info_properties, trGraphicsProperties);
 
     // display any failures that have occurred
     let graphics_failures_tbody = document.getElementById("graphics-failures-tbody");
 
-    let data = {failures: [], indices: []};
+    let data = {};
 
     let failureCount = {};
     let failureIndices = {};
 
     let failures = gfxInfo.getFailures(failureCount, failureIndices);
     if (failures.length) {
       data.failures = failures;
       if (failureIndices.value.length == failures.length) {
         data.indices = failureIndices.value;
       }
     }
-    let trGraphicsFailures;
-    // If indices is there, it should be the same length as failures,
-    // (see Troubleshoot.jsm) but we check anyway:
-    if ("indices" in data && data.failures.length == data.indices.length) {
-      let combined = [];
-      for (let i = 0; i < data.failures.length; i++) {
-        let assembled = assembleFromGraphicsFailure(i, data);
-        combined.push(assembled);
+    if ("failures" in data) {
+      let trGraphicsFailures;
+      // If indices is there, it should be the same length as failures,
+      // (see Troubleshoot.jsm) but we check anyway:
+      if ("indices" in data && data.failures.length == data.indices.length) {
+        let combined = [];
+        for (let i = 0; i < data.failures.length; i++) {
+          let assembled = assembleFromGraphicsFailure(i, data);
+          combined.push(assembled);
+        }
+        combined.sort(function(a,b) {
+            if (a.index < b.index) return -1;
+            if (a.index > b.index) return 1;
+            return 0;});
+        trGraphicsFailures = combined.map(function(val) {
+                                 return createParentElement("tr", [
+                                     createElement("th", val.header, {class: "column"}),
+                                     createElement("td", val.message),
+                                 ]);
+                             });
+      } else {
+        trGraphicsFailures = createParentElement("tr", [
+                                 createElement("th", "LogFailure", {class: "column"}),
+                                 createParentElement("td", data.failures.map(val =>
+                                     createElement("p", val)
+                             ))]);
       }
-      combined.sort(function(a,b) {
-          if (a.index < b.index) return -1;
-          if (a.index > b.index) return 1;
-          return 0;});
-      trGraphicsFailures = combined.map(function(val) {
-                               return createParentElement("tr", [
-                                   createElement("th", val.header, {class: "column"}),
-                                   createElement("td", val.message),
-                               ]);
-                           });
-    } else {
-      trGraphicsFailures = createParentElement("tr", [
-                               createElement("th", "LogFailure", {class: "column"}),
-                               createParentElement("td", data.failures.map(val =>
-                                   createElement("p", val)
-                           ))]);
+
+      appendChildren(graphics_failures_tbody, trGraphicsFailures);
     }
-
-    appendChildren(graphics_failures_tbody, trGraphicsFailures);
-  } // end if (gfxInfo)
+  }
 
   let windows = Services.ww.getWindowEnumerator();
   let acceleratedWindows = 0;
   let totalWindows = 0;
   let mgrType;
   while (windows.hasMoreElements()) {
     totalWindows++;