| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 4 <script src="../resources/runner.js"></script> | 4 <script src="../resources/runner.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 PerfTestRunner.prepareToMeasureValuesAsync({ | 7 PerfTestRunner.prepareToMeasureValuesAsync({ |
| 8 unit: 'ms', | 8 unit: 'ms', |
| 9 done: function () { | 9 done: function () { |
| 10 var iframe = document.querySelector('iframe'); | 10 var iframe = document.querySelector('iframe'); |
| 11 iframe.parentNode.removeChild(iframe); | 11 iframe.parentNode.removeChild(iframe); |
| 12 } | 12 } |
| 13 }); | 13 }); |
| 14 | 14 |
| 15 function runTest() { | 15 function runTest() { |
| 16 var iframe = document.querySelector('iframe'); | 16 var iframe = document.querySelector('iframe'); |
| 17 iframe.contentWindow.getSelection().removeAllRanges(); | 17 iframe.contentWindow.getSelection().removeAllRanges(); |
| 18 iframe.contentDocument.body.offsetTop; | 18 PerfTestRunner.forceLayoutOrFullFrame(iframe.contentDocument); |
| 19 | 19 |
| 20 setTimeout(function () { | 20 setTimeout(function () { |
| 21 var startTime = PerfTestRunner.now(); | 21 var startTime = PerfTestRunner.now(); |
| 22 iframe.contentDocument.execCommand('SelectAll'); | 22 iframe.contentDocument.execCommand('SelectAll'); |
| 23 iframe.contentDocument.body.offsetTop; | 23 PerfTestRunner.forceLayoutOrFullFrame(iframe.contentDocument); |
| 24 setTimeout(function () { | 24 setTimeout(function () { |
| 25 PerfTestRunner.measureValueAsync(PerfTestRunner.now() - startTime); | 25 PerfTestRunner.measureValueAsync(PerfTestRunner.now() - startTime); |
| 26 PerfTestRunner.gc(); | 26 PerfTestRunner.gc(); |
| 27 setTimeout(runTest, 0); | 27 setTimeout(runTest, 0); |
| 28 }, 0); | 28 }, 0); |
| 29 }, 0); | 29 }, 0); |
| 30 } | 30 } |
| 31 | 31 |
| 32 </script> | 32 </script> |
| 33 <iframe src="../Parser/resources/html5.html" onload="runTest()" width="800" heig
ht="600"> | 33 <iframe src="../Parser/resources/html5.html" onload="runTest()" width="800" heig
ht="600"> |
| 34 </body> | 34 </body> |
| 35 </html> | 35 </html> |
| OLD | NEW |