Chromium Code Reviews| Index: chrome/test/data/media/html/media_fps_perf.html |
| diff --git a/chrome/test/data/media/html/media_fps_perf.html b/chrome/test/data/media/html/media_fps_perf.html |
| index be3378ca4c5e05905176be01a4ced0e252de4c9e..e55d98aa4343e7852bb6a914c55ff68d942479d4 100644 |
| --- a/chrome/test/data/media/html/media_fps_perf.html |
| +++ b/chrome/test/data/media/html/media_fps_perf.html |
| @@ -1,9 +1,9 @@ |
| -<!-- Used by media_fps_perf to calculate <video> performance statistics. --> |
| +<!-- Used by media_stat_perf to calculate <video> performance statistics. --> |
| <!DOCTYPE html> |
| <html lang="en-US"> |
| <head> |
| - <title>FPS Perf Test</title> |
| + <title>CPU, Memory, and FPS Perf Test</title> |
| </head> |
| <body> |
| <div id="log"> |
| @@ -15,13 +15,8 @@ |
| <script type="text/javascript"> |
| var video = document.querySelector("video"); |
| - |
| - var decodedFrames = 0; |
| - var droppedFrames = 0; |
| - var decodedFPS = []; |
| - var droppedFPS = []; |
| - var startTime = 0; |
| - var intID = 0; // interval ID, used to end the window intervals. |
| + // Set to true to record FPS stats. |
|
DaleCurtis
2012/03/01 02:47:11
Is this necessary anymore?
shadi
2012/03/01 19:17:33
Done.
|
| + var statsEnabled = false; |
| function calculateStats() { |
| if (video.readyState <= HTMLMediaElement.HAVE_CURRENT_DATA || |
| @@ -56,7 +51,8 @@ |
| decodedFPS = []; |
| droppedFPS = []; |
| startTime = new Date().getTime(); |
| - intID = window.setInterval(calculateStats, 1000); |
| + if (statsEnabled) |
| + intID = window.setInterval(calculateStats, 1000); |
| }); |
| video.addEventListener("error", function() { endTest(false); }, false); |
| @@ -69,9 +65,8 @@ |
| window.domAutomationController.send(successFlag); |
| } |
| - function startTest(url) { |
| - // End any previously started tests. |
| - window.clearInterval(intID); |
| + function startTest(url, recordStats) { |
| + statsEnabled = recordStats; |
| video.src = url; |
| video.play(); |