Bug 1466139 - set animation panel ID depending on devtools.new-animationinspector.enabled. r?yulia,miker draft
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 18 Jun 2018 18:40:22 +0300
changeset 808161 b01471b21b88b4ba1a5bd0a07e3a9b446bb24116
parent 808055 c40cc0a89bc70511751d17ed0cdd569a74abac88
push id113295
push userbmo:aryx.bugmail@gmx-topmail.de
push dateMon, 18 Jun 2018 15:41:14 +0000
reviewersyulia, miker
bugs1466139
milestone62.0a1
Bug 1466139 - set animation panel ID depending on devtools.new-animationinspector.enabled. r?yulia,miker MozReview-Commit-ID: H093tRApoPq
devtools/client/shared/test/browser_telemetry_sidebar.js
--- a/devtools/client/shared/test/browser_telemetry_sidebar.js
+++ b/devtools/client/shared/test/browser_telemetry_sidebar.js
@@ -6,25 +6,43 @@
 
 const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_sidebar.js</p>";
 const OPTOUT = Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTOUT;
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
+var animationPanelId;
+if (Services.prefs.getBoolPref("devtools.new-animationinspector.enabled")) {
+  animationPanelId = "newanimationinspector";
+} else {
+  animationPanelId = "animationinspector";
+}
+
 const DATA = [
   {
     timestamp: null,
     category: "devtools.main",
     method: "sidepanel_changed",
     object: "inspector",
     value: null,
     extra: {
       oldpanel: "computedview",
+      newpanel: animationPanelId
+    }
+  },
+  {
+    timestamp: null,
+    category: "devtools.main",
+    method: "sidepanel_changed",
+    object: "inspector",
+    value: null,
+    extra: {
+      oldpanel: animationPanelId,
       newpanel: "fontinspector"
     }
   },
   {
     timestamp: null,
     category: "devtools.main",
     method: "sidepanel_changed",
     object: "inspector",
@@ -48,16 +66,27 @@ const DATA = [
   {
     timestamp: null,
     category: "devtools.main",
     method: "sidepanel_changed",
     object: "inspector",
     value: null,
     extra: {
       oldpanel: "computedview",
+      newpanel: animationPanelId
+    }
+  },
+  {
+    timestamp: null,
+    category: "devtools.main",
+    method: "sidepanel_changed",
+    object: "inspector",
+    value: null,
+    extra: {
+      oldpanel: animationPanelId,
       newpanel: "fontinspector"
     }
   },
   {
     timestamp: null,
     category: "devtools.main",
     method: "sidepanel_changed",
     object: "inspector",
@@ -103,17 +132,17 @@ add_task(async function() {
   gBrowser.removeCurrentTab();
 });
 
 function testSidebar(toolbox) {
   info("Testing sidebar");
 
   const inspector = toolbox.getCurrentPanel();
   let sidebarTools = ["computedview", "layoutview", "fontinspector",
-                      "animationinspector"];
+                      animationPanelId];
 
   // Concatenate the array with itself so that we can open each tool twice.
   sidebarTools = [...sidebarTools, ...sidebarTools];
 
   return new Promise(resolve => {
     // See TOOL_DELAY for why we need setTimeout here
     setTimeout(function selectSidebarTab() {
       const tool = sidebarTools.pop();