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

Unified Diff: chrome/test/data/perf/frame_rate/head.js

Issue 8052016: Adding support for animated pages in the FrameRate tests (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/perf/frame_rate/head.js
===================================================================
--- chrome/test/data/perf/frame_rate/head.js (revision 102775)
+++ chrome/test/data/perf/frame_rate/head.js (working copy)
@@ -52,6 +52,7 @@
var __recording = [];
var __advance_gesture;
+var __animation = function() {return false;}
var __gestures = {
none: [
{"time_ms":1, "y":0},
@@ -161,6 +162,13 @@
],
};
+var __builtin_gestures = {
+ init: [
+ {"time_ms":1, "y":0},
+ {"time_ms":5, "y":10}
Justin Novosad 2011/09/27 19:56:13 factored this out of __gestures so that we don't h
+ ],
+};
+
function __init_stats() {
__t_last = undefined;
__t_est = undefined;
@@ -337,9 +345,10 @@
__raf(function() {
__raf_is_live = true;
if (__running) {
- // Only update the FPS if a gesture movement occurs. Otherwise, the frame
- // rate average becomes inaccurate after any pause.
- if (__advance_gesture())
+ // Only update the FPS if a gesture movement or animation occurs.
+ // Otherwise, the frame rate average becomes inaccurate after any pause.
+ var animated = __animation();
+ if (__advance_gesture() || animated)
__update_fps();
else
__t_last = new Date().getTime();
@@ -361,8 +370,13 @@
return;
// Attempt to create a gesture function from a string name.
if (typeof gesture_function == "string") {
- if (!__gestures[gesture_function])
- throw new Error("Unrecognized gesture name");
+ if (!__gestures[gesture_function]) {
+ if (!__builtin_gestures[gesture_function])
+ throw new Error("Unrecognized gesture name");
+ else
+ gesture_function = __create_repeating_gesture_function(
+ __builtin_gestures[gesture_function]);
+ }
else
gesture_function = __create_repeating_gesture_function(
__gestures[gesture_function]);
@@ -392,8 +406,8 @@
__queued_gesture_functions.push(gesture);
}
__running_all = true;
- // Run steady gesture once to cache the webpage layout for subsequent tests.
- __start("steady");
+ // Run init gesture once to cache the webpage layout for subsequent tests.
+ __start("init");
}
function __stop() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698