Bug 1161698 - Set the label as the filename when importing a performance recording r=jsantell
☠☠ backed out by b7cb976e52a6 ☠ ☠
authorWilhem Barbier <schtroumps31@gmail.com>
Thu, 13 Aug 2015 08:52:57 -0700
changeset 257596 692b2fea4ef6a0a91dfbabf2007dbf482f6b4f12
parent 257595 a8ef048628211fcbb7569dadbc688432d07fcce2
child 257597 b7cb976e52a6c729f53e65d0934dd05c8215bd94
push id14643
push userkwierso@gmail.com
push dateThu, 13 Aug 2015 15:53:33 +0000
treeherderfx-team@692b2fea4ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjsantell
bugs1161698
milestone43.0a1
Bug 1161698 - Set the label as the filename when importing a performance recording r=jsantell
browser/devtools/performance/test/browser_perf_recordings-io-01.js
toolkit/devtools/performance/io.js
--- a/browser/devtools/performance/test/browser_perf_recordings-io-01.js
+++ b/browser/devtools/performance/test/browser_perf_recordings-io-01.js
@@ -56,30 +56,30 @@ let test = Task.async(function*() {
 
   yield rerendered;
   ok(true, "The imported data was re-rendered.");
 
   // Verify imported recording.
 
   let importedData = PerformanceController.getCurrentRecording().getAllData();
 
-  is(importedData.label, originalData.label,
+  is(importedData.label, "tmpprofile",
+    "The label is identical to the filename without its extension.");
+  is(importedData.duration, originalData.duration,
     "The imported data is identical to the original data (1).");
-  is(importedData.duration, originalData.duration,
+  is(importedData.markers.toSource(), originalData.markers.toSource(),
     "The imported data is identical to the original data (2).");
-  is(importedData.markers.toSource(), originalData.markers.toSource(),
+  is(importedData.memory.toSource(), originalData.memory.toSource(),
     "The imported data is identical to the original data (3).");
-  is(importedData.memory.toSource(), originalData.memory.toSource(),
-    "The imported data is identical to the original data (4).");
   is(importedData.ticks.toSource(), originalData.ticks.toSource(),
-    "The imported data is identical to the original data (5).");
+    "The imported data is identical to the original data (4).");
   is(importedData.allocations.toSource(), originalData.allocations.toSource(),
+    "The imported data is identical to the original data (5).");
+  is(importedData.profile.toSource(), originalData.profile.toSource(),
     "The imported data is identical to the original data (6).");
-  is(importedData.profile.toSource(), originalData.profile.toSource(),
+  is(importedData.configuration.withTicks, originalData.configuration.withTicks,
     "The imported data is identical to the original data (7).");
-  is(importedData.configuration.withTicks, originalData.configuration.withTicks,
+  is(importedData.configuration.withMemory, originalData.configuration.withMemory,
     "The imported data is identical to the original data (8).");
-  is(importedData.configuration.withMemory, originalData.configuration.withMemory,
-    "The imported data is identical to the original data (9).");
 
   yield teardown(panel);
   finish();
 });
--- a/toolkit/devtools/performance/io.js
+++ b/toolkit/devtools/performance/io.js
@@ -99,16 +99,20 @@ function loadRecordingFromFile (file) {
       return;
     }
     if (recordingData.version === PERF_TOOL_SERIALIZER_LEGACY_VERSION) {
       recordingData = convertLegacyData(recordingData);
     }
     if (recordingData.profile.meta.version === 2) {
       RecordingUtils.deflateProfile(recordingData.profile);
     }
+    if(!recordingData.label) {
+      // set it to the filename without its extension
+      recordingData.label = file.leafName.replace(/\..+$/, '');
+    }
     deferred.resolve(recordingData);
   });
 
   return deferred.promise;
 }
 
 /**
  * Returns a boolean indicating whether or not the passed in `version`