Bug 1167298 - Remove the ordinal property on categories, r=jsantell, a=sledru
authorVictor Porof <vporof@mozilla.com>
Fri, 22 May 2015 16:28:57 -0400
changeset 274871 1606aab5216f89bbc29f96da0869d9d93541b1da
parent 274870 980d943b262c84ba3fa0e1a15428b7f88d93e2ae
child 274872 3ef44497abecd4d008493b67294b2f37086a000f
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
bugs1167298
milestone40.0a2
Bug 1167298 - Remove the ordinal property on categories, r=jsantell, a=sledru
browser/devtools/performance/modules/global.js
browser/devtools/performance/test/browser_profiler_categories.js
--- a/browser/devtools/performance/modules/global.js
+++ b/browser/devtools/performance/modules/global.js
@@ -28,52 +28,44 @@ const Prefs = new ViewHelpers.Prefs("dev
   monitorChanges: true
 });
 
 /**
  * Details about each profile entry cateogry.
  * @see CATEGORY_MAPPINGS.
  */
 const CATEGORIES = [{
-  ordinal: 7,
   color: "#5e88b0",
   abbrev: "other",
   label: L10N.getStr("category.other")
 }, {
-  ordinal: 4,
   color: "#46afe3",
   abbrev: "css",
   label: L10N.getStr("category.css")
 }, {
-  ordinal: 1,
   color: "#d96629",
   abbrev: "js",
   label: L10N.getStr("category.js")
 }, {
-  ordinal: 2,
   color: "#eb5368",
   abbrev: "gc",
   label: L10N.getStr("category.gc")
 }, {
-  ordinal: 0,
   color: "#df80ff",
   abbrev: "network",
   label: L10N.getStr("category.network")
 }, {
-  ordinal: 5,
   color: "#70bf53",
   abbrev: "graphics",
   label: L10N.getStr("category.graphics")
 }, {
-  ordinal: 6,
   color: "#8fa1b2",
   abbrev: "storage",
   label: L10N.getStr("category.storage")
 }, {
-  ordinal: 3,
   color: "#d99b28",
   abbrev: "events",
   label: L10N.getStr("category.events")
 }];
 
 /**
  * Mapping from category bitmasks in the profiler data to additional details.
  * To be kept in sync with the js::ProfileEntry::Category in ProfilingStack.h
--- a/browser/devtools/performance/test/browser_profiler_categories.js
+++ b/browser/devtools/performance/test/browser_profiler_categories.js
@@ -10,25 +10,16 @@ function test() {
   let l10n = global.L10N;
   let categories = global.CATEGORIES;
   let mappings = global.CATEGORY_MAPPINGS;
   let count = categories.length;
 
   ok(count,
     "Should have a non-empty list of categories available.");
 
-  ok(categories.find(e => e.ordinal == count - 1),
-    "The maximum category ordinal is the equal to the categories count.");
-
-  is(categories.reduce((a, b) => a + b.ordinal, 0), count * (count - 1) / 2,
-    "There is an ordinal for every category in the list.");
-
-  is(categories.filter((e, i, self) => self.find(e => e.ordinal == i)).length, count,
-    "All categories have unique ordinals.");
-
   ok(!categories.some(e => !e.color),
     "All categories have an associated color.");
 
   ok(!categories.some(e => !e.label),
     "All categories have an associated label.");
 
   ok(!categories.some(e => e.label != l10n.getStr("category." + e.abbrev)),
     "All categories have a correctly localized label.");