Bug 1256290 - isGPUActive for the second graphics adapter doesn't work correctly, and this also means we should tighten up getGfxField a little bit r=gfritzsche
authorBenjamin Smedberg <benjamin@smedbergs.us>
Mon, 14 Mar 2016 09:30:29 -0400
changeset 288850 dce690007f02451d9e76b899e503b46c374f820e
parent 288849 1c4df5d337511a46feb0498772a09dcda2d4cb1d
child 288851 d85b18faba720414b82b3c8223386f438c67a81b
push id18197
push usercbook@mozilla.com
push dateWed, 16 Mar 2016 10:26:37 +0000
treeherderfx-team@4b3a31a77586 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche
bugs1256290
milestone48.0a1
Bug 1256290 - isGPUActive for the second graphics adapter doesn't work correctly, and this also means we should tighten up getGfxField a little bit r=gfritzsche MozReview-Commit-ID: 3384RChTh2A
toolkit/components/telemetry/TelemetryEnvironment.jsm
--- a/toolkit/components/telemetry/TelemetryEnvironment.jsm
+++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm
@@ -260,17 +260,17 @@ function getSysinfoProperty(aPropertyNam
  * @return The property value, if available, or aDefault.
  */
 function getGfxField(aPropertyName, aDefault) {
   let gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
 
   try {
     // Accessing the field may throw if |aPropertyName| does not exist.
     let gfxProp = gfxInfo[aPropertyName];
-    if (gfxProp !== "") {
+    if (gfxProp !== undefined && gfxProp !== "") {
       return gfxProp;
     }
   } catch (e) {}
 
   return aDefault;
 }
 
 /**
@@ -1311,17 +1311,17 @@ EnvironmentCache.prototype = {
     if (!hasGPU2) {
       this._log.trace("_getGFXData - Only one display adapter detected.");
       return gfxData;
     }
 
     this._log.trace("_getGFXData - Two display adapters detected.");
 
     gfxData.adapters.push(getGfxAdapter("2"));
-    gfxData.adapters[1].GPUActive = getGfxField("isGPU2Active ", null);
+    gfxData.adapters[1].GPUActive = getGfxField("isGPU2Active", null);
 
     return gfxData;
   },
 
   /**
    * Get the system data in object form.
    * @return Object containing the system data.
    */