Bug 1409468: Test for appleModelId telemetry environment property. r=mstange
authorStephen A Pohl <spohl.mozilla.bugs@gmail.com>
Wed, 18 Oct 2017 14:52:12 -0400
changeset 386910 8503e0f7970e6eeb0c419bcb2e3aa0e9b645dd5c
parent 386909 9b4ab3a0b00b188f5cd45c04fb14895f49883c5d
child 386911 f87472bf4efa9b34ec871a0858483b65ae19ac29
push id96331
push userspohl@mozilla.com
push dateWed, 18 Oct 2017 18:52:25 +0000
treeherdermozilla-inbound@8503e0f7970e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1409468
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1409468: Test for appleModelId telemetry environment property. r=mstange
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";