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..992b1c78e91c9bcae1806fa451feeaf9fceb22f1 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,28 @@ 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() { |
+ console.time('measurementReady'); |
+ 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; |
+ console.timeStop('measurementReady'); |
+ }); |
+ }); |
+}; |
+ |
})(); |