Bug 1409468 - Test for appleModelId telemetry environment property. r=mstange, a=ritu
authorStephen A Pohl <spohl.mozilla.bugs@gmail.com>
Wed, 18 Oct 2017 14:52:12 -0400
changeset 432651 428c84cbc00a0b2fe10f10886c83aeb3d1baa044
parent 432650 13789fec0a4be336215d1567972160e63217396e
child 432652 6a12f053f1d0233d00362575aca2f6b9d1e28438
push id8020
push userryanvm@gmail.com
push dateFri, 20 Oct 2017 21:59:23 +0000
treeherdermozilla-beta@add4a60517c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, ritu
bugs1409468
milestone57.0
Bug 1409468 - Test for appleModelId telemetry environment property. r=mstange, a=ritu
toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
@@ -507,17 +507,18 @@ function checkGfxAdapter(data) {
       // Since we have a non-null value, check if it has the correct type.
       Assert.equal(typeof data[f], EXPECTED_ADAPTER_FIELDS_TYPES[f],
                    f + " must have the correct type.");
     }
   }
 }
 
 function checkSystemSection(data) {
-  const EXPECTED_FIELDS = [ "memoryMB", "cpu", "os", "hdd", "gfx" ];
+  const EXPECTED_FIELDS = [ "memoryMB", "cpu", "os", "hdd", "gfx",
+                            "appleModelId" ];
   const EXPECTED_HDD_FIELDS = [ "profile", "binary", "system" ];
 
   Assert.ok("system" in data, "There must be a system section in Environment.");
 
   // Make sure we have all the top level sections and fields.
   for (let f of EXPECTED_FIELDS) {
     Assert.ok(f in data.system, f + " must be available.");
   }
@@ -655,16 +656,22 @@ function checkSystemSection(data) {
     }
 
     let features = gfxInfo.getFeatures();
     Assert.equal(features.compositor, gfxData.features.compositor);
     Assert.equal(features.gpuProcess.status, gfxData.features.gpuProcess.status);
     Assert.equal(features.opengl, gfxData.features.opengl);
     Assert.equal(features.webgl, gfxData.features.webgl);
   } catch (e) {}
+
+  if (gIsMac) {
+    Assert.ok(checkString(data.system.appleModelId));
+  } else {
+    Assert.ok(checkNullOrString(data.system.appleModelId));
+  }
 }
 
 function checkActiveAddon(data, partialRecord) {
   let signedState = mozinfo.addon_signing ? "number" : "undefined";
   // system add-ons have an undefined signState
   if (data.isSystem)
     signedState = "undefined";