зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1161698 - Set the label as the filename when importing a performance recording r=jsantell
--HG-- extra : rebase_source : d91e37b61d7ee21039dc74bf3dd2491478d938aa
This commit is contained in:
Родитель
14f5fec011
Коммит
f65583d27c
|
@ -61,24 +61,24 @@ let test = Task.async(function*() {
|
|||
|
||||
let importedData = PerformanceController.getCurrentRecording().getAllData();
|
||||
|
||||
is(importedData.label, originalData.label,
|
||||
"The imported data is identical to the original data (1).");
|
||||
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 (2).");
|
||||
"The imported data is identical to the original data (1).");
|
||||
is(importedData.markers.toSource(), originalData.markers.toSource(),
|
||||
"The imported data is identical to the original data (3).");
|
||||
"The imported data is identical to the original data (2).");
|
||||
is(importedData.memory.toSource(), originalData.memory.toSource(),
|
||||
"The imported data is identical to the original data (4).");
|
||||
"The imported data is identical to the original data (3).");
|
||||
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 (6).");
|
||||
"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 (7).");
|
||||
"The imported data is identical to the original data (6).");
|
||||
is(importedData.configuration.withTicks, originalData.configuration.withTicks,
|
||||
"The imported data is identical to the original data (8).");
|
||||
"The imported data is identical to the original data (7).");
|
||||
is(importedData.configuration.withMemory, originalData.configuration.withMemory,
|
||||
"The imported data is identical to the original data (9).");
|
||||
"The imported data is identical to the original data (8).");
|
||||
|
||||
yield teardown(panel);
|
||||
finish();
|
||||
|
|
|
@ -104,6 +104,10 @@ function loadRecordingFromFile (file) {
|
|||
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);
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче