| OLD | NEW |
| 1 // There are tests for computeStatistics() located in LayoutTests/fast/harness/p
erftests | 1 // There are tests for computeStatistics() located in LayoutTests/fast/harness/p
erftests |
| 2 | 2 |
| 3 if (window.testRunner) { | 3 if (window.testRunner) { |
| 4 testRunner.waitUntilDone(); | 4 testRunner.waitUntilDone(); |
| 5 testRunner.dumpAsText(); | 5 testRunner.dumpAsText(); |
| 6 } | 6 } |
| 7 | 7 |
| 8 (function () { | 8 (function () { |
| 9 var logLines = null; | 9 var logLines = null; |
| 10 var completedIterations = -1; | 10 var completedIterations = -1; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 else if (doc.documentElement) | 143 else if (doc.documentElement) |
| 144 doc.documentElement.offsetHeight; | 144 doc.documentElement.offsetHeight; |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 function start(test, scheduler, runner) { | 147 function start(test, scheduler, runner) { |
| 148 if (!test) { | 148 if (!test) { |
| 149 PerfTestRunner.logFatalError("Got a bad test object."); | 149 PerfTestRunner.logFatalError("Got a bad test object."); |
| 150 return; | 150 return; |
| 151 } | 151 } |
| 152 currentTest = test; | 152 currentTest = test; |
| 153 |
| 154 if (test.tracingCategories && !test.traceEventsToMeasure) { |
| 155 PerfTestRunner.logFatalError("test's tracingCategories is " + |
| 156 "specified but test's traceEventsToMeasure is empty"); |
| 157 return; |
| 158 } |
| 159 |
| 160 if (test.traceEventsToMeasure && !test.tracingCategories) { |
| 161 PerfTestRunner.logFatalError("test's traceEventsToMeasure is " + |
| 162 "specified but test's tracingCategories is empty"); |
| 163 return; |
| 164 } |
| 153 iterationCount = test.iterationCount || (window.testRunner ? 5 : 20); | 165 iterationCount = test.iterationCount || (window.testRunner ? 5 : 20); |
| 154 if (test.warmUpCount && test.warmUpCount > 0) | 166 if (test.warmUpCount && test.warmUpCount > 0) |
| 155 completedIterations = -test.warmUpCount; | 167 completedIterations = -test.warmUpCount; |
| 156 logLines = PerfTestRunner.bufferedLog || window.testRunner ? [] : null; | 168 logLines = PerfTestRunner.bufferedLog || window.testRunner ? [] : null; |
| 157 PerfTestRunner.log("Running " + iterationCount + " times"); | 169 PerfTestRunner.log("Running " + iterationCount + " times"); |
| 158 if (test.doNotIgnoreInitialRun) | 170 if (test.doNotIgnoreInitialRun) |
| 159 completedIterations++; | 171 completedIterations++; |
| 160 | 172 |
| 161 if (runner && test.tracingCategories && window.testRunner && | 173 if (runner && test.tracingCategories && window.testRunner && |
| 162 window.testRunner.supportTracing) { | 174 window.testRunner.supportTracing) { |
| 163 window.testRunner.traceEventsToMeasure = test.traceEventsToMeasure; | 175 window.testRunner.traceEventsToMeasure = test.traceEventsToMeasure; |
| 164 window.testRunner.startTracing(test.tracingCategories, function() { | 176 window.testRunner.startTracing(test.tracingCategories, function() { |
| 165 scheduleNextRun(scheduler, runner); | 177 scheduleNextRun(scheduler, runner); |
| 166 }); | 178 }); |
| 167 } else if (runner) { | 179 } else if (runner) { |
| 180 if (test.tracingCategories && !(window.testRuner && |
| 181 window.testRunner.supportTracing)) { |
| 182 PerfTestRunner.log("Tracing based metrics are specified but " + |
| 183 "tracing is not supported on this platform. To get those " + |
| 184 "metrics from this test, you can run the test using " + |
| 185 "tools/perf/run_benchmarks script."); |
| 186 } |
| 168 scheduleNextRun(scheduler, runner); | 187 scheduleNextRun(scheduler, runner); |
| 169 } | 188 } |
| 170 } | 189 } |
| 171 | 190 |
| 172 function scheduleNextRun(scheduler, runner) { | 191 function scheduleNextRun(scheduler, runner) { |
| 173 scheduler(function () { | 192 scheduler(function () { |
| 174 // This will be used by tools/perf/benchmarks/blink_perf.py to find | 193 // This will be used by tools/perf/benchmarks/blink_perf.py to find |
| 175 // traces during the measured runs. | 194 // traces during the measured runs. |
| 176 if (completedIterations >= 0) | 195 if (completedIterations >= 0) |
| 177 console.time("blink_perf"); | 196 console.time("blink_perf"); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 | 427 |
| 409 iframe.contentDocument.close(); | 428 iframe.contentDocument.close(); |
| 410 document.body.removeChild(iframe); | 429 document.body.removeChild(iframe); |
| 411 }; | 430 }; |
| 412 | 431 |
| 413 PerfTestRunner.measureTime(test); | 432 PerfTestRunner.measureTime(test); |
| 414 } | 433 } |
| 415 | 434 |
| 416 window.PerfTestRunner = PerfTestRunner; | 435 window.PerfTestRunner = PerfTestRunner; |
| 417 })(); | 436 })(); |
| OLD | NEW |