Bug 1258416 - Update test_marker-utils.js to register a prefs observer, r=orange
authorVictor Porof <vporof@mozilla.com>
Tue, 22 Mar 2016 11:41:27 +0100
changeset 289880 5e3ef0ac174e1053b2854e0d51ae6ac4a7cf88b1
parent 289879 0c6bacea23968480ebb71482f6bedf54aaf23d55
child 289881 792ec1f6bbbf0ef816f0d6d395557928027f82a2
push id74027
push userkwierso@gmail.com
push dateTue, 22 Mar 2016 23:57:42 +0000
treeherdermozilla-inbound@eb528d042c85 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersorange
bugs1258416
milestone48.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 1258416 - Update test_marker-utils.js to register a prefs observer, r=orange
devtools/client/performance/test/unit/test_marker-utils.js
--- a/devtools/client/performance/test/unit/test_marker-utils.js
+++ b/devtools/client/performance/test/unit/test_marker-utils.js
@@ -6,18 +6,21 @@
  */
 
 function run_test() {
   run_next_test();
 }
 
 add_task(function () {
   let { TIMELINE_BLUEPRINT } = require("devtools/client/performance/modules/markers");
+  let { PREFS } = require("devtools/client/performance/modules/global");
   let Utils = require("devtools/client/performance/modules/logic/marker-utils");
 
+  PREFS.registerObserver();
+
   Services.prefs.setBoolPref(PLATFORM_DATA_PREF, false);
 
   equal(Utils.getMarkerLabel({ name: "DOMEvent" }), "DOM Event",
     "getMarkerLabel() returns a simple label");
   equal(Utils.getMarkerLabel({ name: "Javascript", causeName: "setTimeout handler" }), "setTimeout",
     "getMarkerLabel() returns a label defined via function");
   equal(Utils.getMarkerLabel({ name: "GarbageCollection", causeName: "ALLOC_TRIGGER" }), "Incremental GC",
     "getMarkerLabel() returns a label for a function that is generalizable");
@@ -88,9 +91,11 @@ add_task(function () {
       label: "MyCustom"
     }
   };
 
   equal(Utils.getBlueprintFor({ name: "Reflow" }).label, "Layout",
     "Utils.getBlueprintFor() should return marker def for passed in marker.");
   equal(Utils.getBlueprintFor({ name: "Not sure!" }).label(), "Unknown",
     "Utils.getBlueprintFor() should return a default marker def if the marker is undefined.");
+
+  PREFS.unregisterObserver();
 });