| 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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 } | 351 } |
| 352 | 352 |
| 353 function zeroTimeoutScheduler(task) { | 353 function zeroTimeoutScheduler(task) { |
| 354 setTimeout(task, 0); | 354 setTimeout(task, 0); |
| 355 } | 355 } |
| 356 | 356 |
| 357 function measureTimeOnce() { | 357 function measureTimeOnce() { |
| 358 // Force gc before measuring time to avoid interference between tests. | 358 // Force gc before measuring time to avoid interference between tests. |
| 359 PerfTestRunner.gc(); | 359 PerfTestRunner.gc(); |
| 360 | 360 |
| 361 addRunTestStartMarker(); |
| 361 var start = PerfTestRunner.now(); | 362 var start = PerfTestRunner.now(); |
| 362 addRunTestStartMarker(); | |
| 363 var returnValue = currentTest.run(); | 363 var returnValue = currentTest.run(); |
| 364 var end = PerfTestRunner.now(); |
| 364 addRunTestEndMarker(); | 365 addRunTestEndMarker(); |
| 365 var end = PerfTestRunner.now(); | |
| 366 | 366 |
| 367 if (returnValue - 0 === returnValue) { | 367 if (returnValue - 0 === returnValue) { |
| 368 if (returnValue < 0) | 368 if (returnValue < 0) |
| 369 PerfTestRunner.log("runFunction returned a negative value: " + r
eturnValue); | 369 PerfTestRunner.log("runFunction returned a negative value: " + r
eturnValue); |
| 370 return returnValue; | 370 return returnValue; |
| 371 } | 371 } |
| 372 | 372 |
| 373 return end - start; | 373 return end - start; |
| 374 } | 374 } |
| 375 | 375 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 | 438 |
| 439 iframe.contentDocument.close(); | 439 iframe.contentDocument.close(); |
| 440 document.body.removeChild(iframe); | 440 document.body.removeChild(iframe); |
| 441 }; | 441 }; |
| 442 | 442 |
| 443 PerfTestRunner.measureTime(test); | 443 PerfTestRunner.measureTime(test); |
| 444 } | 444 } |
| 445 | 445 |
| 446 window.PerfTestRunner = PerfTestRunner; | 446 window.PerfTestRunner = PerfTestRunner; |
| 447 })(); | 447 })(); |
| OLD | NEW |