Bug 1596761 - Only run the allocations test when it is supported; r=canaltinova
authorGreg Tatum <gtatum@mozilla.com>
Fri, 15 Nov 2019 19:47:29 +0000
changeset 502292 9b475c5496bd4876466128b622788e72e801f402
parent 502291 51ff4505135988dd5d10036c21d2c815bff30830
child 502293 fd1fe84753a1ad035a94cc98172f712b74196673
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscanaltinova
bugs1596761
milestone72.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 1596761 - Only run the allocations test when it is supported; r=canaltinova Differential Revision: https://phabricator.services.mozilla.com/D53219
tools/profiler/tests/xpcshell/test_feature_nativeallocations.js
--- a/tools/profiler/tests/xpcshell/test_feature_nativeallocations.js
+++ b/tools/profiler/tests/xpcshell/test_feature_nativeallocations.js
@@ -1,16 +1,26 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 add_task(async () => {
   if (!AppConstants.MOZ_GECKO_PROFILER) {
     return;
   }
+
+  if (!Services.profiler.GetFeatures().includes("nativeallocations")) {
+    Assert.ok(
+      true,
+      "Native allocations are not supported by this build, " +
+        "skip run the rest of the test."
+    );
+    return;
+  }
+
   Assert.ok(
     !Services.profiler.IsActive(),
     "The profiler is not currently active"
   );
 
   info(
     "Test that the profiler can install memory hooks and collect native allocation " +
       "information in the marker payloads."