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

Unified Diff: tools/perf/page_sets/tough_animation_cases/resources/perftesthelper.js

Issue 399393002: Add CSS Transitions performance tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Appease linter Created 6 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
Index: tools/perf/page_sets/tough_animation_cases/resources/perftesthelper.js
diff --git a/tools/perf/page_sets/tough_animation_cases/resources/perftesthelper.js b/tools/perf/page_sets/tough_animation_cases/resources/perftesthelper.js
index de5c254c63547a9be125efad629c64dff398f35e..6f1ab10110211c96aea340cfefb748e71314a0de 100644
--- a/tools/perf/page_sets/tough_animation_cases/resources/perftesthelper.js
+++ b/tools/perf/page_sets/tough_animation_cases/resources/perftesthelper.js
@@ -23,4 +23,26 @@ window.PerfTestHelper.random = function() {
return (randomSeed & 0xfffffff) / 0x10000000;
};
+window.PerfTestHelper.getN = function(defaultN) {
+ var match = /N=(\d+)/.exec(window.location.search);
+ if (match) {
+ return Number(match[1]);
+ }
+ if (typeof defaultN === 'undefined') {
+ throw 'Default N value required';
+ }
+ return defaultN;
+};
+
+window.PerfTestHelper.signalReady = function() {
+ requestAnimationFrame(function() {
+ // FIXME: We must wait at least two frames before
+ // measuring to allow the GC to clean up the
+ // previous test.
+ requestAnimationFrame(function() {
+ window.measurementReady = true;
+ });
+ });
+};
+
})();

Powered by Google App Engine
This is Rietveld 408576698