| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <body> | 2 <body> |
| 3 <script src="../resources/runner.js"></script> | 3 <script src="../resources/runner.js"></script> |
| 4 <script src="resources/paint.js"></script> |
| 4 <div id="container"></div> | 5 <div id="container"></div> |
| 5 <script> | 6 <script> |
| 6 // This test measures the lifecycle update performance when adding small | 7 // This test measures the lifecycle update performance when adding small |
| 7 // amounts of text to a large page. | 8 // amounts of text to a large page. |
| 8 | 9 |
| 9 var initialTextCount = 20000; | 10 var initialTextCount = 20000; |
| 10 var initialText = ""; | 11 var initialText = ""; |
| 11 for (var i = 0; i < initialTextCount; i++) | 12 for (var i = 0; i < initialTextCount; i++) |
| 12 initialText += '<span>a</span>'; | 13 initialText += '<span>a</span>'; |
| 13 | 14 |
| 14 var textToAppendEachRun = 5; | 15 var textToAppendEachRun = 5; |
| 15 PerfTestRunner.measureFrameTime({ | 16 measurePaint({ |
| 16 run: function() { | 17 run: function() { |
| 17 var text = document.createElement('span'); | 18 var text = document.createElement('span'); |
| 18 text.innerText = 'abc'; | 19 text.innerText = 'abc'; |
| 19 container.appendChild(text); | 20 container.appendChild(text); |
| 20 }, | 21 }, |
| 21 setup: function() { | 22 setup: function() { |
| 22 container.innerHTML = initialText; | 23 container.innerHTML = initialText; |
| 23 }, | 24 }, |
| 24 done: function() { | 25 done: function() { |
| 25 container.innerHTML = ""; | 26 container.innerHTML = ""; |
| 26 }, | 27 }, |
| 27 }); | 28 }); |
| 28 </script> | 29 </script> |
| 29 </body> | 30 </body> |
| OLD | NEW |