Bug 1152631 - We no longer display category data for platform data in call tree, r=jsantell, a=sledru
authorVictor Porof <vporof@mozilla.com>
Thu, 14 May 2015 19:01:02 -0400
changeset 274830 30677c6282dd0c5cbec471cfab35cf6034a07358
parent 274829 2346b4e5b5bba5cf596fa303254a628967d56e1d
child 274831 b6c6ab339e672eb3a448dc1e5840fb422ede556a
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjsantell, sledru
bugs1152631
milestone40.0a2
Bug 1152631 - We no longer display category data for platform data in call tree, r=jsantell, a=sledru
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]"
 });