Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: chrome/test/data/media/html/media_fps_perf.html

Issue 9464004: Fix CPU and memory perf PyAuto test running on av_perf. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rename test files. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/media/html/media_stat_perf.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
deleted file mode 100644
index be3378ca4c5e05905176be01a4ced0e252de4c9e..0000000000000000000000000000000000000000
--- a/chrome/test/data/media/html/media_fps_perf.html
+++ /dev/null
@@ -1,80 +0,0 @@
-<!-- Used by media_fps_perf to calculate <video> performance statistics. -->
-
-<!DOCTYPE html>
-<html lang="en-US">
- <head>
- <title>FPS Perf Test</title>
- </head>
- <body>
- <div id="log">
- Decoded frames: 0 Avg: 0<br>
- Dropped frames: 0 Avg: 0<br>
- </div>
- <video preload controls></video>
- </body>
-
- <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.
-
- function calculateStats() {
- if (video.readyState <= HTMLMediaElement.HAVE_CURRENT_DATA ||
- video.paused || video.ended)
- return;
-
- currentTime = new Date().getTime();
- deltaTime = (currentTime - startTime) / 1000;
- startTime = currentTime;
-
- // Calculate decoded frames per sec.
- var fps = (video.webkitDecodedFrameCount - decodedFrames) / deltaTime;
- decodedFrames = video.webkitDecodedFrameCount;
- decodedFPS.push(fps);
-
- // Calculate dropped frames per sec.
- fps = (video.webkitDroppedFrameCount - droppedFrames) / deltaTime;
- droppedFrames = video.webkitDroppedFrameCount;
- droppedFPS.push(fps);
-
- var d = document.getElementById("log");
- d.innerHTML =
- "Decoded frames: " + decodedFrames +
- " Avg: " + decodedFPS + " fps.<br>" +
- "Dropped frames: " + droppedFrames +
- " Avg: " + droppedFPS + " fps.<br>";
- }
-
- video.addEventListener("playing", function(event) {
- decodedFrames = 0;
- droppedFrames = 0;
- decodedFPS = [];
- droppedFPS = [];
- startTime = new Date().getTime();
- intID = window.setInterval(calculateStats, 1000);
- });
-
- video.addEventListener("error", function() { endTest(false); }, false);
- video.addEventListener("ended", function() { endTest(true); }, false);
-
- function endTest(successFlag) {
- window.clearInterval(intID);
- // Notify PyAuto that we've completed the test run.
- if (window.domAutomationController)
- window.domAutomationController.send(successFlag);
- }
-
- function startTest(url) {
- // End any previously started tests.
- window.clearInterval(intID);
-
- video.src = url;
- video.play();
- }
- </script>
-</html>
« no previous file with comments | « no previous file | chrome/test/data/media/html/media_stat_perf.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698