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

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

Issue 931723002: Add perf tests for animations using different CSS value types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 6f1ab10110211c96aea340cfefb748e71314a0de..f159fd376f68e4b163549c1d62697714e2196ec1 100644
--- a/tools/perf/page_sets/tough_animation_cases/resources/perftesthelper.js
+++ b/tools/perf/page_sets/tough_animation_cases/resources/perftesthelper.js
@@ -23,10 +23,22 @@ window.PerfTestHelper.random = function() {
return (randomSeed & 0xfffffff) / 0x10000000;
};
+window.PerfTestHelper.getParameter = function(parameter) {
+ var match = new RegExp(parameter + '=([^&]*)').exec(window.location.search);
+ if (match) {
+ return match[1];
+ }
+ return null;
+}
+
window.PerfTestHelper.getN = function(defaultN) {
- var match = /N=(\d+)/.exec(window.location.search);
+ var match = PerfTestHelper.getParameter('N');
if (match) {
- return Number(match[1]);
+ var n = Number(match);
+ if (isNaN(n)) {
+ throw 'Invalid N value: ' + match;
+ }
+ return n;
}
if (typeof defaultN === 'undefined') {
throw 'Default N value required';

Powered by Google App Engine
This is Rietveld 408576698