diff --git a/toolkit/devtools/server/actors/framerate.js b/toolkit/devtools/server/actors/framerate.js index 37096e5bce4..ca3c928bb0a 100644 --- a/toolkit/devtools/server/actors/framerate.js +++ b/toolkit/devtools/server/actors/framerate.js @@ -54,18 +54,22 @@ let FramerateActor = exports.FramerateActor = protocol.ActorClass({ /** * Stops monitoring framerate, returning the recorded values. */ - stopRecording: method(function() { + stopRecording: method(function(beginAt = 0, endAt = Number.MAX_SAFE_INTEGER) { if (!this._recording) { return []; } this._recording = false; // We don't need to store the ticks array for future use, release it. - let ticks = this._ticks; + let ticks = this._ticks.filter(e => e >= beginAt && e <= endAt); this._ticks = null; return ticks; }, { - response: { timeline: RetVal("array:number") } + request: { + beginAt: Arg(0, "nullable:number"), + endAt: Arg(1, "nullable:number") + }, + response: { ticks: RetVal("array:number") } }), /** diff --git a/toolkit/devtools/server/tests/mochitest/chrome.ini b/toolkit/devtools/server/tests/mochitest/chrome.ini index db02177e8f3..f8bcb7d1c63 100644 --- a/toolkit/devtools/server/tests/mochitest/chrome.ini +++ b/toolkit/devtools/server/tests/mochitest/chrome.ini @@ -21,6 +21,7 @@ support-files = [test_device.html] [test_framerate_01.html] [test_framerate_02.html] +[test_framerate_03.html] [test_inspector-changeattrs.html] [test_inspector-changevalue.html] [test_inspector-hide.html] diff --git a/toolkit/devtools/server/tests/mochitest/test_framerate_03.html b/toolkit/devtools/server/tests/mochitest/test_framerate_03.html new file mode 100644 index 00000000000..affef174ec4 --- /dev/null +++ b/toolkit/devtools/server/tests/mochitest/test_framerate_03.html @@ -0,0 +1,81 @@ + + + + + + Framerate actor test + + + + +
+
+
+ +