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

Unified Diff: chrome/test/data/perf/frame_rate/head_animation.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, 2 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 | « chrome/test/data/perf/frame_rate/head.js ('k') | chrome/test/perf/frame_rate/frame_rate_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/perf/frame_rate/head_animation.js
===================================================================
--- chrome/test/data/perf/frame_rate/head_animation.js (revision 0)
+++ chrome/test/data/perf/frame_rate/head_animation.js (revision 0)
@@ -0,0 +1,53 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview FrameRateTest harness variant for benchmarking
+ * pages that contain content that is animated (e.g. canvas2d, webGL)
+ *
+ * How to instrument an animated web page for use with the frame rate test
+ * harness:
+ * 1. Include head.js followed by head_animation.js in the head of the test
+ * page.
+ * 2. If the animation loop does not already use requestAnimationFrame, convert
+ * it. For maximum portability and functionality, use the __raf function
+ * defined in head.js.
+ * 3. Add a call to __animation_hook() at the end of the animation loop
+ */
+
+// default gestures for animated content
+__gestures = {
+ none: __gesture_library["stationary"]
+};
+
+// Don't start benchmarking animated pages right away.
+// wait for initialization to complete.
+__initialized = false;
+
+// Indicate to the test harness that the test page has its own
+// animation loop.
+__animation = true;
+
+// Draw this many frames before starting test.
+// This is a delay to allow caches and other resources to spin-up to reach a
+// steady running state before benchmarking begins.
+var __warmup_frames = 10;
+
+function __animation_hook() {
+ if (__warmup_frames > 0){
+ __warmup_frames--;
+ return;
+ }
+
+ // Signal that page is ready to begin benchamarking
+ __initialized = true;
+
+ if (__running) {
+ __advance_gesture();
+ __update_fps();
+ }
+}
+
+
+
« no previous file with comments | « chrome/test/data/perf/frame_rate/head.js ('k') | chrome/test/perf/frame_rate/frame_rate_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698