Bug 1152631 - We no longer display category data for platform data in call tree, r=jsantell
authorVictor Porof <vporof@mozilla.com>
Thu, 14 May 2015 19:01:02 -0400
changeset 243966 df12d9cbd92150e7885ec84d98a95b84d215bf33
parent 243965 409ba1c33f1ebee50f1bc2c7f587c4160becda90
child 243967 2782e88a35625206ba8138f61d96e412b1692f36
push id28761
push usercbook@mozilla.com
push dateFri, 15 May 2015 14:50:10 +0000
treeherdermozilla-central@c0e709a5baca [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjsantell
bugs1152631
milestone41.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 1152631 - We no longer display category data for platform data in call tree, r=jsantell
browser/devtools/performance/test/browser.ini
browser/devtools/performance/test/browser_perf-categories-js-calltree.js
browser/devtools/performance/views/details-js-call-tree.js
--- a/browser/devtools/performance/test/browser.ini
+++ b/browser/devtools/performance/test/browser.ini
@@ -10,16 +10,17 @@ support-files =
 # Commented out tests are profiler tests
 # that need to be moved over to performance tool
 
 [browser_perf-aaa-run-first-leaktest.js]
 [browser_markers-gc.js]
 [browser_markers-parse-html.js]
 [browser_markers-timestamp.js]
 [browser_perf-allocations-to-samples.js]
+[browser_perf-categories-js-calltree.js]
 [browser_perf-compatibility-01.js]
 [browser_perf-compatibility-02.js]
 [browser_perf-compatibility-03.js]
 [browser_perf-compatibility-04.js]
 [browser_perf-compatibility-05.js]
 [browser_perf-compatibility-06.js]
 [browser_perf-compatibility-07.js]
 [browser_perf-clear-01.js]
new file mode 100644
--- /dev/null
+++ b/browser/devtools/performance/test/browser_perf-categories-js-calltree.js
@@ -0,0 +1,38 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Tests that the categories are shown in the js call tree when platform data
+ * is enabled.
+ */
+function spawnTest () {
+  let { panel } = yield initPerformance(SIMPLE_URL);
+  let { EVENTS, $, DetailsView, JsCallTreeView } = panel.panelWin;
+
+  // Enable platform data to show the categories.
+  Services.prefs.setBoolPref(PLATFORM_DATA_PREF, true);
+
+  yield startRecording(panel);
+  yield busyWait(100);
+
+  let rendered = once(JsCallTreeView, EVENTS.JS_CALL_TREE_RENDERED);
+  yield stopRecording(panel);
+  yield DetailsView.selectView("js-calltree");
+  yield rendered;
+
+  is($(".call-tree-cells-container").hasAttribute("categories-hidden"), false,
+    "The call tree cells container should show the categories now.");
+  ok($(".call-tree-category[value=Gecko]"),
+    "A category node with the label `Gecko` is displayed in the tree.");
+
+  // Disable platform data to show the categories.
+  Services.prefs.setBoolPref(PLATFORM_DATA_PREF, false);
+
+  is($(".call-tree-cells-container").getAttribute("categories-hidden"), "",
+    "The call tree cells container should hide the categories now.");
+  ok(!$(".call-tree-category[value=Gecko]"),
+    "A category node with the label `Gecko` doesn't exist in the tree anymore.");
+
+  yield teardown(panel);
+  finish();
+}
--- a/browser/devtools/performance/views/details-js-call-tree.js
+++ b/browser/devtools/performance/views/details-js-call-tree.js
@@ -118,17 +118,17 @@ let JsCallTreeView = Heritage.extend(Det
     // tests and JITOptimizationsView.
     root.on("focus", (_, node) => this.emit("focus", node));
 
     // Clear out other call trees.
     this.container.innerHTML = "";
     root.attachTo(this.container);
 
     // When platform data isn't shown, hide the cateogry labels, since they're
-    // only available for C++ frames.
-    root.toggleCategories(options.contentOnly);
+    // only available for C++ frames. Pass *false* to make them invisible.
+    root.toggleCategories(!options.contentOnly);
 
     // Return the CallView for tests
     return root;
   },
 
   toString: () => "[object JsCallTreeView]"
 });