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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 PerfTestRunner.forceLayout(iframe.contentDocument); | 324 PerfTestRunner.forceLayout(iframe.contentDocument); |
325 } | 325 } |
326 | 326 |
327 iframe.contentDocument.close(); | 327 iframe.contentDocument.close(); |
328 document.body.removeChild(iframe); | 328 document.body.removeChild(iframe); |
329 }; | 329 }; |
330 | 330 |
331 PerfTestRunner.measureTime(test); | 331 PerfTestRunner.measureTime(test); |
332 } | 332 } |
333 | 333 |
| 334 // Support for benchmarks that run only once and produce multiple values. |
| 335 // The intended use: |
| 336 // 1. PerfTestRunner.startSingleRunBenchmark("Description") |
| 337 // 2. PerfTestRunner.logValues("metric 1", values1, unit1); |
| 338 // 3. PerfTestRunner.logValues("metric 2", values2, unit2); |
| 339 // ... |
| 340 // n. PerfTestRunner.finishSingleRunBenchmark() |
| 341 PerfTestRunner.startSingleRunBenchmark = function(description) { |
| 342 logLines = logLines || (window.testRunner ? [] : null); |
| 343 this.log("Description: " + description); |
| 344 } |
| 345 |
| 346 PerfTestRunner.logValues = function (metric, values, unit) { |
| 347 this.log("values " + metric + " " + values.join(", ") + " " + unit) |
| 348 } |
| 349 |
| 350 PerfTestRunner.finishSingleRunBenchmark = function() { |
| 351 if (logLines) |
| 352 logLines.forEach(logInDocument); |
| 353 if (window.testRunner) |
| 354 testRunner.notifyDone(); |
| 355 } |
| 356 |
| 357 |
334 window.PerfTestRunner = PerfTestRunner; | 358 window.PerfTestRunner = PerfTestRunner; |
335 })(); | 359 })(); |
OLD | NEW |