jchaffraix@webkit.org | 7a78f9a | 2011-06-16 16:50:19 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <body> |
| 4 | <div id='sandbox'></div> |
| 5 | <div id="console"></div> |
| 6 | <script src="../resources/magnitude-perf.js"></script> |
| 7 | <script> |
| 8 | |
rniwa@webkit.org | 5cf7fa8 | 2012-06-15 07:38:37 +0000 | [diff] [blame] | 9 | if (window.testRunner) |
| 10 | testRunner.dumpAsText(); |
jchaffraix@webkit.org | 7a78f9a | 2011-06-16 16:50:19 +0000 | [diff] [blame] | 11 | |
| 12 | var table; |
| 13 | var sandbox = document.getElementById('sandbox'); |
| 14 | |
| 15 | // Check that table.rows.length is properly cached. |
| 16 | |
| 17 | function setupTableRows(magnitude) |
| 18 | { |
| 19 | if (sandbox.firstChild) |
| 20 | sandbox.removeChild(sandbox.firstChild); |
| 21 | table = document.createElement('table'); |
| 22 | |
| 23 | for (var i = 0; i < magnitude; ++i) { |
| 24 | var tr = document.createElement('tr'); |
| 25 | table.appendChild(tr); |
| 26 | } |
| 27 | sandbox.appendChild(table); |
| 28 | |
| 29 | // Make sure we have cached the length before testing! |
| 30 | table.rows.length; |
| 31 | } |
| 32 | |
| 33 | function testTableRows(magnitude) |
| 34 | { |
| 35 | table.rows.length; |
| 36 | } |
| 37 | |
| 38 | Magnitude.description('Tests that check that table.row.length is properly cached'); |
| 39 | Magnitude.run(setupTableRows, testTableRows, Magnitude.CONSTANT); |
| 40 | sandbox.removeChild(sandbox.firstChild); |
| 41 | </script> |
| 42 | </body> |
| 43 | </html> |