зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1034651 - The framerate front's `plotFPS` should be a static method, r=pbrosset
This commit is contained in:
Родитель
4eed9cf8c9
Коммит
1d81b115df
|
@ -121,7 +121,8 @@ let FramerateFront = exports.FramerateFront = protocol.FrontClass(FramerateActor
|
|||
initialize: function(client, { framerateActor }) {
|
||||
protocol.Front.prototype.initialize.call(this, client, { actor: framerateActor });
|
||||
this.manage(this);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Plots the frames per second on a timeline.
|
||||
|
@ -137,7 +138,7 @@ let FramerateFront = exports.FramerateFront = protocol.FrontClass(FramerateActor
|
|||
* A collection of { delta, value } objects representing the
|
||||
* framerate value at every delta time.
|
||||
*/
|
||||
plotFPS: function(ticks, interval = 100, clamp = 60) {
|
||||
FramerateFront.plotFPS = function(ticks, interval = 100, clamp = 60) {
|
||||
let timeline = [];
|
||||
let totalTicks = ticks.length;
|
||||
|
||||
|
@ -170,9 +171,7 @@ let FramerateFront = exports.FramerateFront = protocol.FrontClass(FramerateActor
|
|||
}
|
||||
|
||||
return timeline;
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the top level browser window from a content window.
|
||||
|
|
|
@ -58,7 +58,7 @@ window.onload = function() {
|
|||
function onRecordingStopped(front, rawData) {
|
||||
ok(rawData, "There should be a recording available.");
|
||||
|
||||
var timeline = front.plotFPS(rawData);
|
||||
var timeline = FramerateFront.plotFPS(rawData);
|
||||
ok(timeline.length >= 2,
|
||||
"There should be at least one measurement available, with two entries.");
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ window.onload = function() {
|
|||
ok(rawData, "There should be a recording available.");
|
||||
is(rawData.length, 0, "...but it should be empty.");
|
||||
|
||||
var timeline = front.plotFPS(rawData);
|
||||
var timeline = FramerateFront.plotFPS(rawData);
|
||||
is(timeline.length, 2,
|
||||
"There should be one measurement plotted, with two entries.");
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче