| 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';
|
|
|